@@ -1576,7 +1576,7 @@ impl Step for Extended {
1576
1576
backend: "cranelift" . to_string( ) ,
1577
1577
} ) ;
1578
1578
add_component ! ( "llvm-bitcode-linker" => LlvmBitcodeLinker {
1579
- target_compiler : compiler,
1579
+ build_compiler : compiler,
1580
1580
target
1581
1581
} ) ;
1582
1582
@@ -2344,9 +2344,13 @@ impl Step for LlvmTools {
2344
2344
}
2345
2345
}
2346
2346
2347
+ /// Distributes the `llvm-bitcode-linker` tool so that it can be used by a compiler whose host
2348
+ /// is `target`.
2347
2349
#[ derive( Debug , PartialOrd , Ord , Clone , Hash , PartialEq , Eq ) ]
2348
2350
pub 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.
2350
2354
pub target : TargetSelection ,
2351
2355
}
2352
2356
@@ -2362,7 +2366,10 @@ impl Step for LlvmBitcodeLinker {
2362
2366
2363
2367
fn make_run ( run : RunConfig < ' _ > ) {
2364
2368
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
+ ) ,
2366
2373
target : run. target ,
2367
2374
} ) ;
2368
2375
}
@@ -2371,7 +2378,7 @@ impl Step for LlvmBitcodeLinker {
2371
2378
let target = self . target ;
2372
2379
2373
2380
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 ) ) ;
2375
2382
2376
2383
let self_contained_bin_dir = format ! ( "lib/rustlib/{}/bin/self-contained" , target. triple) ;
2377
2384
0 commit comments