Skip to content

Commit b107e98

Browse files
committed
Workaround for windows-gnu rust-lld test failure
The test run-make/amdgpu-kd has an issue where rust-lld will sometimes fail with error 0xc0000374 (STATUS_HEAP_CORRUPTION).
1 parent a932eb3 commit b107e98

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)