Skip to contentSkip to conversation

kbuild: rust: rename flag to `-Zdebuginfo-for-profiling` for Rust >= 1.98

PATCH Applied Miguel Ojeda 4 participants 4 messages Jun 2 – Jun 4

Subsystems (3)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 1/1 kbuild: rust: rename flag to `-Zdebuginfo-for-profiling` for Rust >= 1.98

Starting with Rust 1.98.0 (expected 2026-08-20), the -Zdebug-info-for-profiling flag has been renamed to -Zdebuginfo-for-profiling (i.e. one less dash, to match debuginfos in other flags) [1].

Without this change, one gets in the latest nightlies:

error: unknown unstable option: debug-info-for-profiling

Thus pass the right name.

---
 scripts/Makefile.autofdo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.autofdo +1 -1
index 3f08acab4549..1442043da139 100644
@@ -3,7 +3,7 @@
 # Enable available and selected Clang AutoFDO features.
 
 CFLAGS_AUTOFDO_CLANG := -fdebug-info-for-profiling -mllvm -enable-fs-discriminator=true -mllvm -improved-fs-discriminator=true
-RUSTFLAGS_AUTOFDO_CLANG := -Zdebug-info-for-profiling -Cllvm-args=-enable-fs-discriminator=true -Cllvm-args=-improved-fs-discriminator=true
+RUSTFLAGS_AUTOFDO_CLANG := $(if $(call rustc-min-version,109800),-Zdebuginfo-for-profiling,-Zdebug-info-for-profiling) -Cllvm-args=-enable-fs-discriminator=true -Cllvm-args=-improved-fs-discriminator=true
 
 ifndef CONFIG_DEBUG_INFO
   CFLAGS_AUTOFDO_CLANG += -gmlt

base-commit: 025fd4b4fd382112bd4489e5b4437a295934fc19

Signature · 1 line
2.54.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Miguel Ojeda

Starting with Rust 1.98.0 (expected 2026-08-20), the -Zdebug-info-for-profiling flag has been renamed to -Zdebuginfo-for-profiling (i.e. one less dash, to match debuginfos in other flags) [1].

Quoted 8 lines

Without this change, one gets in the latest nightlies:

error: unknown unstable option: debug-info-for-profiling

Thus pass the right name.

Quoted 22 lines
---
 scripts/Makefile.autofdo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.autofdo +1 -1
index 3f08acab4549..1442043da139 100644
@@ -3,7 +3,7 @@
 # Enable available and selected Clang AutoFDO features.
 
 CFLAGS_AUTOFDO_CLANG := -fdebug-info-for-profiling -mllvm -enable-fs-discriminator=true -mllvm -improved-fs-discriminator=true
-RUSTFLAGS_AUTOFDO_CLANG := -Zdebug-info-for-profiling -Cllvm-args=-enable-fs-discriminator=true -Cllvm-args=-improved-fs-discriminator=true
+RUSTFLAGS_AUTOFDO_CLANG := $(if $(call rustc-min-version,109800),-Zdebuginfo-for-profiling,-Zdebug-info-for-profiling) -Cllvm-args=-enable-fs-discriminator=true -Cllvm-args=-improved-fs-discriminator=true
 
 ifndef CONFIG_DEBUG_INFO
   CFLAGS_AUTOFDO_CLANG += -gmlt

base-commit: 025fd4b4fd382112bd4489e5b4437a295934fc19

Signature · 1 line
2.54.0
Signature · 2 lines
Cheers,
Nathan
reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Miguel Ojeda
Quoted 5 lines · Miguel Ojeda

Starting with Rust 1.98.0 (expected 2026-08-20), the -Zdebug-info-for-profiling flag has been renamed to -Zdebuginfo-for-profiling (i.e. one less dash, to match debuginfos in other flags) [1].

Quoted 8 lines

Without this change, one gets in the latest nightlies:

error: unknown unstable option: debug-info-for-profiling

Thus pass the right name.

Applied
#3 lore raw
In reply to Miguel Ojeda
Quoted 6 lines · Miguel Ojeda

Starting with Rust 1.98.0 (expected 2026-08-20), the -Zdebug-info-for-profiling flag has been renamed to -Zdebuginfo-for-profiling (i.e. one less dash, to match debuginfos in other flags) [1].

Quoted 8 lines

Without this change, one gets in the latest nightlies:

error: unknown unstable option: debug-info-for-profiling

Thus pass the right name.

Applied to rust-next -- thanks everyone!

Cheers,
Miguel