Skip to content

Commit 814d051

Browse files
lenticularis39rostedt
authored andcommitted
tools/build: Use SYSTEM_BPFTOOL for system bpftool
The feature test for system bpftool uses BPFTOOL as the variable to set its path, defaulting to just "bpftool" if not set by the user. This conflicts with selftests and a few other utilities, which expect BPFTOOL to be set to the in-tree bpftool path by default. For example, bpftool selftests fail to build: $ make -C tools/testing/selftests/bpf/ make: Entering directory '/home/tglozar/dev/linux/tools/testing/selftests/bpf' make: *** No rule to make target 'bpftool', needed by '/home/tglozar/dev/linux/tools/testing/selftests/bpf/tools/include/vmlinux.h'. Stop. make: Leaving directory '/home/tglozar/dev/linux/tools/testing/selftests/bpf' Fix the problem by renaming the variable used for system bpftool from BPFTOOL to SYSTEM_BPFTOOL, so that the new usage does not conflict with the existing one of BPFTOOL. Cc: John Kacur <[email protected]> Cc: Luis Goncalves <[email protected]> Link: https://lore.kernel.org/[email protected] Fixes: 8a635c3 ("tools/build: Add bpftool-skeletons feature test") Closes: https://lore.kernel.org/linux-kernel/[email protected]/ Reported-by: Venkat Rao Bagalkote <[email protected]> Tested-by: Venkat Rao Bagalkote <[email protected]> Suggested-by: Quentin Monnet <[email protected]> Acked-by: Quentin Monnet <[email protected]> Signed-off-by: Tomas Glozar <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent dc4d4e7 commit 814d051

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tools/build/feature/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ $(OUTPUT)test-libpfm4.bin:
419419
$(BUILD) -lpfm
420420

421421
$(OUTPUT)test-bpftool-skeletons.bin:
422-
$(BPFTOOL) version | grep '^features:.*skeletons' \
422+
$(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
423423
> $(@:.bin=.make.output) 2>&1
424424
###############################
425425

tools/scripts/Makefile.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ LLVM_OBJCOPY ?= llvm-objcopy
9292
LLVM_STRIP ?= llvm-strip
9393

9494
# Some tools require bpftool
95-
BPFTOOL ?= bpftool
95+
SYSTEM_BPFTOOL ?= bpftool
9696

9797
ifeq ($(CC_NO_CLANG), 1)
9898
EXTRA_WARNINGS += -Wstrict-aliasing=3

tools/tracing/rtla/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ src/timerlat.bpf.o: src/timerlat.bpf.c
7878
$(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -c $(filter %.c,$^) -o $@
7979

8080
src/timerlat.skel.h: src/timerlat.bpf.o
81-
$(QUIET_GENSKEL)$(BPFTOOL) gen skeleton $< > $@
81+
$(QUIET_GENSKEL)$(SYSTEM_BPFTOOL) gen skeleton $< > $@
8282
else
8383
src/timerlat.skel.h:
8484
$(Q)echo '/* BPF skeleton is disabled */' > src/timerlat.skel.h

0 commit comments

Comments
 (0)