Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default rust.new-symbol-mangling to true universally #133998

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 133998,
severity: ChangeSeverity::Warning,
summary: "`rust.new-symbol-mangling` now defaults to `true` universally when unset, including when build library.",
},
];
Loading