Rollup merge of #71070 - petrochenkov:nolldaround, r=Mark-Simulacrum
rustbuild: Remove stage 0 LLD flavor workaround for MSVC
This commit is contained in:
commit
b45f133a0d
2 changed files with 0 additions and 21 deletions
|
|
@ -134,11 +134,6 @@ fn main() {
|
|||
cmd.arg(format!("-Clinker={}", host_linker));
|
||||
}
|
||||
|
||||
// Override linker flavor if necessary.
|
||||
if let Ok(host_linker_flavor) = env::var("RUSTC_HOST_LINKER_FLAVOR") {
|
||||
cmd.arg(format!("-Clinker-flavor={}", host_linker_flavor));
|
||||
}
|
||||
|
||||
if let Ok(s) = env::var("RUSTC_HOST_CRT_STATIC") {
|
||||
if s == "true" {
|
||||
cmd.arg("-C").arg("target-feature=+crt-static");
|
||||
|
|
|
|||
|
|
@ -969,27 +969,11 @@ impl<'a> Builder<'a> {
|
|||
// See https://github.com/rust-lang/rust/issues/68647.
|
||||
let can_use_lld = mode != Mode::Std;
|
||||
|
||||
// FIXME: The beta compiler doesn't pick the `lld-link` flavor for `*-pc-windows-msvc`
|
||||
// Remove `RUSTC_HOST_LINKER_FLAVOR` when this is fixed
|
||||
let lld_linker_flavor = |linker: &Path, target: Interned<String>| {
|
||||
compiler.stage == 0
|
||||
&& linker.file_name() == Some(OsStr::new("rust-lld"))
|
||||
&& target.contains("pc-windows-msvc")
|
||||
};
|
||||
|
||||
if let Some(host_linker) = self.linker(compiler.host, can_use_lld) {
|
||||
if lld_linker_flavor(host_linker, compiler.host) {
|
||||
cargo.env("RUSTC_HOST_LINKER_FLAVOR", "lld-link");
|
||||
}
|
||||
|
||||
cargo.env("RUSTC_HOST_LINKER", host_linker);
|
||||
}
|
||||
|
||||
if let Some(target_linker) = self.linker(target, can_use_lld) {
|
||||
if lld_linker_flavor(target_linker, target) {
|
||||
rustflags.arg("-Clinker-flavor=lld-link");
|
||||
}
|
||||
|
||||
let target = crate::envify(&target);
|
||||
cargo.env(&format!("CARGO_TARGET_{}_LINKER", target), target_linker);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue