Skip to content

Link linux builds with lld (bfd rejects --start-lib on 20.04) - #6

Merged
alexeagle merged 1 commit into
masterfrom
figma-release-lld-linker
Jun 23, 2026
Merged

Link linux builds with lld (bfd rejects --start-lib on 20.04)#6
alexeagle merged 1 commit into
masterfrom
figma-release-lld-linker

Conversation

@alexeagle

Copy link
Copy Markdown

Follow-up to #5. The containerized linux build got further — the glibc-2.31 container is correct and darwin built fine — but both linux legs failed at link:

ERROR: ... Linking third_party/ijar/zipper failed ...
/usr/bin/ld.bfd: unrecognized option '--start-lib'

Cause

PR #5 forced --linkopt=-fuse-ld=bfd, but Bazel emits --start-lib/--end-lib, which only gold and lld support — bfd didn't gain --start-lib until binutils 2.38, and ubuntu:20.04 ships 2.34.

Fix

Install lld and link both linux arches with --linkopt=-fuse-ld=lld. lld:

so one uniform linker works for x86_64 and arm64. Linker choice doesn't change which glibc/libstdc++ symbol versions are referenced, so the glibc 2.31 portability from #5 is preserved.

Validation status (build pipeline, run 28060201258)

  • ✅ old-glibc container builds, deps install, bazelisk runs, compilation proceeds
  • ✅ darwin-arm64 builds
  • ❌ linux link (bfd / --start-lib) → fixed here
  • The only remaining unproven step is the lld link itself.

Head SHA 477ccdfe72 — confirm before merging.

🤖 Generated with Claude Code

The bfd linker on ubuntu:20.04 (binutils 2.34) rejects the --start-lib
flag Bazel emits:

  /usr/bin/ld.bfd: unrecognized option '--start-lib'

--start-lib is only supported by gold and lld. Install lld and link both
linux arches with --linkopt=-fuse-ld=lld: it handles --start-lib and also
sidesteps the aarch64 gold erratum-843419 crash, so one uniform linker
works for x86_64 and arm64. Linker choice does not affect glibc symbol
versioning, so portability is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexeagle
alexeagle merged commit c6d0a39 into master Jun 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant