From 477ccdfe72d6d18d094158f8d11a880f647fa57a Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 23 Jun 2026 15:42:39 -0700 Subject: [PATCH] Link linux builds with lld instead of bfd 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) --- .github/workflows/figma-release.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/figma-release.yml b/.github/workflows/figma-release.yml index d3002ac6dc595c..d04034a4ec3a0b 100644 --- a/.github/workflows/figma-release.yml +++ b/.github/workflows/figma-release.yml @@ -207,22 +207,24 @@ jobs: run: | set -euo pipefail # Build (and package) entirely inside the old-glibc container. The - # repo is bind-mounted; env vars are forwarded with -e. Force the bfd - # linker so we never hit the aarch64 gold erratum-843419 crash. + # repo is bind-mounted; env vars are forwarded with -e. Link with lld: + # it supports the --start-lib/--end-lib flags Bazel emits (bfd on + # 20.04's binutils 2.34 does not) and avoids the aarch64 gold + # erratum-843419 crash. Linker choice does not affect glibc portability. docker run --rm \ -v "$PWD":/workspace -w /workspace \ -e USE_BAZEL_VERSION -e VERSION -e ARCH -e BAZELISK_ARCH \ ubuntu:20.04 bash -euo pipefail -c ' export DEBIAN_FRONTEND=noninteractive apt-get update - apt-get install -y build-essential python3 zip unzip curl ca-certificates + apt-get install -y build-essential lld python3 zip unzip curl ca-certificates curl -fsSL -o /usr/local/bin/bazel \ "https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-${BAZELISK_ARCH}" chmod +x /usr/local/bin/bazel bazel build -c opt --stamp \ --embed_label "$VERSION" \ --incompatible_strict_action_env=true \ - --linkopt=-fuse-ld=bfd \ + --linkopt=-fuse-ld=lld \ //src:bazel //src:bazel_nojdk mkdir -p dist # Bazelisk asset names: bazel--- and the nojdk