Skip to content

Commit bba318e

Browse files
committed
bootstrap: introduce rust-lld cfg for rustc
1 parent d8572c1 commit bba318e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/bootstrap/compile.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,10 @@ pub fn rustc_cargo_env(
10001000
cargo.rustflag("--cfg=parallel_compiler");
10011001
cargo.rustdocflag("--cfg=parallel_compiler");
10021002
}
1003+
if builder.config.lld_enabled {
1004+
cargo.rustflag("--cfg=rust_lld");
1005+
cargo.rustdocflag("--cfg=rust_lld");
1006+
}
10031007
if builder.config.rust_verify_llvm_ir {
10041008
cargo.env("RUSTC_VERIFY_LLVM_IR", "1");
10051009
}

src/bootstrap/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[
169169
// Needed to avoid the need to copy windows.lib into the sysroot.
170170
(Some(Mode::Rustc), "windows_raw_dylib", None),
171171
(Some(Mode::ToolRustc), "windows_raw_dylib", None),
172+
// If rustc wants to use rust-lld as the default linker in a target spec.
173+
(Some(Mode::Rustc), "rust_lld", None),
174+
(Some(Mode::ToolRustc), "rust_lld", None),
175+
(Some(Mode::Codegen), "rust_lld", None),
172176
];
173177

174178
/// A structure representing a Rust compiler.

0 commit comments

Comments
 (0)