From a83bfa6813c0c5f01dd28a131eac508145be010c Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 9 Oct 2026 17:09:53 -0700 Subject: [PATCH] fix(hw-oracle): select the AMDGPU ELF emulation when linking kernels LLD built for a MinGW host runs the COFF linker when ld.lld gets no -m option, so it rejects the AMDGPU object with "unknown file type" and the hardware_oracle test fails on Windows with WinLibs LLVM in PATH. Passing -m elf64_amdgpu selects the ELF linker on every host. Co-Authored-By: Claude Opus 5.5 --- tools/hw-oracle/hw_oracle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hw-oracle/hw_oracle.py b/tools/hw-oracle/hw_oracle.py index 6cb1c4738..96de6d16a 100644 --- a/tools/hw-oracle/hw_oracle.py +++ b/tools/hw-oracle/hw_oracle.py @@ -72,7 +72,7 @@ def assemble(body, work, wave64, *, ieee, denorm32, denorm16, dx10_clamp, round3 text = text.replace(key, value) (work / "k.s").write_text(text) subprocess.run([tool("clang"), "-x", "assembler", "-target", "amdgcn-amd-amdhsa", f"-mcpu={target()}", *(["-mwavefrontsize64"] if wave64 else []), "-c", str(work / "k.s"), "-o", str(work / "k.o")], check=True) - subprocess.run([tool("ld.lld"), "-shared", str(work / "k.o"), "-o", str(work / "k.co")], check=True) + subprocess.run([tool("ld.lld"), "-m", "elf64_amdgpu", "-shared", str(work / "k.o"), "-o", str(work / "k.co")], check=True) return work / "k.co"