From 138b8c8c292257cfb17aa10cf7c318d4c6771f92 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Sun, 8 Nov 2026 09:29:53 -0500 Subject: [PATCH] Link the differential tests with lld only when the toolchain has it. tests/diff/common.py always passed -fuse-ld=lld, so on an MSYS2 install without the lld package simd.py, atomic.py and the other Unicorn checks stopped at "invalid linker name" before testing anything. lld is used when it sits beside the compiler, the default linker otherwise; atomic.py passes either way. Co-Authored-By: Claude Opus 5.5 --- tests/diff/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/diff/common.py b/tests/diff/common.py index 50211c4d..19666971 100644 --- a/tests/diff/common.py +++ b/tests/diff/common.py @@ -223,7 +223,11 @@ def build_harness(work, bodies, jobs, cflags): if any(p.wait() for p in procs): raise SystemExit('compile failed') exe = work / ('harness.exe' if os.name == 'nt' else 'harness') - subprocess.check_call([cc, '-fuse-ld=lld', '-o', str(exe)] + [str(o) for o in objs], env=env) + # lld when the toolchain has it beside the compiler; its default linker otherwise (an MSYS2 install without the lld + # package stopped every differential test at "invalid linker name") + cc_dir = os.path.dirname(shutil.which(cc, path=env.get('PATH')) or cc) + lld = ['-fuse-ld=lld'] if any(os.path.isfile(os.path.join(cc_dir, n)) for n in ('ld.lld', 'ld.lld.exe')) else [] + subprocess.check_call([cc, *lld, '-o', str(exe)] + [str(o) for o in objs], env=env) return exe