Skip to contentSkip to conversation

package/linux-tools: perf: fix BPF skeletons disabling for kernels <= 6.6

PATCH New Yegor Yefremov via buildroot 1 participant 1 message Nov 18

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/linux-tools: perf: fix BPF skeletons disabling for kernels <= 6.6

Commit d2f3cd8cbe33 ("package/linux-tools: perf: explicitly disable BPF skeletons") passes BUILD_BPF_SKEL=0 to perf. That only disables the BPF skeletons since linux 6.7, where they are built by default unless BUILD_BPF_SKEL is set to something else than 1. Up to 6.6, which includes the 5.10, 5.15, 6.1 and 6.6 LTS series, perf tests "ifdef BUILD_BPF_SKEL", so any non-empty value, including 0, enables them. Without clang on the host, the build then fails:

Makefile.config:671: *** Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL. Stop.

and with clang, the host's clang is used, which is what the commit above meant to avoid.

As no single value disables the skeletons on all versions, look at perf's Makefile.config at build time: pass BUILD_BPF_SKEL=0 when it uses "ifndef BUILD_BPF_SKEL" (6.7 and later), and an empty value otherwise, which "ifdef" treats as undefined.

This issue has been present since commit d2f3cd8cbe33 ("package/linux-tools:
perf: explicitly disable BPF skeletons"). It therefore affects 2026.11-rc1, 2025.02.x since 2025.02.20 and 2026.08.x since 2026.08.2.

Fixes d2f3cd8cbe3316484d6953f73db4a31277adcf7d ("package/linux-tools: perf: explicitly disable BPF skeletons")
Assisted-by Claude:claude-opus-5-5
---
 package/linux-tools/linux-tool-perf.mk.in | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
package/linux-tools/linux-tool-perf.mk.in +9 -2
index 45bb2bd7a3..1f76846b3e 100644
@@ -30,8 +30,15 @@ PERF_MAKE_FLAGS = \
 	NO_LIBPYTHON=1 \
 	NO_LIBBIONIC=1 \
 	NO_RUST=1 \
-	NO_SHELLCHECK=1 \
-	BUILD_BPF_SKEL=0
+	NO_SHELLCHECK=1
+
+# Never build the BPF skeletons, as that would use the host's clang
+# and system headers. Since 6.7, they are built by default unless
+# BUILD_BPF_SKEL=0; until 6.6, they are built whenever BUILD_BPF_SKEL
+# is defined, whatever its value, so it must be empty there.
+PERF_MAKE_FLAGS += \
+	BUILD_BPF_SKEL=$$(grep -qs '^ifndef BUILD_BPF_SKEL' \
+		$(LINUX_DIR)/tools/perf/Makefile.config && echo 0)
 
 # We need to pass an argument to ld for setting the emulation when
 # building for MIPS architecture, otherwise the default one will always
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot