Skip to content

Commit 44dae66

Browse files
committed
bootstrap: add rust_lld_enabled cfg when rust.lld is enabled in config
1 parent 8609fe5 commit 44dae66

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/bootstrap/compile.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,9 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS
694694
cargo.rustflag("--cfg=parallel_compiler");
695695
cargo.rustdocflag("--cfg=parallel_compiler");
696696
}
697+
if builder.config.lld_enabled {
698+
cargo.rustflag("--cfg=rust_lld_enabled");
699+
}
697700
if builder.config.rust_verify_llvm_ir {
698701
cargo.env("RUSTC_VERIFY_LLVM_IR", "1");
699702
}

src/bootstrap/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &'static str, Option<&[&'static str]>)]
194194
(None, "bootstrap", None),
195195
(Some(Mode::Rustc), "parallel_compiler", None),
196196
(Some(Mode::ToolRustc), "parallel_compiler", None),
197+
(Some(Mode::Rustc), "rust_lld_enabled", None),
197198
(Some(Mode::Std), "stdarch_intel_sde", None),
198199
(Some(Mode::Std), "no_fp_fmt_parse", None),
199200
(Some(Mode::Std), "no_global_oom_handling", None),

0 commit comments

Comments
 (0)