summaryrefslogtreecommitdiffstats
path: root/tools/bpf
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2020-03-12 19:23:31 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2020-03-13 00:08:33 +0100
commit39be909c38a42543239de97087d3c93ea9272864 (patch)
tree5b03b3392ad73451b923bede2396bd5f8fae0568 /tools/bpf
parentbpftool: Only build bpftool-prog-profile if supported by clang (diff)
downloadlinux-39be909c38a42543239de97087d3c93ea9272864.tar.xz
linux-39be909c38a42543239de97087d3c93ea9272864.zip
bpftool: Skeleton should depend on libbpf
Add the dependency to libbpf, to fix build errors like: In file included from skeleton/profiler.bpf.c:5: .../bpf_helpers.h:5:10: fatal error: 'bpf_helper_defs.h' file not found #include "bpf_helper_defs.h" ^~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [skeleton/profiler.bpf.o] Error 1 make: *** Waiting for unfinished jobs.... Fixes: 47c09d6a9f67 ("bpftool: Introduce "prog profile" command") Suggested-by: Quentin Monnet <quentin@isovalent.com> Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Quentin Monnet <quentin@isovalent.com> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20200312182332.3953408-3-songliubraving@fb.com
Diffstat (limited to 'tools/bpf')
-rw-r--r--tools/bpf/bpftool/Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index b0574751f231..9ca3bfbb9ac4 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -126,11 +126,12 @@ $(OUTPUT)_prog.o: prog.c
$(OUTPUT)_bpftool: $(_OBJS) $(LIBBPF)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(_OBJS) $(LIBS)
-skeleton/profiler.bpf.o: skeleton/profiler.bpf.c
+skeleton/profiler.bpf.o: skeleton/profiler.bpf.c $(LIBBPF)
$(QUIET_CLANG)$(CLANG) \
-I$(srctree)/tools/include/uapi/ \
-I$(srctree)/tools/testing/selftests/bpf/include/uapi \
- -I$(srctree)/tools/lib -g -O2 -target bpf -c $< -o $@
+ -I$(LIBBPF_PATH) -I$(srctree)/tools/lib \
+ -g -O2 -target bpf -c $< -o $@
profiler.skel.h: $(OUTPUT)_bpftool skeleton/profiler.bpf.o
$(QUIET_GEN)$(OUTPUT)./_bpftool gen skeleton skeleton/profiler.bpf.o > $@