File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -609,7 +609,11 @@ changelog-seen = 2
609609
610610# Enable symbol-mangling-version v0. This can be helpful when profiling rustc,
611611# as generics will be preserved in symbols (rather than erased into opaque T).
612- # new-symbol-mangling = false
612+ # When no setting is given, the new scheme will be used when compiling the
613+ # compiler and its tools and the legacy scheme will be used when compiling the
614+ # standard library.
615+ # If an explicit setting is given, it will be used for all parts of the codebase.
616+ # new-symbol-mangling = true|false (see comment)
613617
614618# =============================================================================
615619# Options for specific targets
Original file line number Diff line number Diff line change @@ -972,8 +972,26 @@ impl<'a> Builder<'a> {
972972 }
973973 }
974974
975- if self . config . rust_new_symbol_mangling {
975+ let use_new_symbol_mangling = match self . config . rust_new_symbol_mangling {
976+ Some ( setting) => {
977+ // If an explicit setting is given, use that
978+ setting
979+ }
980+ None => {
981+ if mode == Mode :: Std {
982+ // The standard library defaults to the legacy scheme
983+ false
984+ } else {
985+ // The compiler and tools default to the new scheme
986+ true
987+ }
988+ }
989+ } ;
990+
991+ if use_new_symbol_mangling {
976992 rustflags. arg ( "-Zsymbol-mangling-version=v0" ) ;
993+ } else {
994+ rustflags. arg ( "-Zsymbol-mangling-version=legacy" ) ;
977995 }
978996
979997 // FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ pub struct Config {
141141 pub rust_verify_llvm_ir : bool ,
142142 pub rust_thin_lto_import_instr_limit : Option < u32 > ,
143143 pub rust_remap_debuginfo : bool ,
144- pub rust_new_symbol_mangling : bool ,
144+ pub rust_new_symbol_mangling : Option < bool > ,
145145 pub rust_profile_use : Option < String > ,
146146 pub rust_profile_generate : Option < String > ,
147147 pub llvm_profile_use : Option < String > ,
@@ -874,7 +874,7 @@ impl Config {
874874 config. rust_run_dsymutil = rust. run_dsymutil . unwrap_or ( false ) ;
875875 optimize = rust. optimize ;
876876 ignore_git = rust. ignore_git ;
877- set ( & mut config. rust_new_symbol_mangling , rust. new_symbol_mangling ) ;
877+ config. rust_new_symbol_mangling = rust. new_symbol_mangling ;
878878 set ( & mut config. rust_optimize_tests , rust. optimize_tests ) ;
879879 set ( & mut config. codegen_tests , rust. codegen_tests ) ;
880880 set ( & mut config. rust_rpath , rust. rpath ) ;
You can’t perform that action at this time.
0 commit comments