Skip to content

Commit 60bb7d5

Browse files
authored
Unrolled build for rust-lang#140396
Rollup merge of rust-lang#140396 - ChrisDenton:gnu-threads, r=jieyouxu Workaround for windows-gnu rust-lld test failure The test run-make/amdgpu-kd has an issue on windows-gnu where rust-lld will sometimes fail with error 0xc0000374 (`STATUS_HEAP_CORRUPTION`). This works around the issue by passing `--threads=1` to the linker as suggested [here](rust-lang#115985 (comment)). Note I don't know if this will help and it happens only sometimes in our CI so it's hard to test.
2 parents 25cdf1f + 3c42dc2 commit 60bb7d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/run-make/amdgpu-kd/rmake.rs

+6
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@
66
//@ needs-llvm-components: amdgpu
77
//@ needs-rust-lld
88

9+
use run_make_support::targets::is_windows_gnu;
910
use run_make_support::{llvm_readobj, rustc};
1011

1112
fn main() {
13+
// FIXME(#115985): rust-lld on gnu targets may spuriously fail with
14+
// STATUS_HEAP_CORRUPTION (0xc0000374).
15+
// To try to mitigate this we pass --threads=1 to the linker.
16+
let extra_args: &[&str] = if is_windows_gnu() { &["-C", "link-arg=--threads=1"] } else { &[] };
1217
rustc()
1318
.crate_name("foo")
1419
.target("amdgcn-amd-amdhsa")
1520
.arg("-Ctarget-cpu=gfx900")
21+
.args(&extra_args)
1622
.crate_type("cdylib")
1723
.input("foo.rs")
1824
.run();

0 commit comments

Comments
 (0)