Skip to content

Commit

Permalink
Default rust.new-symbol-mangling to true universally
Browse files Browse the repository at this point in the history
Instead of using legacy scheme for library but new scheme for compiler
when the option is not set.
  • Loading branch information
jieyouxu committed Dec 7, 2024
1 parent 75716b4 commit 04c8536
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
8 changes: 3 additions & 5 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -757,11 +757,9 @@

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

# Select LTO mode that will be used for compiling rustc. By default, thin local LTO
# (LTO within a single crate) is used (like for any Rust crate). You can also select
Expand Down
16 changes: 1 addition & 15 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,21 +549,7 @@ impl Builder<'_> {
rustflags.arg(sysroot_str);
}

let use_new_symbol_mangling = match self.config.rust_new_symbol_mangling {
Some(setting) => {
// If an explicit setting is given, use that
setting
}
None => {
if mode == Mode::Std {
// The standard library defaults to the legacy scheme
false
} else {
// The compiler and tools default to the new scheme
true
}
}
};
let use_new_symbol_mangling = self.config.rust_new_symbol_mangling.unwrap_or(true);

// By default, windows-rs depends on a native library that doesn't get copied into the
// sysroot. Passing this cfg enables raw-dylib support instead, which makes the native
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
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.",
},
ChangeInfo {
change_id: usize::MAX,
severity: ChangeSeverity::Warning,
summary: "`rust.new-symbol-mangling` now defaults to `true` universally when unset, including when build library.",
},
];

0 comments on commit 04c8536

Please sign in to comment.