Skip to content

Commit

Permalink
Auto merge of rust-lang#88000 - bjorn3:fix_cg_llvm_clif_compile, r=Ma…
Browse files Browse the repository at this point in the history
…rk-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.
  • Loading branch information
bors committed Aug 20, 2021
2 parents bcfd3f7 + 70f1d35 commit 9ccf661
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ impl<'a> Builder<'a> {
// requirement, but the `-L` library path is not propagated across
// separate Cargo projects. We can add LLVM's library path to the
// platform-specific environment variable as a workaround.
if mode == Mode::ToolRustc {
if mode == Mode::ToolRustc || mode == Mode::Codegen {
if let Some(llvm_config) = self.llvm_config(target) {
let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir"));
add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cargo);
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,10 @@ impl Step for CodegenBackend {

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

builder.info(&format!(
"Building stage{} codegen backend {} ({} -> {})",
compiler.stage, backend, &compiler.host, target
));
let files = run_cargo(builder, cargo, vec![], &tmp_stamp, vec![], false);
if builder.config.dry_run {
return;
Expand Down

0 comments on commit 9ccf661

Please sign in to comment.