forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#125642 - khuey:zstd, r=<try>
Enable zstd for debug compression. Set LLVM_ENABLE_ZSTD alongside LLVM_ENABLE_ZLIB so that --compress-debug-sections=zstd is an option. See rust-lang#120953 try-job: x86_64-gnu
- Loading branch information
Showing
6 changed files
with
82 additions
and
13 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Change this file to make users of the `download-ci-llvm` configuration download | ||
a new version of LLVM from CI, even if the LLVM submodule hasn’t changed. | ||
|
||
Last change is for: https://github.com/rust-lang/rust/pull/126298 | ||
Last change is for: https://github.com/rust-lang/rust/pull/125642 |
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
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
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,4 @@ | ||
// Test linking using `cc` with `rust-lld`, using the unstable CLI described in MCP 510 | ||
// see https://github.com/rust-lang/compiler-team/issues/510 for more info | ||
|
||
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,39 @@ | ||
// Checks the `compress-debug-sections` option on rust-lld. | ||
|
||
//@ needs-rust-lld | ||
//@ only-linux | ||
//@ ignore-cross-compile | ||
|
||
// FIXME: This test isn't comprehensive and isn't covering all possible combinations. | ||
|
||
use run_make_support::{assert_contains, cmd, llvm_readobj, run_in_tmpdir, rustc}; | ||
|
||
fn check_compression(compression: &str, to_find: &str) { | ||
run_in_tmpdir(|| { | ||
let out = rustc() | ||
.arg("-Zlinker-features=+lld") | ||
.arg("-Clink-self-contained=+linker") | ||
.arg("-Zunstable-options") | ||
.arg("-Cdebuginfo=full") | ||
.link_arg(&format!("-Wl,--compress-debug-sections={compression}")) | ||
.input("main.rs") | ||
.run_unchecked(); | ||
let stderr = out.stderr_utf8(); | ||
if stderr.is_empty() { | ||
llvm_readobj().arg("-t").arg("main").run().assert_stdout_contains(to_find); | ||
} else { | ||
assert_contains( | ||
stderr, | ||
format!( | ||
"\ | ||
LLVM was not built with LLVM_ENABLE_{to_find} or did not find {compression} at build time" | ||
), | ||
); | ||
} | ||
}); | ||
} | ||
|
||
fn main() { | ||
check_compression("zlib", "ZLIB"); | ||
check_compression("zstd", "ZSTD"); | ||
} |