Skip to content

Commit b366d25

Browse files
Auto merge of #145755 - lqd:lld-beta, r=<try>
Leave lld on beta a little bit more try-job: x86_64-gnu-stable try-job: dist-x86_64-linux try-job: x86_64-gnu
2 parents 085bdc2 + e38de11 commit b366d25

File tree

6 files changed

+22
-5
lines changed

6 files changed

+22
-5
lines changed

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS
13601360
}
13611361

13621362
// Enable rustc's env var for `rust-lld` when requested.
1363-
if builder.config.lld_enabled {
1363+
if builder.config.lld_enabled && builder.config.channel != "stable" {
13641364
cargo.env("CFG_USE_SELF_CONTAINED_LINKER", "1");
13651365
}
13661366

src/bootstrap/src/core/config/toml/rust.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ impl Config {
657657
// when the config sets `rust.lld = false`
658658
if default_lld_opt_in_targets().contains(&self.host_target.triple.to_string())
659659
&& self.hosts == [self.host_target]
660+
&& self.channel != "stable"
660661
{
661662
let no_llvm_config = self
662663
.target_config
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fn main() {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Ensure that rust-lld is *not* used as the default linker on `x86_64-unknown-linux-gnu` on stable.
2+
3+
//@ only-stable
4+
//@ only-x86_64-unknown-linux-gnu
5+
6+
use run_make_support::linker::assert_rustc_doesnt_use_lld;
7+
use run_make_support::rustc;
8+
9+
fn main() {
10+
// A regular compilation should not use rust-lld by default. We'll check that by asking the
11+
// linker to display its version number with a link-arg.
12+
assert_rustc_doesnt_use_lld(rustc().input("main.rs"));
13+
}

tests/run-make/rust-lld-x86_64-unknown-linux-gnu-dist/rmake.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// Ensure that rust-lld is used as the default linker on `x86_64-unknown-linux-gnu`
2-
// dist artifacts and that it can also be turned off with a CLI flag.
1+
// Ensure that rust-lld is used as the default linker on `x86_64-unknown-linux-gnu` dist artifacts
2+
// (except on stable) and that it can also be turned off with a CLI flag.
33

44
//@ only-dist
5+
//@ ignore-stable
56
//@ only-x86_64-unknown-linux-gnu
67

78
use run_make_support::linker::{assert_rustc_doesnt_use_lld, assert_rustc_uses_lld};

tests/run-make/rust-lld-x86_64-unknown-linux-gnu/rmake.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// Ensure that rust-lld is used as the default linker on `x86_64-unknown-linux-gnu`
2-
// and that it can also be turned off with a CLI flag.
1+
// Ensure that rust-lld is used as the default linker on `x86_64-unknown-linux-gnu` (except on
2+
// stable) and that it can also be turned off with a CLI flag.
33
//
44
// This version of the test checks that LLD is used by default when LLD is enabled in the
55
// toolchain. There is a separate test that checks that LLD is used for dist artifacts
66
// unconditionally.
77

88
//@ needs-rust-lld
9+
//@ ignore-stable
910
//@ only-x86_64-unknown-linux-gnu
1011

1112
use run_make_support::linker::{assert_rustc_doesnt_use_lld, assert_rustc_uses_lld};

0 commit comments

Comments
 (0)