[Buildroot] [PATCH] packages/linux-tools: perf: explicitily disable rust if not selected

Bastien Curutchet via buildroot <[email protected]> Mon, 27 Jul 2026 15:03:46 +0200
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
Since kernel v7.0, perf uses `rustc --version` to know whether or not
rust is available. If rust is installed on the host, this `rustc
--version` works fine but then the perf build fails with following error
(on aarch64) if the host-rust isn't selected:

rustc  /home/bastien/embedded-linux-imx93-frdm-labs/integration/buildroot/output/build/linux-7.1.3/tools/perf/tests/workloads/code_with_type.a
error[E0463]: can't find crate for `std`
  |
  = note: the `aarch64-unknown-linux-gnu` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-unknown-linux-gnu`

error: aborting due to 1 previous error

Add a dependency to host-rustc if already enabled, explicitily disable
perf's rust part otherwise

Signed-off-by: Bastien Curutchet <[email protected]>
---
 package/linux-tools/linux-tool-perf.mk.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in
index 3238948d76..9718d83121 100644
--- a/package/linux-tools/linux-tool-perf.mk.in
+++ b/package/linux-tools/linux-tool-perf.mk.in
@@ -134,6 +134,12 @@ else
 PERF_MAKE_FLAGS += NO_LIBTRACEEVENT=1
 endif
 
+ifeq ($(BR2_PACKAGE_HOST_RUSTC),y)
+PERF_DEPENDENCIES += host-rustc
+else
+PERF_MAKE_FLAGS += NO_RUST=1
+endif
+
 # We really do not want to build the perf documentation, because it
 # has stringent requirement on the documentation generation tools,
 # like xmlto and asciidoc), which may be lagging behind on some

---
base-commit: cdeeb9b9c688b5bcdcc80bf89f2c046b0bd55bb8
change-id: 20260724-perf-fix-f14d1c7fb681

Best regards,
-- 
Bastien Curutchet <[email protected]>

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