Skip to content

Commit cb615c0

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 cb615c0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
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 STATUS_HEAP_CORRUPTION (0xc0000374)
14+
// To try to mitigate this we pass --threads=1 to the linker.
15+
let extra_args = if is_windows_gnu() { ["-C", "link-arg=--threads=1"] } else { [] };
1216
rustc()
1317
.crate_name("foo")
1418
.target("amdgcn-amd-amdhsa")
1519
.arg("-Ctarget-cpu=gfx900")
20+
.args(&extra_args)
1621
.crate_type("cdylib")
1722
.input("foo.rs")
1823
.run();

0 commit comments

Comments
 (0)