Build on the llvm-linux host runner; build the Windows compiler with the system clang #3

Merged
techwritescode merged 14 commits from llvm-linux-runner into main 2026-10-06 03:03:41 +00:00

Moves build.yml from the Ubuntu container to the dedicated llvm-linux runner and adds a Windows cross-build job there.

Native build

  • Persistent build tree under /var/lib/llvm (BUILD_ROOT), clang + lld + ccache. A run with no LLVM change takes about 2 minutes; the first cold LLVM build took about 11 minutes, against about 42 before.
  • BUILD_ROOT, LLVM_HOST_COMPILER=clang and LLVM_USE_CCACHE are opt-in, so release.yml's container jobs behave as before.
  • fetch_source prints why rev-parse failed on an existing clone instead of exiting silently.
  • compiler-rt and libc++ are configured with CMAKE_DISABLE_FIND_PACKAGE_LLVM=ON, because the host has LLVM 21 dev files installed.

Windows cross build (LLVM_HOST_COMPILER=clang with PS2_CROSS_HOST)

  • Uses the system clang and lld with the mingw-w64 packages. clang picks the win32 thread-model GCC tree, so a sysroot of symlinks exposes only the posix tree. Linked with -static -pthread.
  • -femulated-tls to match libstdc++'s std::call_once; the cross clang is also the assembler (blake3 .S files).
  • Reuses the native tablegen tools when they are in the same build root.
  • build.yml gets a build-windows-cross job that checks the PE binaries and uploads the toolchain (1 day) for testing. release.yml's Windows job installs clang and lld and sets LLVM_HOST_COMPILER=clang.

Verified: runs #21, #22 and #30 pass. The Windows artifact from run #31 starts (clang 24.0.0git, a8e9761d51a0), compiles and links the libm test with the ee wrapper, and the PCSX2 run passes with output identical to the earlier compiler.

Not covered: release.yml has not run since these changes, and it still needs a LICENSE file in the repo.

🤖 Generated with Claude Code

Moves build.yml from the Ubuntu container to the dedicated llvm-linux runner and adds a Windows cross-build job there. Native build - Persistent build tree under /var/lib/llvm (BUILD_ROOT), clang + lld + ccache. A run with no LLVM change takes about 2 minutes; the first cold LLVM build took about 11 minutes, against about 42 before. - BUILD_ROOT, LLVM_HOST_COMPILER=clang and LLVM_USE_CCACHE are opt-in, so release.yml's container jobs behave as before. - fetch_source prints why rev-parse failed on an existing clone instead of exiting silently. - compiler-rt and libc++ are configured with CMAKE_DISABLE_FIND_PACKAGE_LLVM=ON, because the host has LLVM 21 dev files installed. Windows cross build (LLVM_HOST_COMPILER=clang with PS2_CROSS_HOST) - Uses the system clang and lld with the mingw-w64 packages. clang picks the win32 thread-model GCC tree, so a sysroot of symlinks exposes only the posix tree. Linked with -static -pthread. - -femulated-tls to match libstdc++'s std::call_once; the cross clang is also the assembler (blake3 .S files). - Reuses the native tablegen tools when they are in the same build root. - build.yml gets a build-windows-cross job that checks the PE binaries and uploads the toolchain (1 day) for testing. release.yml's Windows job installs clang and lld and sets LLVM_HOST_COMPILER=clang. Verified: runs #21, #22 and #30 pass. The Windows artifact from run #31 starts (clang 24.0.0git, a8e9761d51a0), compiles and links the libm test with the ee wrapper, and the PCSX2 run passes with output identical to the earlier compiler. Not covered: release.yml has not run since these changes, and it still needs a LICENSE file in the repo. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Build on the llvm-linux host runner with clang, lld and ccache
Some checks failed
Build / build-native-linux (push) Failing after 3s
0bf38f21bf
build.yml now runs on the dedicated runner with a persistent build tree outside the
workspace. BUILD_ROOT, LLVM_HOST_COMPILER=clang and LLVM_USE_CCACHE are opt-in, so the
container jobs in release.yml are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
build.yml: use /var/lib/llvm and create the install dir if missing
Some checks failed
Build / build-native-linux (push) Failing after 2s
561be0f3c2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
fetch_source: show why rev-parse failed on an existing clone
Some checks failed
Build / build-native-linux (push) Failing after 12m59s
1b2c403bca
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Ignore a system LLVM install when configuring compiler-rt and libc++
All checks were successful
Build / build-native-linux (push) Successful in 2m23s
70f686699a
The host runner has LLVM 21 dev files installed (pulled in by the clang package), and
compiler-rt's find_package(LLVM) picked them up and failed.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Rebuild against ps2/llvm r5900-ee a8e9761d51a0
All checks were successful
Build / build-native-linux (push) Successful in 2m7s
50164b982f
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Build the Windows compiler with clang and libc++ from llvm-mingw
Some checks failed
Build / build-native-linux (push) Successful in 1m48s
Build / build-windows-cross (push) Has been cancelled
b1c86dbc30
llvm-mingw is pinned by version and checksum in scripts/install-llvm-mingw.sh and
replaces mingw-w64 GCC for the Windows cross build. apt's clang cannot be used: its
mingw driver picks the win32 thread model GCC directory. When the native build ran in
the same build root, its tablegen tools are reused. build.yml gets a Windows job on the
runner so the cross build is checked on every push.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Build the Windows compiler with the system clang instead of llvm-mingw
Some checks failed
Build / build-native-linux (push) Successful in 1m49s
Build / build-windows-cross (push) Failing after 2s
9a801a735f
Drops the downloaded llvm-mingw toolchain. With LLVM_HOST_COMPILER=clang the Windows
cross build uses the system clang and lld against the mingw-w64 packages. clang picks
the win32 thread-model GCC tree, so it gets a sysroot that only links the posix tree,
and links with -static -pthread so winpthreads is included.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
build.yml: put the Windows install under the build root
Some checks failed
Build / build-native-linux (push) Successful in 1m49s
Build / build-windows-cross (push) Has been cancelled
ad88b90cdc
The runner user cannot create new directories directly under /var/lib/llvm.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
build.yml: use /var/lib/llvm/install-win for the Windows install
Some checks failed
Build / build-native-linux (push) Successful in 1m48s
Build / build-windows-cross (push) Failing after 3s
072634d24b
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
build.yml: empty the Windows install dir instead of removing it
Some checks failed
Build / build-native-linux (push) Successful in 1m49s
Build / build-windows-cross (push) Failing after 6m43s
2ec9a9bfe1
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Windows cross build: use emulated TLS to match the mingw libstdc++
Some checks failed
Build / build-native-linux (push) Successful in 1m46s
Build / build-windows-cross (push) Failing after 7m20s
37072f54f8
libstdc++'s std::call_once uses thread-local variables that mingw GCC builds as emulated
TLS. clang defaulted to native TLS and the link failed on std::__once_callable.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Windows cross build: assemble .S files with the cross clang
All checks were successful
Build / build-native-linux (push) Successful in 1m49s
Build / build-windows-cross (push) Successful in 15s
5898c85bf5
CMake used the host assembler for blake3's .S files, which made Linux objects that the
Windows link rejected.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
build.yml: upload the Windows toolchain so it can be run on Windows
All checks were successful
Build / build-native-linux (push) Successful in 1m50s
Build / build-windows-cross (push) Successful in 1m40s
352a59c773
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Bundle the licenses of everything the toolchain is built from
All checks were successful
Build / build-native-linux (push) Successful in 1m47s
Build / build-windows-cross (push) Successful in 1m45s
836a3897ae
The release failed copying a repo LICENSE that does not exist, and bundled only two
files. scripts/bundle-licenses.sh copies the LLVM, clang, lld, compiler-rt, libc++,
libc++abi, libunwind, newlib/libgloss and pthread-embedded licenses, plus the mingw-w64
runtime notices for the Windows binaries, and the repo LICENSE when there is one. build.yml
runs it so a change that breaks it shows up before a release.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
techwritescode deleted branch llvm-linux-runner 2026-10-06 03:03:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ps2/llvm-toolchain!3
No description provided.