@@ -1003,7 +1003,7 @@ impl Step for Rustc {
10031003pub fn rustc_cargo ( builder : & Builder < ' _ > , cargo : & mut Cargo , target : TargetSelection , stage : u32 ) {
10041004 cargo
10051005 . arg ( "--features" )
1006- . arg ( builder. rustc_features ( builder. kind ) )
1006+ . arg ( builder. rustc_features ( builder. kind , target ) )
10071007 . arg ( "--manifest-path" )
10081008 . arg ( builder. src . join ( "compiler/rustc/Cargo.toml" ) ) ;
10091009
@@ -1060,7 +1060,7 @@ pub fn rustc_cargo_env(
10601060 cargo. env ( "CFG_OMIT_GIT_HASH" , "1" ) ;
10611061 }
10621062
1063- if let Some ( backend) = builder. config . default_codegen_backend ( ) {
1063+ if let Some ( backend) = builder. config . default_codegen_backend ( target ) {
10641064 cargo. env ( "CFG_DEFAULT_CODEGEN_BACKEND" , backend) ;
10651065 }
10661066
@@ -1101,7 +1101,7 @@ pub fn rustc_cargo_env(
11011101 // build. If we are in a check build we still go ahead here presuming we've
11021102 // detected that LLVM is already built and good to go which helps prevent
11031103 // busting caches (e.g. like #71152).
1104- if builder. config . llvm_enabled ( ) {
1104+ if builder. config . llvm_enabled ( target ) {
11051105 let building_is_expensive =
11061106 crate :: core:: build_steps:: llvm:: prebuilt_llvm_config ( builder, target) . is_err ( ) ;
11071107 // `top_stage == stage` might be false for `check --stage 1`, if we are building the stage 1 compiler
@@ -1250,7 +1250,7 @@ pub(crate) const CODEGEN_BACKEND_PREFIX: &str = "rustc_codegen_";
12501250fn is_codegen_cfg_needed ( path : & TaskPath , run : & RunConfig < ' _ > ) -> bool {
12511251 if path. path . to_str ( ) . unwrap ( ) . contains ( & CODEGEN_BACKEND_PREFIX ) {
12521252 let mut needs_codegen_backend_config = true ;
1253- for & backend in & run. builder . config . rust_codegen_backends {
1253+ for & backend in run. builder . config . codegen_backends ( run . target ) {
12541254 if path
12551255 . path
12561256 . to_str ( )
@@ -1287,7 +1287,7 @@ impl Step for CodegenBackend {
12871287 return ;
12881288 }
12891289
1290- for & backend in & run. builder . config . rust_codegen_backends {
1290+ for & backend in run. builder . config . codegen_backends ( run . target ) {
12911291 if backend == "llvm" {
12921292 continue ; // Already built as part of rustc
12931293 }
@@ -1387,7 +1387,7 @@ fn copy_codegen_backends_to_sysroot(
13871387 return ;
13881388 }
13891389
1390- for backend in builder. config . rust_codegen_backends . iter ( ) {
1390+ for backend in builder. config . codegen_backends ( target ) {
13911391 if backend == "llvm" {
13921392 continue ; // Already built as part of rustc
13931393 }
@@ -1694,7 +1694,7 @@ impl Step for Assemble {
16941694 // to not fail while linking the artifacts.
16951695 build_compiler. stage = actual_stage;
16961696
1697- for & backend in builder. config . rust_codegen_backends . iter ( ) {
1697+ for & backend in builder. config . codegen_backends ( target_compiler . host ) {
16981698 if backend == "llvm" {
16991699 continue ; // Already built as part of rustc
17001700 }
@@ -1779,7 +1779,7 @@ impl Step for Assemble {
17791779 }
17801780 }
17811781
1782- if builder. config . rust_codegen_backends . contains ( & INTERNER . intern_str ( "llvm" ) ) {
1782+ if builder. config . llvm_enabled ( target_compiler . host ) {
17831783 let llvm:: LlvmResult { llvm_config, .. } =
17841784 builder. ensure ( llvm:: Llvm { target : target_compiler. host } ) ;
17851785 if !builder. config . dry_run ( ) && builder. config . llvm_tools_enabled {
0 commit comments