]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tools/build: Use SYSTEM_BPFTOOL for system bpftool
authorTomas Glozar <tglozar@redhat.com>
Wed, 26 Mar 2025 00:40:18 +0000 (01:40 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 26 Mar 2025 14:31:31 +0000 (10:31 -0400)
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 <jkacur@redhat.com>
Cc: Luis Goncalves <lgoncalv@redhat.com>
Link: https://lore.kernel.org/20250326004018.248357-1-tglozar@redhat.com
Fixes: 8a635c3856dd ("tools/build: Add bpftool-skeletons feature test")
Closes: https://lore.kernel.org/linux-kernel/5df6968a-2e5f-468e-b457-fc201535dd4c@linux.ibm.com/
Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Suggested-by: Quentin Monnet <qmo@kernel.org>
Acked-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
tools/build/feature/Makefile
tools/scripts/Makefile.include
tools/tracing/rtla/Makefile

index 4f9c1d950f5db5b3afab442f4823e3461d2d1b89..b8b5fb183dd406938b118e0dd88d42f61ce98084 100644 (file)
@@ -419,7 +419,7 @@ $(OUTPUT)test-libpfm4.bin:
        $(BUILD) -lpfm
 
 $(OUTPUT)test-bpftool-skeletons.bin:
-       $(BPFTOOL) version | grep '^features:.*skeletons' \
+       $(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
                > $(@:.bin=.make.output) 2>&1
 ###############################
 
index 71bbe52721b35fdaada3b1d9cec73fd0015a9207..34a33c1ad96cf944a960f399bf5541d4aca387e9 100644 (file)
@@ -92,7 +92,7 @@ LLVM_OBJCOPY  ?= llvm-objcopy
 LLVM_STRIP     ?= llvm-strip
 
 # Some tools require bpftool
-BPFTOOL                ?= bpftool
+SYSTEM_BPFTOOL ?= bpftool
 
 ifeq ($(CC_NO_CLANG), 1)
 EXTRA_WARNINGS += -Wstrict-aliasing=3
index 557af322be6106282e8004b57a8164130c8dbe57..3dc050317b9d4fc0ee5a09c047caa3c6f24defb6 100644 (file)
@@ -78,7 +78,7 @@ src/timerlat.bpf.o: src/timerlat.bpf.c
        $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -c $(filter %.c,$^) -o $@
 
 src/timerlat.skel.h: src/timerlat.bpf.o
-       $(QUIET_GENSKEL)$(BPFTOOL) gen skeleton $< > $@
+       $(QUIET_GENSKEL)$(SYSTEM_BPFTOOL) gen skeleton $< > $@
 else
 src/timerlat.skel.h:
        $(Q)echo '/* BPF skeleton is disabled */' > src/timerlat.skel.h