kbuild: rust: rename flag to `-Zdebuginfo-for-profiling` for Rust >= 1.98
Subsystems (3)
Miguel Ojeda
maintainerPATCH 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
@@ -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
Quoted 5 lines · Miguel Ojeda
Starting with Rust 1.98.0 (expected 2026-08-20), the
-Zdebug-info-for-profilingflag has been renamed to-Zdebuginfo-for-profiling(i.e. one less dash, to matchdebuginfos in other flags) [1].
Quoted 8 lines
Without this change, one gets in the latest nightlies:
error: unknown unstable option:
debug-info-for-profilingThus pass the right name.
Signed-off-by Miguel Ojeda <[email protected]>
Quoted 22 lines
--- scripts/Makefile.autofdo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/Makefile.autofdo +1
-1@@ -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 += -gmltbase-commit:
025fd4b4fd382112bd4489e5b4437a295934fc19Signature · 1 line
2.54.0
Signature · 2 lines
Cheers, Nathan
Quoted 5 lines · Miguel Ojeda
Starting with Rust 1.98.0 (expected 2026-08-20), the
-Zdebug-info-for-profilingflag has been renamed to-Zdebuginfo-for-profiling(i.e. one less dash, to matchdebuginfos in other flags) [1].
Quoted 8 lines
Without this change, one gets in the latest nightlies:
error: unknown unstable option:
debug-info-for-profilingThus pass the right name.
Signed-off-by Miguel Ojeda <[email protected]>
Miguel Ojeda
AppliedQuoted 6 lines · Miguel Ojeda
Starting with Rust 1.98.0 (expected 2026-08-20), the
-Zdebug-info-for-profilingflag has been renamed to-Zdebuginfo-for-profiling(i.e. one less dash, to matchdebuginfos in other flags) [1].
Quoted 8 lines
Without this change, one gets in the latest nightlies:
error: unknown unstable option:
debug-info-for-profilingThus pass the right name.
Signed-off-by Miguel Ojeda <[email protected]>
Applied to rust-next -- thanks everyone!
Cheers,
Miguel