Repository navigation
[LLVM_full] Restore compiler-rt on AArch64 and ARM for LLVM 22/23 - #14805
Merged
Merged
Conversation
BinaryBuilder rejects the -march flags in compiler-rt's architecture probes. The failed probes silently remove ARM architectures from the runtime build, leaving Clang without builtins or the library needed by -fprofile-generate. Extend the AArch64/aarch32 probe fix from Yggdrasil#12953 to LLVM 22 and 23. Also fix the separate arm probe used by armv6l and armv7l: select armhf with the wrapper's default flags, preserving the target's CPU and hard-float ABI. Once AArch64 runtimes are enabled, emupac.cpp fails with the bundled GNU assembler. Omit it for GCC builds while retaining it for Clang builds. Keep this workaround with the probe fix so enabling the runtimes does not introduce an intermediate assembler failure. Bump build triggers for both regular and assert recipes; the latter share the patches through bundled symlinks. Validation: patches apply without fuzz or offsets to both pinned sources; CMake checks cover the four ARM probe paths and GCC/Clang/MSVC PAC selection. The previous full LLVM 22 aarch64-linux-gnu build validates the unchanged AArch64 probe and GCC source selection. Other targets still need CI.
A failed architecture probe can disable every compiler-rt runtime without failing CMake or Ninja. After installation, require a profile archive in the current LLVM major's resource directory on Linux and MinGW. Apply the check to LLVM 22 onward, where this branch adds the probe fix, so older recipes do not acquire a new failure on rebuild. The archive glob matches the layout selected by LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF. Validation: bash -n on the build script, ShellCheck on the guard with its external variables declared, and ten shell cases covering missing/present archives, version/platform gating, paths with spaces, and unrelated files.
AArch64 FreeBSD is one of the platforms restored here, and it installs the runtimes as `lib/clang/<ver>/lib/freebsd/libclang_rt.profile-aarch64.a`, which the existing glob already matches. Cover it too, so the check spans every platform this fixes rather than stopping at Linux and Windows.
Member
Author
|
Sorry to kick off another huge run, but it doubles as a good way to catch JuliaPackaging/BinaryBuilder.jl#1453 |
maleadt
enabled auto-merge (squash)
September 15, 2026 13:28
With the architecture probes fixed, compiler-rt now builds on these targets and hits two problems that PR CI exposed: - On musl, only SANITIZERS and XRAY were disabled, but memprof and ctx_profile also pull in sanitizer_common, which does not compile against musl on ARM and AArch64. Both are x86_64-only, so disable them on musl targets other than x86_64 (x86_64-linux-musl keeps shipping them). - LLVM 22 enables COMPILER_RT_ARM_OPTIMIZED_FP by default. Its assembly needs ARMv7, which breaks armv6l, and LLVM 23's divdf3.S uses syntax that our GNU as 2.34 cannot parse. Turn it off on 32-bit ARM for LLVM >= 22 so the generic C builtins are used.
maleadt
added a commit
to JuliaLang/julia
that referenced
this pull request
Sep 16, 2026
Clang_jll 23.1.1+2 is extracted from a rebuilt LLVM_full_jll that installs compiler-rt on AArch64 and ARM Linux and on AArch64 FreeBSD (JuliaPackaging/Yggdrasil#14805, JuliaPackaging/Yggdrasil#14812). Earlier builds shipped no libclang_rt archives on those platforms, so linking with -fprofile-generate, as the instrumented stage of contrib/optimized does, failed there for want of the profile runtime. The LLVM sources and patches are unchanged, so libLLVM, LLD and the LLVM tools stay at 23.1.1+1. Assisted-by: Claude Code (Opus 5)
maleadt
added a commit
to JuliaLang/julia
that referenced
this pull request
Sep 17, 2026
Clang_jll 23.1.1+2 is extracted from a rebuilt LLVM_full_jll that installs compiler-rt on AArch64 and ARM Linux and on AArch64 FreeBSD (JuliaPackaging/Yggdrasil#14805, JuliaPackaging/Yggdrasil#14812). Earlier builds shipped no libclang_rt archives on those platforms, so linking with -fprofile-generate, as the instrumented stage of contrib/optimized does, failed there for want of the profile runtime. The LLVM sources and patches are unchanged, so libLLVM, LLD and the LLVM tools stay at 23.1.1+1. Assisted-by: Claude Code (Opus 5)
maleadt
added a commit
to JuliaLang/julia
that referenced
this pull request
Sep 17, 2026
Clang_jll 23.1.1+2 is extracted from a rebuilt LLVM_full_jll that installs compiler-rt on AArch64 and ARM Linux and on AArch64 FreeBSD (JuliaPackaging/Yggdrasil#14805, JuliaPackaging/Yggdrasil#14812). Earlier builds shipped no libclang_rt archives on those platforms, so linking with -fprofile-generate, as the instrumented stage of contrib/optimized does, failed there for want of the profile runtime. The LLVM sources and patches are unchanged, so libLLVM, LLD and the LLVM tools stay at 23.1.1+1. Assisted-by: Claude Code (Opus 5)
This was referenced Sep 18, 2026
maleadt
added a commit
to JuliaLang/julia
that referenced
this pull request
Sep 18, 2026
Clang_jll 23.1.1+2 is extracted from a rebuilt LLVM_full_jll that installs compiler-rt on AArch64 and ARM Linux and on AArch64 FreeBSD (JuliaPackaging/Yggdrasil#14805, JuliaPackaging/Yggdrasil#14812). Earlier builds shipped no libclang_rt archives on those platforms, so linking with -fprofile-generate, as the instrumented stage of contrib/optimized does, failed there for want of the profile runtime. The LLVM sources and patches are unchanged, so libLLVM, LLD and the LLVM tools stay at 23.1.1+1. Assisted-by: Claude Code (Opus 5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLVM_full 22 and 23 can finish building successfully while installing no
compiler-rt libraries on AArch64 and 32-bit ARM. This leaves the extracted
Clang_jll without compiler builtins or the profile runtime needed to link code
compiled with
-fprofile-generate.compiler-rt detects supported architectures by compiling small test programs.
Its ARM probes pass
-march, which BinaryBuilder's compiler wrapper rejectsbecause it controls the target architecture itself. The failed probes remove the
architecture from the runtime build, but do not fail the overall LLVM build.
This extends the diagnosis and AArch64 fix in
JuliaPackaging/Yggdrasil#12953
to LLVM 22 and 23, with these changes:
-march=armv8-afrom the AArch64 and aarch32 probes.armprobe used byarmv6landarmv7l. Probearmhfusingthe wrapper's defaults: these BinaryBuilder targets use the hard-float ABI,
and the wrapper selects the correct CPU. This also avoids imposing ARMv7
instructions on ARMv6 builds. Changing only the aarch32 probe does not fix
these targets.
emupac.cpp) when buildingwith GCC. Once AArch64 runtimes are enabled, the bundled GNU assembler rejects
that file's PAC instructions. Clang builds retain these builtins. GCC-built
artifacts consequently do not support the emulated-PAC helpers.
libclang_rt.profile*.aarchive in the currentLLVM major's resource directory on Linux and MinGW. A failed probe will now
fail the build instead of producing an artifact without runtimes. The check
applies to LLVM 22 onward; older recipes and macOS are outside its scope. A
separable third commit extends the same check to FreeBSD, since AArch64 FreeBSD
is one of the platforms restored here and installs the archive under
lib/clang/<major>/lib/freebsd/.Build triggers are bumped for both LLVM_full and LLVM_full_assert at 22 and 23.
The assert recipes share the patches through symlinks and need their own trigger.
The probe fix and assembler workaround are kept in one commit because enabling
AArch64 runtimes requires both. A second commit adds the installation check, and a
third extends it to FreeBSD; that third commit is independent and can be dropped.
Validation
Three full
LLVM_full@22builds against the final branch, in the BinaryBuildersandbox, roughly 25-30 minutes each:
aarch64-linux-gnulibclang_rt.profile-aarch64.a. Tree hash identical to the pre-review build, so the revisions are behaviour-preserving herearmv7l-linux-gnueabihflibclang_rt.profile-armhf.a. This is the target the revisedarmprobe fixesaarch64-unknown-freebsdlibclang_rt.profile-aarch64.a, withemupac.cppcompiled by Clang 18 andlibclang_rt.builtins-aarch64.aproducedEvery released artifact for those three platforms contains zero compiler-rt
files today.
-- Compiler-RT supported architectures:reportsaarch64/armhfwhere it is empty without the patches, which is the bug in a single line. The
post-install check passed on all three.
Also verified:
julia-22.1.8-1andjulia-23.1.1-1sources atexact offsets with no fuzz (
patch --dry-run, then three real builds). The 23 pinhas since moved to
fbe0dc11([LLVM_full] Rebuild v23.1.1 with AArch64 load latency fix #14797); its two extra commits touch onlyllvm/,not compiler-rt.
the file (their GNU as is 2.34, which rejects
xpaclri,.arch_extension pauthand
pacda), while FreeBSD, which builds with Clang 18, keeps and compiles it.AArch64 build installs neither, so [LLVM_full] Don't set -march in cmake tests for compiler-rt targets #12953's musl hunk is unnecessary here.
Not built:
aarch64-linux-musl,armv6l, the ARM musl variants, and all ofLLVM 23. #12953's CI is green for the equivalent change on LLVM 20/21 across all of
those platforms, and the LLVM 23 patches were confirmed to apply. CI still needs to
cover them here.
Once this registers as 22.1.8+2 / 23.1.1+2,
Clang_jllgets re-extracted from itagainst the existing
libLLVM_jll+1 (only Clang ships the compiler-rt archives;the other extraction packages are unaffected).