From 738d0cc77e4e7f7fdc91d9f48c3b15d3cbb046ed Mon Sep 17 00:00:00 2001 From: James Clark Date: Wed, 15 Jul 2026 15:53:50 +0100 Subject: tools/build: Allow versioning LLVM readelf Documentation/kbuild/llvm.rst mentions that readelf is included in the LLVM toolchain, but it's not currently included in this block. Add it so that LLVM=... options also apply to readelf. Users in tools/ were Perf which was hardcoding it, and another was the BPF makefile. Both already include Makefile.include so convert them to use the new variables. Where readelf wasn't doing anything arch specific, use HOSTREADELF because it's more likely to be installed. Reviewed-by: Ian Rogers Signed-off-by: James Clark Acked-by: Ihor Solodrai Acked-by: Kumar Kartikeya Dwivedi Signed-off-by: Namhyung Kim --- tools/scripts/Makefile.include | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/scripts/Makefile.include') diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index e81e5b479c56..46a3872b8762 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include @@ -73,6 +73,8 @@ ifneq ($(LLVM),) $(call allow-override,LLC,$(LLVM_PREFIX)llc$(LLVM_SUFFIX)) $(call allow-override,LLVM_CONFIG,$(LLVM_PREFIX)llvm-config$(LLVM_SUFFIX)) $(call allow-override,LLVM_OBJCOPY,$(LLVM_PREFIX)llvm-objcopy$(LLVM_SUFFIX)) + $(call allow-override,READELF,$(LLVM_PREFIX)llvm-readelf$(LLVM_SUFFIX)) + $(call allow-override,HOSTREADELF,$(LLVM_PREFIX)llvm-readelf$(LLVM_SUFFIX)) else # Allow setting various cross-compile vars or setting CROSS_COMPILE as a prefix. $(call allow-override,CC,$(CROSS_COMPILE)gcc) @@ -80,11 +82,13 @@ else $(call allow-override,LD,$(CROSS_COMPILE)ld) $(call allow-override,CXX,$(CROSS_COMPILE)g++) $(call allow-override,STRIP,$(CROSS_COMPILE)strip) + $(call allow-override,READELF,$(CROSS_COMPILE)readelf) # Host versions aren't prefixed $(call allow-override,HOSTAR,ar) $(call allow-override,HOSTCC,gcc) $(call allow-override,HOSTLD,ld) + $(call allow-override,HOSTREADELF,readelf) # Some tools still require Clang, LLC and/or LLVM utils $(call allow-override,CLANG,clang) -- cgit v1.2.3