forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#127081 - Kobzol:lld-test, r=onur-ozkan
Add a run-make test that LLD is not being used by default on the x64 beta/stable channel rust-lang#126701 showed that the handling of `lld` in bootstrap is currently not ideal. While it would be nice to refactor it eventually, we should also make sure that we have a test that checks that `lld` is not used (yet!) by default on the x64 Linux stable channel. CC `@lqd` r? `@onur-ozkan`
- Loading branch information
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Ensure that rust-lld is *not* used as the default linker on `x86_64-unknown-linux-gnu` on stable | ||
// or beta. | ||
|
||
//@ ignore-nightly | ||
//@ only-x86_64-unknown-linux-gnu | ||
|
||
use run_make_support::regex::Regex; | ||
use run_make_support::rustc; | ||
use std::process::Output; | ||
|
||
fn main() { | ||
// A regular compilation should not use rust-lld by default. We'll check that by asking the | ||
// linker to display its version number with a link-arg. | ||
let output = rustc() | ||
.env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info") | ||
.link_arg("-Wl,-v") | ||
.input("main.rs") | ||
.run(); | ||
assert!( | ||
!find_lld_version_in_logs(output.stderr_utf8()), | ||
"the LLD version string should not be present in the output logs:\n{}", | ||
output.stderr_utf8() | ||
); | ||
} | ||
|
||
fn find_lld_version_in_logs(stderr: String) -> bool { | ||
let lld_version_re = Regex::new(r"^LLD [0-9]+\.[0-9]+\.[0-9]+").unwrap(); | ||
stderr.lines().any(|line| lld_version_re.is_match(line.trim())) | ||
} |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
tests/run-make/rust-lld-by-default/rmake.rs → ...make/rust-lld-by-default-nightly/rmake.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters