Skip to content

release: publish llvm-ld-coff prebuilt binaries for eight hosts on v* tags - #36

Merged
zackees merged 6 commits into
mainfrom
ci/publish-releases
Sep 19, 2026
Merged

zackees merged 6 commits into
mainfrom
ci/publish-releases

Conversation

@zackees

@zackees zackees commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Publishes prebuilt llvm-ld-coff binaries on this repo's Releases page, so consumers such as reld can link Windows targets through llvm-ld without compiling LLVM.

What llvm-ld-coff is

LLD's COFF linker (the lld-link/MSVC and MinGW drivers) as a shared library behind the C ABI in llvm_ld.h. Every build links Windows PE/COFF executables and DLLs. The triple in an asset's name is the host the library runs on, never the target it links, so the Linux and macOS builds are Windows cross-linkers. Assets are named llvm-ld-coff-<version>-<host-triple> to keep that unambiguous.

Hosts

OS Hosts Runner Notes
Windows x64, arm64 windows-2025, windows-11-arm MSVC dev shell per arch; .zip with llvm_ld.dll + llvm_ld.lib
Linux glibc x64, arm64 ubuntu-24.04, ubuntu-24.04-arm libstdc++/libgcc linked statically, so the .so loads on older hosts
Linux musl x64, arm64 same, inside alpine:3.20 linked against musl; tested natively
macOS arm64, x64 macos-14 x64 cross-built with CMAKE_OSX_ARCHITECTURES=x86_64, smoke-tested under Rosetta

How

  • tools/release_build.py configures with the same flags as ci.yml, builds llvm_ld, llvm-ld-runner and abi_smoke, then runs the ABI smoke test against the freshly built library. It packages the library, header, runner and license/provenance notices into one top-level directory. It has unit tests in tests/test_release_build.py.
  • .github/workflows/release.yml builds all eight hosts. On a v* tag, publish checks that exactly 8 archives exist, writes SHA256SUMS, and creates the release. A PR touching the release path builds the full matrix without publishing, so a tag never hits a broken leg for the first time. This PR is that run.

ci.yml is unchanged.

Verification

  • python3 -m unittest discover -s tests -p 'test_*.py' passes, including 7 new packaging tests: naming, per-OS library names, static libstdc++ on Linux, macOS x64 cross-build, zip vs. tarball layout, and a loud failure on missing build output.
  • A local release_build.py --triple x86_64-unknown-linux-gnu configures, imports the payload and builds on a Linux host.
  • This PR's release run is the real check: all 8 legs build, smoke-test and package.

🤖 Generated with Claude Code

… tags

llvm-ld is LLD's COFF linker (the lld-link/MSVC and MinGW drivers) as a shared
library, and it has never published a binary. reld wants to link Windows targets
through it without ever compiling LLVM itself, which needs a pinned, checksummed
prebuilt per host.

`release.yml` builds eight hosts natively: Windows x64/arm64, Linux glibc and
musl on x64/arm64 (musl in Alpine), and macOS arm64/x64 (x64 cross-built on
arm64, smoke-tested under Rosetta). `tools/release_build.py` configures with
ci.yml's flags, builds the library and runner, runs the ABI smoke test against
the fresh library, and packages the header, the runner, and the license and
provenance notices. Linux builds link libstdc++ statically, so the .so loads on
hosts with an older C++ runtime.

Assets are named `llvm-ld-coff-<version>-<host-triple>`. The triple is the host
the library runs on; every archive links Windows PE/COFF, so the Linux and macOS
builds are Windows cross-linkers. A tag publishes all eight with SHA256SUMS; a
PR touching the release path builds the full matrix without publishing, so a tag
never meets a broken leg for the first time.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@zackees
zackees force-pushed the ci/publish-releases branch from 5427289 to 86d9f33 Compare September 18, 2026 22:52
@zackees zackees changed the title ci: publish the tested Windows DLL as a GitHub Release on v* tags release: publish llvm-ld-coff prebuilt binaries for eight hosts on v* tags Sep 18, 2026
zackees and others added 5 commits September 18, 2026 16:03
…r yet

The committed payload is exactly the files the x86_64 Windows and Linux builds
read. aarch64 Linux and macOS builds read a few more upstream files (for example
libc/src/__support/FPUtil/aarch64/nearest_integer.h and
llvm/cmake/modules/UseLibtool.cmake), so the release matrix fails on them before
compiling reld-relevant code.

tools/prepare_discovery_tree.py rebuilds the pre-closure tree: full upstream at
the pinned commit, minus the reviewed directory prune, with the declared patched
files taken from the committed payload. closure-discovery.yml builds over it on
each uncovered host and audits what the build read, exactly as ci.yml does. The
per-host closures are then merged with tools/merge_llvm_closures.py and the
payload re-materialized, so every added file is byte-identical upstream.

Checked locally against the llvmorg-23.1.0 release tarball: all 5,609 files in
the committed closure are present in the discovery tree with identical SHA-256,
including the five declared patches, so the tarball matches the pinned commit.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
LLVM prepends llvm/cmake/modules to CMAKE_MODULE_PATH, so an upstream
FindLibXml2.cmake in the discovery tree shadows llvm-ld's find-shim and makes
configure look for a system libxml2 instead of the vendored one. The musl leg
failed on exactly that; hosts that have a system libxml2 would instead have
configured a different build than production and put FindLibXml2.cmake into the
merged closure. Every module in cmake/find-shims/ is now excluded.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…inja with -t inputs

All four hosts compiled llvm-ld-coff over the discovery tree; only the audit
after it failed. audit_build.py reads CMake's codemodel reply, which configure
writes only when the query file exists beforehand (ci.yml creates it), and
Alpine's ninja predates `-t inputs`, so the musl leg installs ninja from PyPI.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Closure discovery on the four hosts the payload did not cover (aarch64 glibc and
musl Linux, arm64 and x86_64 macOS) found 62 upstream files their builds read:
aarch64 math headers under libc/src/__support/, Apple-only CMake modules
(UseLibtool.cmake, FindLibEdit.cmake), and headers LLVM's CMake picks up by
globbing. The four closures were normalized, merged with the committed one, and
the payload re-materialized; tools/verify.py passes. All 62 files are byte-
identical upstream and no existing payload file changed.

macOS depfiles record headers in the case their #include used (llvm/ASMParser/
for upstream llvm/AsmParser/), which a case-sensitive checkout cannot find, so
normalize_closure.py gains --canonicalize-against to resolve path case against
the upstream tree; it dropped exactly the eight case-duplicates of existing
entries. merge_llvm_closures.py's derivation string now names the macOS hosts,
and PROVENANCE.md documents host coverage and the discovery procedure.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
… stand-in

The reproducer rebuilds its upstream stand-in from the pre-strip commit, which
predates the aarch64/macOS host-coverage files, so it could not reproduce them.
Like CrossCompile.cmake already, locked unpatched files the commit lacks now come
from the committed payload (hash-locked in the closure and checked against the
upstream tarball when added). Declared patched files are never backfilled, so the
test still proves the prune list and patches reproduce the payload; the negative
control still rejects a tampered input.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@zackees
zackees merged commit 0444b11 into main Sep 19, 2026
21 checks passed
@zackees
zackees deleted the ci/publish-releases branch September 19, 2026 02:25
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.

1 participant