aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickaël Salaün <mic@digikod.net>2018-01-25 19:39:30 -0500
committerDaniel Borkmann <daniel@iogearbox.net>2018-01-26 17:57:10 -0500
commitc25ef6a5e62fa212d298ce24995ce239f29b5f96 (patch)
treee2154d9a6f0dd70ea7f77a80dfe5b98df6b34d6c
parent771fc607e6b97be8f0cc7dfaa61173009c2214d4 (diff)
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 <mic@digikod.net> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r--samples/bpf/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 7f61a3d57fa7..64335bb94f9f 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -201,13 +201,16 @@ CLANG_ARCH_ARGS = -target $(ARCH)
201endif 201endif
202 202
203# Trick to allow make to be run from this directory 203# Trick to allow make to be run from this directory
204all: 204all: $(LIBBPF)
205 $(MAKE) -C ../../ $(CURDIR)/ 205 $(MAKE) -C ../../ $(CURDIR)/
206 206
207clean: 207clean:
208 $(MAKE) -C ../../ M=$(CURDIR) clean 208 $(MAKE) -C ../../ M=$(CURDIR) clean
209 @rm -f *~ 209 @rm -f *~
210 210
211$(LIBBPF): FORCE
212 $(MAKE) -C $(dir $@) $(notdir $@)
213
211$(obj)/syscall_nrs.s: $(src)/syscall_nrs.c 214$(obj)/syscall_nrs.s: $(src)/syscall_nrs.c
212 $(call if_changed_dep,cc_s_c) 215 $(call if_changed_dep,cc_s_c)
213 216