Skip to content

fix(bench): link via ld64.lld on macOS (was always n/a) (#60) - #62

Merged
zackees merged 2 commits into
mainfrom
fix/bench-macos-ld64-lld
Aug 7, 2026
Merged

zackees merged 2 commits into
mainfrom
fix/bench-macos-ld64-lld

Conversation

@zackees

@zackees zackees commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #60.

Problem

On macOS the benchmark recorded ld64.lld as n/a for every scenario. clang maps -fuse-ld=NAME to a linker named ld.NAME (GNU convention; lld is the one special case), so reld-bench's bare -fuse-ld=ld64.lld looked for a nonexistent ld.ld64.lld and the probe/link failed. ld64.lld is on PATH in the macOS job — this was purely the invocation.

Fix

Translate the ld64.lld token to the resolved absolute path of ld64.lld on PATH (matching ci.yml's already-proven macOS smoke, which links with -fuse-ld="$(brew --prefix llvm@18)/bin/ld64.lld"), falling back to -fuse-ld=lld (clang selects ld64.lld for Mach-O) when it can't be located. The table column stays labeled ld64.lld; all other linkers and reld's absolute-path shim pass through unchanged. Applied at a single translation point (fuse_ld_value) covering the availability probe, the synthetic path, and --replay-corpus.

Tests (RED → GREEN)

resolve_fuse_ld unit tests: ld64.lld → abs path when found, → lld when not; all other tokens (bfd/lld/mold/wild, reld shim path) pass through untouched. clippy -D warnings, tests, and fmt --check all green locally.

🤖 Generated with Claude Code

zackees and others added 2 commits August 7, 2026 09:16
clang maps `-fuse-ld=NAME` to `ld.NAME` (except `lld`), so the bench's bare
`-fuse-ld=ld64.lld` looked for a nonexistent `ld.ld64.lld` and the macOS
`ld64.lld` series was always n/a.

Translate the `ld64.lld` token to the resolved absolute path of ld64.lld on
PATH (matching ci.yml's proven macOS invocation), falling back to `lld`
(clang selects ld64.lld for Mach-O). The table still shows `ld64.lld`; every
other linker and reld's shim pass through unchanged. Applied at one point
covering the probe, the synthetic path, and --replay-corpus.

Closes #60

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The macOS reld-bench smoke used --linker lld, which never hit the bug in #60
(bare -fuse-ld=ld64.lld -> nonexistent ld.ld64.lld). Switch it to
--linker ld64.lld and assert a real timing is produced, so the fix is proven
live on the macOS runner (RED -> GREEN) rather than only by unit tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@zackees
zackees merged commit 4291003 into main Aug 7, 2026
24 checks passed
@zackees
zackees deleted the fix/bench-macos-ld64-lld branch August 7, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bench: ld64.lld always n/a on macOS — clang maps -fuse-ld=ld64.lld to nonexistent ld.ld64.lld

1 participant