Skip to content

Commit 46b91f6

Browse files
committed
Auto merge of rust-lang#140396 - ChrisDenton:gnu-threads, r=<try>
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. try-job: x86_64-mingw-1
2 parents a932eb3 + b107e98 commit 46b91f6

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+
// rust-lld on gnu targets may spuriously fail with STATUS_HEAP_CORRUPTION (0xc0000374)
14+
// To try to mitigate this we pass --threads=1 to the linker.
15+
// See #115985.
16+
let extra_args = 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)