@@ -1576,7 +1576,7 @@ impl Step for Extended {
15761576 backend: "cranelift" . to_string( ) ,
15771577 } ) ;
15781578 add_component ! ( "llvm-bitcode-linker" => LlvmBitcodeLinker {
1579- target_compiler : compiler,
1579+ build_compiler : compiler,
15801580 target
15811581 } ) ;
15821582
@@ -2344,9 +2344,13 @@ impl Step for LlvmTools {
23442344 }
23452345}
23462346
2347+ /// Distributes the `llvm-bitcode-linker` tool so that it can be used by a compiler whose host
2348+ /// is `target`.
23472349#[ derive( Debug , PartialOrd , Ord , Clone , Hash , PartialEq , Eq ) ]
23482350pub struct LlvmBitcodeLinker {
2349- pub target_compiler : Compiler ,
2351+ /// The linker will be compiled by this compiler.
2352+ pub build_compiler : Compiler ,
2353+ /// The linker will by usable by rustc on this host.
23502354 pub target : TargetSelection ,
23512355}
23522356
@@ -2362,7 +2366,10 @@ impl Step for LlvmBitcodeLinker {
23622366
23632367 fn make_run ( run : RunConfig < ' _ > ) {
23642368 run. builder . ensure ( LlvmBitcodeLinker {
2365- target_compiler : run. builder . compiler ( run. builder . top_stage , run. target ) ,
2369+ build_compiler : tool:: LlvmBitcodeLinker :: get_build_compiler_for_target (
2370+ run. builder ,
2371+ run. target ,
2372+ ) ,
23662373 target : run. target ,
23672374 } ) ;
23682375 }
@@ -2371,7 +2378,7 @@ impl Step for LlvmBitcodeLinker {
23712378 let target = self . target ;
23722379
23732380 let llbc_linker = builder
2374- . ensure ( tool:: LlvmBitcodeLinker :: for_use_by_compiler ( builder , self . target_compiler ) ) ;
2381+ . ensure ( tool:: LlvmBitcodeLinker :: from_build_compiler ( self . build_compiler , target ) ) ;
23752382
23762383 let self_contained_bin_dir = format ! ( "lib/rustlib/{}/bin/self-contained" , target. triple) ;
23772384
0 commit comments