about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2025-04-28 14:15:30 +0000
committerChris Denton <chris@chrisdenton.dev>2025-04-28 23:25:10 +0000
commit3c42dc24ae23d2501aaae81273762d0698d83ff7 (patch)
treedb1052d2eeec122fa172f1a8332d65dc7f601f44
parenta932eb36f8adf6c8cdfc450f063943da3112d621 (diff)
downloadrust-3c42dc24ae23d2501aaae81273762d0698d83ff7.tar.gz
rust-3c42dc24ae23d2501aaae81273762d0698d83ff7.zip
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).
-rw-r--r--tests/run-make/amdgpu-kd/rmake.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/run-make/amdgpu-kd/rmake.rs b/tests/run-make/amdgpu-kd/rmake.rs
index a787fa1da93..cba9030641d 100644
--- a/tests/run-make/amdgpu-kd/rmake.rs
+++ b/tests/run-make/amdgpu-kd/rmake.rs
@@ -6,13 +6,19 @@
 //@ needs-llvm-components: amdgpu
 //@ needs-rust-lld
 
+use run_make_support::targets::is_windows_gnu;
 use run_make_support::{llvm_readobj, rustc};
 
 fn main() {
+    // FIXME(#115985): rust-lld on gnu targets may spuriously fail with
+    // STATUS_HEAP_CORRUPTION (0xc0000374).
+    // To try to mitigate this we pass --threads=1 to the linker.
+    let extra_args: &[&str] = if is_windows_gnu() { &["-C", "link-arg=--threads=1"] } else { &[] };
     rustc()
         .crate_name("foo")
         .target("amdgcn-amd-amdhsa")
         .arg("-Ctarget-cpu=gfx900")
+        .args(&extra_args)
         .crate_type("cdylib")
         .input("foo.rs")
         .run();