The selftests/bpf invokes a nested make when building runqslower, but LLVM toolchain version (clang/llvm-strip) is not propagated. As a result, runqslower is built with system default clang, not respecting specified LLVM version.
# LLVM=-21 make -C tools/testing/selftests/bpf ... make feature_display=0 -C /bpf/tools/bpf/runqslower \ OUTPUT=/bpf/tools/testing/selftests/bpf/tools/build/runqslower/ \ BPFOBJ_OUTPUT=/bpf/tools/testing/selftests/bpf/tools/build/libbpf/ \ BPFOBJ=/bpf/tools/testing/selftests/bpf/tools/build/libbpf/libbpf.a \ BPF_INCLUDE=/bpf/tools/testing/selftests/bpf/tools/include \ BPFTOOL_OUTPUT=/bpf/tools/testing/selftests/bpf/tools/build/bpftool/ \ VMLINUX_BTF=/sys/kernel/btf/vmlinux BPF_TARGET_ENDIAN=--target=bpfel \ EXTRA_CFLAGS='-g -O0 ' EXTRA_LDFLAGS=' ' && \ cp /bpf/tools/testing/selftests/bpf/tools/build/runqslower/runqslower \ /bpf/tools/testing/selftests/bpf/runqslower clang -g -O2 --target=bpfel -I/bpf/tools/testing/selftests/bpf/tools/build/runqslower/ \ -I/bpf/tools/testing/selftests/bpf/tools/include -I/bpf/tools/include/uapi \ -c runqslower.bpf.c -o /bpf/tools/testing/selftests/bpf/tools/build/runqslower/runqslower.bpf.o && \ llvm-strip -g /bpf/tools/testing/selftests/bpf/tools/build/runqslower//runqslower.bpf.o /bin/sh: 1: clang: not found
Explicitly propagate CLANG and LLVM_STRIP to the runqslower sub-make so that the LLVM toolchain selection from lib.mk is preserved.
Signed-off-by: Hoyeon Lee hoyeon.lee@suse.com --- 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
linux-kselftest-mirror@lists.linaro.org