Skip to content

Commit 8a2cc05

Browse files
committed
bpfilter: use 'userprogs' syntax to build bpfilter_umh
The user mode helper should be compiled for the same architecture as the kernel. This Makefile reused the 'hostprogs' syntax by overriding HOSTCC with CC. Use the new syntax 'userprogs' to fix the Makefile mess. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Sam Ravnborg <sam@ravnborg.org>
1 parent 7f3a59d commit 8a2cc05

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎net/bpfilter/Makefile‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@
33
# Makefile for the Linux BPFILTER layer.
44
#
55

6-
hostprogs := bpfilter_umh
6+
userprogs := bpfilter_umh
77
bpfilter_umh-objs := main.o
8-
KBUILD_HOSTCFLAGS += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi \
9-
$(filter -m32 -m64, $(KBUILD_CFLAGS))
10-
HOSTCC := $(CC)
8+
userccflags += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi
119

12-
ifeq ($(CONFIG_BPFILTER_UMH), y)
13-
# builtin bpfilter_umh should be compiled with -static
10+
# builtin bpfilter_umh should be linked with -static
1411
# since rootfs isn't mounted at the time of __init
1512
# function is called and do_execv won't find elf interpreter
16-
KBUILD_HOSTLDFLAGS += -static $(filter -m32 -m64, $(KBUILD_CFLAGS))
17-
endif
13+
userldflags += -static
1814

1915
$(obj)/bpfilter_umh_blob.o: $(obj)/bpfilter_umh
2016

0 commit comments

Comments
 (0)