Skip to content

[Backport release-26.05] llvmPackages_{22,23,git}.compiler-rt: fix no-libc build on aarch64-linux - #570190

Merged
whispersofthedawn merged 1 commit into
release-26.05from
backport-566346-to-release-26.05
Oct 6, 2026
Merged

whispersofthedawn merged 1 commit into
release-26.05from
backport-566346-to-release-26.05

Conversation

@nixpkgs-ci

@nixpkgs-ci nixpkgs-ci Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Bot-based backport to release-26.05, triggered by a label in #566346.

Before merging, ensure that this backport is acceptable for the release.

Even as a non-committer, if you find that it is not acceptable, leave a comment.

Tip

If you maintain all packages touched by this pull request, and they are all located under pkgs/by-name/*, you can comment @NixOS/nixpkgs-merge-bot merge to automatically merge this PR using the nixpkgs-merge-bot.

LLVM 22 dropped the `__has_include(<sys/auxv.h>)` guards from the
AArch64 LSE-atomics and FMV feature detection in compiler-rt's builtins
(llvm/llvm-project#161751, released in 22.1.0). The no-libc variant of
compiler-rt, which libcxx and the libc++ clang wrappers are built with,
has no libc headers, so lib/builtins/cpu_model/aarch64.c fails with

    fatal error: 'sys/auxv.h' file not found

and llvmPackages_22.{compiler-rt-no-libc,libcxx,libcxxClang,clangUseLLVM}
cannot be built on aarch64-linux; the same holds for llvmPackages_23 and
llvmPackages_git. Hydra has no aarch64-linux build of any of these jobs,
while the llvmPackages_21 ones build.

Restore the LLVM 21 behaviour for the no-libc build: guard both
`#elif defined(__linux__)` branches with `__has_include(<sys/auxv.h>)`,
so LSE detection is skipped and __aarch64_have_lse_atomics stays false
without a libc, as it did in 21. The FMV branch is already compiled out
in this configuration by COMPILER_RT_DISABLE_AARCH64_FMV (ded560c).
The substitution applies unchanged to 22.1.8, 23.1.0 and the git
snapshot.

Only compiler-rt-no-libc and what is built on top of it change, and only
on aarch64-linux: compiler-rt (with libc), clang, libllvm, lld and the
stdenv keep their derivations, and nothing changes on x86_64-linux. The
gate includes isLinux because Darwin builds compiler-rt-no-libc without
a libc as well but never takes the __linux__ branches; without it every
llvmPackages_{22,23} derivation on aarch64-darwin would rebuild for no
effect.

Fixes #495155.

Assisted-by: Claude Code (Claude Fable 5.1)
(cherry picked from commit 8c59070)
@nixpkgs-ci
nixpkgs-ci Bot requested a review from randomizedcoder October 4, 2026 15:21
@nixpkgs-ci
nixpkgs-ci Bot requested review from a team and balsoft and removed request for a team October 4, 2026 15:27
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. llm-assisted Contributions that include code generation with LLMs 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 4.workflow: backport This targets a stable branch labels Oct 4, 2026
@nixpkgs-ci
nixpkgs-ci Bot requested a review from a team October 4, 2026 16:52
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Oct 5, 2026

@whispersofthedawn whispersofthedawn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

built all revdeps on aarch64-linux, seems fine

@whispersofthedawn
whispersofthedawn added this pull request to the merge queue Oct 6, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Oct 6, 2026
Merged via the queue into release-26.05 with commit e629696 Oct 6, 2026
38 checks passed
@whispersofthedawn
whispersofthedawn deleted the backport-566346-to-release-26.05 branch October 6, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.workflow: backport This targets a stable branch 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants