Skip to contentSkip to conversation

perf: disable BUILD_BPF_SKEL when rust in kernel feature is enabled

PATCH In review [email protected] 2 participants 2 messages May 19 – May 20

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 perf: disable BUILD_BPF_SKEL when rust in kernel feature is enabled

From: Harish Sadineni <[email protected]>

Enabling the Rust in-kernel feature pulls in clang-native as a dependency for the kernel build. During the perf build, the presence of clang causes all BUILD_BPF_SKEL dependency checks to succeed, which makes perf attempt to build bpftool as part of its build process and make build to fail.

Previously, When Rust support was not enabled, BUILD_BPF_SKEL is set 0 due to missing clang dependency.

Error:
| make[3]: *** ../bpf/bpftool: No such file or directory. Stop.

As a workaround currently disabling BUILD_BPF_SKEL to make perf to build.

---
 meta/recipes-kernel/perf/perf.bb | 6 ++++++
 1 file changed, 6 insertions(+)
meta/recipes-kernel/perf/perf.bb +6 -0
index c3ef25fd99..6e4d395828 100644
@@ -438,3 +438,9 @@ perf_fix_sources () {
 		fi
 	done
 }
+
+# Disable BUILD_BPF_SKEL when the Rust kernel feature is enabled.
+# Rust in kernel support pulls in clang-native, which satisfies the
+# BUILD_BPF_SKEL dependency checks and causes perf to attempt
+# building bpftool, resulting in a build failure.
+EXTRA_OEMAKE += "${@bb.utils.contains('KERNEL_FEATURES', 'rust', 'BUILD_BPF_SKEL=0', '', d)}"
Signature · 1 line
2.49.0
#1 lore raw
Quoted 28 lines · Harish via lists.openembedded.org

From: Harish Sadineni <[email protected]>

Enabling the Rust in-kernel feature pulls in clang-native as a dependency for the kernel build. During the perf build, the presence of clang causes all BUILD_BPF_SKEL dependency checks to succeed, which makes perf attempt to build bpftool as part of its build process and make build to fail.

Previously, When Rust support was not enabled, BUILD_BPF_SKEL is set 0 due to missing clang dependency.

Error:

Quoted 1 line

make[3]: *** ../bpf/bpftool: No such file or directory.  Stop.

As a workaround currently disabling BUILD_BPF_SKEL to make perf to build.

---
 meta/recipes-kernel/perf/perf.bb | 6 ++++++

 1 file changed, 6 insertions(+)
meta/recipes-kernel/perf/perf.bb +0 -0
index c3ef25fd99..6e4d395828 100644
@@ -438,3 +438,9 @@ perf_fix_sources () {

  fi
  done
 }

meta/recipes-kernel/perf/perf.bb perf_fix_sources () { · line 446

Quoted 6 lines
meta/recipes-kernel/perf/perf.bb +6 -0
+
+# Disable BUILD_BPF_SKEL when the Rust kernel feature is enabled.
+# Rust in kernel support pulls in clang-native, which satisfies the
+# BUILD_BPF_SKEL dependency checks and causes perf to attempt
+# building bpftool, resulting in a build failure.
+EXTRA_OEMAKE += "${@bb.utils.contains('KERNEL_FEATURES', 'rust', 'BUILD_BPF_SKEL=0', '', d)}"

Wouldn't you disable that unconditionally, or add a PACKAGECONFIG for it which we just disable by default?

Cheers,

Richard