[bpf-next] selftests/bpf: propagate LLVM toolchain into runqslower sub-make

Hoyeon Lee posted 1 patch 1 week, 5 days ago
tools/testing/selftests/bpf/Makefile | 1 +
tools/testing/selftests/lib.mk       | 1 +
2 files changed, 2 insertions(+)
[bpf-next] selftests/bpf: propagate LLVM toolchain into runqslower sub-make
Posted by Hoyeon Lee 1 week, 5 days ago
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 <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
-- 
2.51.1
Re: [bpf-next] selftests/bpf: propagate LLVM toolchain into runqslower sub-make
Posted by Andrii Nakryiko 6 days, 3 hours ago
On Tue, Nov 18, 2025 at 8:38 PM Hoyeon Lee <hoyeon.lee@suse.com> wrote:
>
> The runqslower build invokes a nested make, but the selected LLVM

I think runqslower in kernel repo has long since served its purpose.
There is no point in maintaining its Makefile. The tool itself lives
in BCC repo. Its original purpose was to show real-world BPF-based
tooling end-to-end setup and implementation. BPF, libbpf, entire BPF
ecosystem has evolved and grown, I think we can remove runqslower now.
Do you mind just sending a patch dropping it instead?

pw-bot: cr


> 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 <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
> --
> 2.51.1
>
>