Skip to content

Commit 6f449f3

Browse files
committed
Default rust.new-symbol-mangling to true universally
Instead of using legacy scheme for library but new scheme for compiler when the option is not set.
1 parent 75716b4 commit 6f449f3

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

config.example.toml

+3-5
Original file line numberDiff line numberDiff line change
@@ -757,11 +757,9 @@
757757

758758
# Enable symbol-mangling-version v0. This can be helpful when profiling rustc,
759759
# as generics will be preserved in symbols (rather than erased into opaque T).
760-
# When no setting is given, the new scheme will be used when compiling the
761-
# compiler and its tools and the legacy scheme will be used when compiling the
762-
# standard library.
763-
# If an explicit setting is given, it will be used for all parts of the codebase.
764-
#new-symbol-mangling = true|false (see comment)
760+
# When no setting is given, the new scheme will be used when compiling all parts
761+
# of the codebase.
762+
#new-symbol-mangling = true (see comment)
765763

766764
# Select LTO mode that will be used for compiling rustc. By default, thin local LTO
767765
# (LTO within a single crate) is used (like for any Rust crate). You can also select

src/bootstrap/src/core/builder/cargo.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -549,21 +549,7 @@ impl Builder<'_> {
549549
rustflags.arg(sysroot_str);
550550
}
551551

552-
let use_new_symbol_mangling = match self.config.rust_new_symbol_mangling {
553-
Some(setting) => {
554-
// If an explicit setting is given, use that
555-
setting
556-
}
557-
None => {
558-
if mode == Mode::Std {
559-
// The standard library defaults to the legacy scheme
560-
false
561-
} else {
562-
// The compiler and tools default to the new scheme
563-
true
564-
}
565-
}
566-
};
552+
let use_new_symbol_mangling = self.config.rust_new_symbol_mangling.unwrap_or(true);
567553

568554
// By default, windows-rs depends on a native library that doesn't get copied into the
569555
// sysroot. Passing this cfg enables raw-dylib support instead, which makes the native

src/bootstrap/src/utils/change_tracker.rs

+5
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
310310
severity: ChangeSeverity::Warning,
311311
summary: "Revert `rust.download-rustc` global default to `false` and only use `rust.download-rustc = \"if-unchanged\"` default for library and tools profile. As alt CI rustc is built without debug assertions, `rust.debug-assertions = true` will now inhibit downloading CI rustc.",
312312
},
313+
ChangeInfo {
314+
change_id: 133998,
315+
severity: ChangeSeverity::Warning,
316+
summary: "`rust.new-symbol-mangling` now defaults to `true` universally when unset, including when build library.",
317+
},
313318
];

0 commit comments

Comments
 (0)