From: Mickaël Salaün Date: Fri, 26 Jan 2018 00:39:30 +0000 (+0100) Subject: samples/bpf: Partially fixes the bpf.o build X-Git-Tag: v5.15~9522^2~33^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c25ef6a5e62fa212d298ce24995ce239f29b5f96;p=platform%2Fkernel%2Flinux-starfive.git samples/bpf: Partially fixes the bpf.o build Do not build lib/bpf/bpf.o with this Makefile but use the one from the library directory. This avoid making a buggy bpf.o file (e.g. missing symbols). This patch is useful if some code (e.g. Landlock tests) needs both the bpf.o (from tools/lib/bpf) and the bpf_load.o (from samples/bpf). Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Signed-off-by: Daniel Borkmann --- diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 7f61a3d..64335bb 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -201,13 +201,16 @@ CLANG_ARCH_ARGS = -target $(ARCH) endif # Trick to allow make to be run from this directory -all: +all: $(LIBBPF) $(MAKE) -C ../../ $(CURDIR)/ clean: $(MAKE) -C ../../ M=$(CURDIR) clean @rm -f *~ +$(LIBBPF): FORCE + $(MAKE) -C $(dir $@) $(notdir $@) + $(obj)/syscall_nrs.s: $(src)/syscall_nrs.c $(call if_changed_dep,cc_s_c)