File tree 3 files changed +9
-0
lines changed
3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1057,6 +1057,10 @@ pub fn rustc_cargo(
1057
1057
cargo. rustflag ( "-l" ) . rustflag ( "Enzyme-19" ) ;
1058
1058
}
1059
1059
1060
+ if builder. build . config . protected_symbol_definitions {
1061
+ cargo. rustflag ( "-Zdefault-visibility=protected" ) ;
1062
+ }
1063
+
1060
1064
// We currently don't support cross-crate LTO in stage0. This also isn't hugely necessary
1061
1065
// and may just be a time sink.
1062
1066
if compiler. stage != 0 {
Original file line number Diff line number Diff line change @@ -295,6 +295,7 @@ pub struct Config {
295
295
pub llvm_profile_generate : bool ,
296
296
pub llvm_libunwind_default : Option < LlvmLibunwind > ,
297
297
pub enable_bolt_settings : bool ,
298
+ pub protected_symbol_definitions : bool ,
298
299
299
300
pub reproducible_artifacts : Vec < String > ,
300
301
@@ -1308,6 +1309,7 @@ impl Config {
1308
1309
config. llvm_profile_generate = flags. llvm_profile_generate ;
1309
1310
config. enable_bolt_settings = flags. enable_bolt_settings ;
1310
1311
config. bypass_bootstrap_lock = flags. bypass_bootstrap_lock ;
1312
+ config. protected_symbol_definitions = flags. protected_symbol_definitions ;
1311
1313
1312
1314
// Infer the rest of the configuration.
1313
1315
Original file line number Diff line number Diff line change @@ -161,6 +161,9 @@ pub struct Flags {
161
161
/// Enable BOLT link flags
162
162
#[ arg( global = true , long) ]
163
163
pub enable_bolt_settings : bool ,
164
+ /// Use protected symbol definitions in rustc_driver
165
+ #[ arg( global = true , long, default_value_t = true ) ]
166
+ pub protected_symbol_definitions : bool ,
164
167
/// Skip stage0 compiler validation
165
168
#[ arg( global = true , long) ]
166
169
pub skip_stage0_validation : bool ,
You can’t perform that action at this time.
0 commit comments