From 1178120c3bed1733aea1c465200a6b42f8a7105d Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Fri, 6 Nov 2026 08:35:28 +0100 Subject: [PATCH] kbuild: rust: support stabilized flag `-Cprofile-sample-use` for Rust >= 1.100 Starting with Rust 1.100.0 (expected 2026-11-12), the `-Zprofile-sample-use` flag has been stabilized as `-Cprofile-sample-use` and the former is not available anymore [1]. Without this change, when building with `CLANG_AUTOFDO_PROFILE` set, one gets in the latest betas and nightlies: error: unknown unstable option: `profile-sample-use` Thus pass the right name. Cc: stable@vger.kernel.org # 7.3.x Link: https://github.com/rust-lang/rust/pull/155942 [1] Reviewed-by: Alice Ryhl Acked-by: Nicolas Schier Link: https://patch.msgid.link/20261106073528.93371-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda --- scripts/Makefile.autofdo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.autofdo b/scripts/Makefile.autofdo index 57a3aba6ffc2..32c18df237f1 100644 --- a/scripts/Makefile.autofdo +++ b/scripts/Makefile.autofdo @@ -13,7 +13,7 @@ endif ifdef CLANG_AUTOFDO_PROFILE CFLAGS_AUTOFDO_CLANG += -fprofile-sample-use=$(CLANG_AUTOFDO_PROFILE) -ffunction-sections CFLAGS_AUTOFDO_CLANG += -fsplit-machine-functions - RUSTFLAGS_AUTOFDO_CLANG += -Zprofile-sample-use=$(CLANG_AUTOFDO_PROFILE) -Zfunction-sections=y + RUSTFLAGS_AUTOFDO_CLANG += $(if $(call rustc-min-version,110000),-Cprofile-sample-use,-Zprofile-sample-use)=$(CLANG_AUTOFDO_PROFILE) -Zfunction-sections=y RUSTFLAGS_AUTOFDO_CLANG += -Cllvm-args=-split-machine-functions endif