Skip to content

Commit

Permalink
bootstrap: introduce rust-lld env var for rustc
Browse files Browse the repository at this point in the history
This is used to notify we want to use rust-lld as the default linker in
a target.
  • Loading branch information
lqd committed May 16, 2024
1 parent 4a78c00 commit 28ce76e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,11 @@ pub fn rustc_cargo_env(
cargo.env("CFG_DEFAULT_LINKER", s);
}

// Enable rustc's env var for `rust-lld` when requested.
if builder.config.lld_enabled {
cargo.env("CFG_USE_SELF_CONTAINED_LINKER", "1");
}

if builder.config.rust_verify_llvm_ir {
cargo.env("RUSTC_VERIFY_LLVM_IR", "1");
}
Expand Down

0 comments on commit 28ce76e

Please sign in to comment.