File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
compiler/rustc_target/src/spec/targets
src/bootstrap/src/core/build_steps Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,9 @@ pub fn target() -> Target {
1818 | SanitizerSet :: THREAD ;
1919 base. supports_xray = true ;
2020
21- #[ cfg( use_rust_lld) ]
22- {
23- // When we're asked to use the `rust-lld` linker by default, set the appropriate lld-using
24- // linker flavor, and self-contained linker component.
21+ // When we're asked to use the `rust-lld` linker by default, set the appropriate lld-using
22+ // linker flavor, and self-contained linker component.
23+ if option_env ! ( "CFG_USE_SELF_CONTAINED_LINKER" ) . is_some ( ) {
2524 base. linker_flavor = LinkerFlavor :: Gnu ( Cc :: Yes , Lld :: Yes ) ;
2625 base. link_self_contained = crate :: spec:: LinkSelfContainedDefault :: with_linker ( ) ;
2726 }
Original file line number Diff line number Diff line change @@ -1129,10 +1129,9 @@ pub fn rustc_cargo_env(
11291129 cargo. env ( "CFG_DEFAULT_LINKER" , s) ;
11301130 }
11311131
1132- // Enable rustc's cfgs for `rust-lld` when requested.
1132+ // Enable rustc's env var for `rust-lld` when requested.
11331133 if builder. config . lld_enabled {
1134- cargo. rustflag ( "--cfg=use_rust_lld" ) ;
1135- cargo. rustdocflag ( "--cfg=use_rust_lld" ) ;
1134+ cargo. env ( "CFG_USE_SELF_CONTAINED_LINKER" , "1" ) ;
11361135 }
11371136
11381137 if builder. config . rust_verify_llvm_ir {
You can’t perform that action at this time.
0 commit comments