Repository navigation
Description
Summary
On macOS, reld-bench reports ld64.lld as n/a for every scenario — it never actually links — so the aarch64-apple-darwin benchmark has no lld column. The default system ld links fine; only the ld64.lld series is broken.
Evidence (from benchmark-stats branch, aarch64-apple-darwin/latest.json):
ld small/medium/large -> 0.052 / 0.054 / 0.0787
ld64.lld small/medium/large -> None / None / None # never links
reld ... -> None # separate: no shim in that job
Root cause
reld-bench builds the macOS linker list as ["", "ld64.lld"] and passes each token verbatim to the compiler driver as -fuse-ld=<token> (see default_linkers() and link_once/probe_linker in crates/reld-testkit/src/bin/reld-bench.rs).
But clang maps -fuse-ld=NAME to a linker executable named ld.NAME (the GNU convention — -fuse-ld=gold → ld.gold, -fuse-ld=bfd → ld.bfd), with lld the one special-cased name. So -fuse-ld=ld64.lld makes clang look for a nonexistent ld.ld64.lld; the probe link fails and the series is marked n/a. The ld64.lld binary is present on PATH (the benchmark-stats macOS job asserts command -v ld64.lld), so this is purely the invocation, not a missing linker.
The repo already has the correct, proven form: ci.yml's macOS smoke links with -fuse-ld="$(brew --prefix llvm@18)/bin/ld64.lld" — i.e. an absolute path. (-fuse-ld=lld also works: clang selects ld64.lld for Mach-O targets.)
Fix
In reld-bench, when the macOS linker token is ld64.lld, pass a value clang accepts instead of the bare name:
- Resolve the absolute path to
ld64.lld(searchPATH) and pass-fuse-ld=<abs-path>, matchingci.yml's proven invocation and pinning the exact binary being benchmarked. - Fall back to
-fuse-ld=lld(clang picksld64.lldon Darwin) if the binary can't be located onPATH. - Keep the table's display name as
ld64.lld(decouple the display label from the-fuse-ldvalue, exactly as the harness already does for reld's shim).
This is a single translation point applied to the synthetic path, the replay path (--replay-corpus), and the availability probe.
Acceptance criteria
- On macOS,
reld-benchlinks viald64.lldand reports real timings (notn/a) for theld64.lldseries, with the column still labeledld64.lld. - The
-fuse-ldvalue is the resolved absolute path told64.lldwhen found, elselld; other linkers (bfd/lld/mold/wild) and reld's shim are unchanged. - Non-macOS behavior is unchanged.
- RED -> GREEN: a unit test showing the macOS
ld64.lldtoken maps to an accepted-fuse-ldvalue (abs path when on PATH;lldfallback otherwise), where the current bare-name behavior would resolve to the failingld.ld64.lld.
Decisions
- Priority: P2. A published-benchmark correctness bug: macOS silently shows no lld numbers, understating coverage.
- Absolute path over
-fuse-ld=lldas the primary value, to match the repo's already-proven macOS invocation and to benchmark a specific, pinnedld64.lld;lldis the fallback. - Display stays
ld64.lld— the value/label decoupling already exists for reld's shim; reuse it.
Activity
ci(bench): exercise ld64.lld directly in the macOS smoke
fix(bench): link via ld64.lld on macOS (was always n/a) (#60) (#62)
zackees commentedon Aug 7, 2026
Generalized into meta #63 (benchmark linker-coverage integrity — no silent n/a). This fix's macOS CI assertion is the template for the per-platform expected-linker gates tracked there.