Skip to content

Commit 9ccf661

Browse files
committed
Auto merge of rust-lang#88000 - bjorn3:fix_cg_llvm_clif_compile, r=Mark-Simulacrum
Fix compiling other codegen backends when llvm is enabled Extracted from rust-lang#81746 Without this change rustbuild will not pass the required linker argument to find libllvm. While other backends likely don't use libllvm, it is necessary to be able to link against rustc_driver as the llvm backend is linked into it.
2 parents bcfd3f7 + 70f1d35 commit 9ccf661

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/bootstrap/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ impl<'a> Builder<'a> {
12881288
// requirement, but the `-L` library path is not propagated across
12891289
// separate Cargo projects. We can add LLVM's library path to the
12901290
// platform-specific environment variable as a workaround.
1291-
if mode == Mode::ToolRustc {
1291+
if mode == Mode::ToolRustc || mode == Mode::Codegen {
12921292
if let Some(llvm_config) = self.llvm_config(target) {
12931293
let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir"));
12941294
add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cargo);

src/bootstrap/compile.rs

+4
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,10 @@ impl Step for CodegenBackend {
806806

807807
let tmp_stamp = out_dir.join(".tmp.stamp");
808808

809+
builder.info(&format!(
810+
"Building stage{} codegen backend {} ({} -> {})",
811+
compiler.stage, backend, &compiler.host, target
812+
));
809813
let files = run_cargo(builder, cargo, vec![], &tmp_stamp, vec![], false);
810814
if builder.config.dry_run {
811815
return;

0 commit comments

Comments
 (0)