Skip to content

Commit 9896694

Browse files
committed
use target compiler for LlvmBitcodeLinker
Signed-off-by: onur-ozkan <[email protected]>
1 parent 01d7711 commit 9896694

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/bootstrap/src/core/build_steps/compile.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1792,7 +1792,7 @@ impl Step for Assemble {
17921792
}
17931793
}
17941794

1795-
let maybe_install_llvm_bitcode_linker = |compiler| {
1795+
let maybe_install_llvm_bitcode_linker = |compiler: Compiler| {
17961796
if builder.config.llvm_bitcode_linker_enabled {
17971797
let src_path = builder.ensure(crate::core::build_steps::tool::LlvmBitcodeLinker {
17981798
compiler,
@@ -1974,7 +1974,7 @@ impl Step for Assemble {
19741974
);
19751975
}
19761976

1977-
maybe_install_llvm_bitcode_linker(build_compiler);
1977+
maybe_install_llvm_bitcode_linker(target_compiler);
19781978

19791979
// Ensure that `libLLVM.so` ends up in the newly build compiler directory,
19801980
// so that it can be found when the newly built `rustc` is run.

src/bootstrap/src/core/build_steps/tool.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ impl Step for ToolBuild {
7373
fn run(mut self, builder: &Builder<'_>) -> PathBuf {
7474
match self.mode {
7575
Mode::ToolRustc => {
76-
assert!(
77-
self.compiler.stage > 0,
78-
"stage0 isn't supported for `Mode::ToolRustc` programs"
79-
);
76+
assert!(self.compiler.stage > 0, "stage0 isn't supported for {}", self.path);
8077
// Similar to `compile::Assemble`, build with the previous stage's compiler. Otherwise
8178
// we'd have stageN/bin/rustc and stageN/bin/$tool_name be effectively different stage
8279
// compilers, which isn't what we want.

0 commit comments

Comments
 (0)