The runqslower build invokes a nested make, but the selected LLVM
toolchain (via LLVM=-<version>) is not propagated. This causes the
sub-make to call the system-default 'clang' and 'llvm-strip' even when
a specific LLVM version is intended.
# LLVM=-20 V=1 make -C tools/testing/selftests/bpf
...
make -C tools/bpf/runqslower ...
clang -g -O2 --target=bpfel -I... -c runqslower.bpf.c -o runqslower.bpf.o
&& \
llvm-strip -g runqslower.bpf.o
/bin/sh: 1: clang: not found
(expected: clang-20 and llvm-strip-20)
Propagate CLANG and LLVM_STRIP to the sub-make to ensure LLVM version
consistency across all builds.
Signed-off-by: Hoyeon Lee <[email protected]>
---
tools/testing/selftests/bpf/Makefile | 1 +
tools/testing/selftests/lib.mk | 1 +
2 files changed, 2 insertions(+)
diff --git a/tools/testing/selftests/bpf/Makefile
b/tools/testing/selftests/bpf/Makefile
index 34ea23c63bd5..79ab69920dca 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -306,6 +306,7 @@ endif
$(OUTPUT)/runqslower: $(BPFOBJ) | $(DEFAULT_BPFTOOL) $(RUNQSLOWER_OUTPUT)
$(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower \
+ CLANG=$(CLANG) LLVM_STRIP=$(LLVM_STRIP) \
OUTPUT=$(RUNQSLOWER_OUTPUT) VMLINUX_BTF=$(VMLINUX_BTF) \
BPFTOOL_OUTPUT=$(HOST_BUILD_DIR)/bpftool/ \
BPFOBJ_OUTPUT=$(BUILD_DIR)/libbpf/ \
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index a448fae57831..f14255b2afbd 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -8,6 +8,7 @@ LLVM_SUFFIX := $(LLVM)
endif
CLANG := $(LLVM_PREFIX)clang$(LLVM_SUFFIX)
+LLVM_STRIP := $(LLVM_PREFIX)llvm-strip$(LLVM_SUFFIX)
CLANG_TARGET_FLAGS_arm := arm-linux-gnueabi
CLANG_TARGET_FLAGS_arm64 := aarch64-linux-gnu
--
2.51.1