Skip to content

llvmPackages_{20,21,git}.compiler-rt: no fmv on aarch64 without libc#409265

Merged
RossComputerGuy merged 1 commit intoNixOS:stagingfrom
RossComputerGuy:fix/pkgsllvm/stdenv
Sep 13, 2025
Merged

llvmPackages_{20,21,git}.compiler-rt: no fmv on aarch64 without libc#409265
RossComputerGuy merged 1 commit intoNixOS:stagingfrom
RossComputerGuy:fix/pkgsllvm/stdenv

Conversation

@RossComputerGuy
Copy link
Member

…patch

Things done

Fixes #393603
Reverts #380213
Required for #407738

We're sending this patch to master and backporting it so pkgsLLVM actually works correctly with LLVM 20 and git.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 21, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. labels May 21, 2025
@alyssais
Copy link
Member

Upstream?

@RossComputerGuy
Copy link
Member Author

Already tried going upstream but the PR was closed llvm/llvm-project#125922

@alyssais
Copy link
Member

Hmm, unfortunate…

@Ericson2314 what do you think about applying this? Seems a real shame to be adding a new LLVM patch.

@peterwaller-arm
Copy link
Contributor

peterwaller-arm commented Jul 15, 2025

@Ericson2314 just published a blog post adjacent to this: https://blog.obsidian.systems/compiler-bootstrapping-in-nixpkgs/

As patch author, my opinion is that given the timescales involved for a proper fix (e.g. llvm/llvm-project#127227), it would be good to unbreak this today in nixpkgs.

@RossComputerGuy
Copy link
Member Author

timescales involved for a proper fix (e.g. #127227)

Wrong issue linked?

@peterwaller-arm
Copy link
Contributor

Wrong issue linked?

Right issue number, wrong repo. Fixed.

@Artturin Artturin closed this Jul 28, 2025
@Artturin Artturin reopened this Jul 28, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. and removed 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Jul 28, 2025
@Ericson2314
Copy link
Member

Can we make the patch less linux-specific? Conceptually, we're talking about about generally building a "freestanding" compiler-rt on a non-freestanding platform, of which Linux is merely one example.

@peterwaller-arm
Copy link
Contributor

Can we make the patch less linux-specific? Conceptually, we're talking about about generally building a "freestanding" compiler-rt on a non-freestanding platform, of which Linux is merely one example.

https://github.com/llvm/llvm-project/blob/0c0aa56cdcf1fe3970a5f3875db412530512fc07/compiler-rt/lib/builtins/CMakeLists.txt#L884

It looks like setting COMPILER_RT_DISABLE_AARCH64_FMV is a better non-linux specific way forward here.

@RossComputerGuy RossComputerGuy mentioned this pull request Jul 31, 2025
13 tasks
@RossComputerGuy RossComputerGuy force-pushed the fix/pkgsllvm/stdenv branch 2 times, most recently from 8e018d7 to 31c3a2e Compare July 31, 2025 16:26
@RossComputerGuy
Copy link
Member Author

It looks like setting COMPILER_RT_DISABLE_AARCH64_FMV is a better non-linux specific way forward here.

Done and I've verified this to work correctly, it was blocking me for testing #429745 & #402198 since compiler-rt was failing. This should be gtg now, I'll merge once this gets approved.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. labels Sep 1, 2025
Copy link
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

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

Looks good but needs to go to staging.

@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 Sep 1, 2025
@RossComputerGuy RossComputerGuy marked this pull request as draft September 1, 2025 15:34
@RossComputerGuy RossComputerGuy changed the base branch from master to staging September 1, 2025 15:35
@ofborg ofborg bot added the ofborg-internal-error Ofborg encountered an error label Sep 1, 2025
@nixpkgs-ci nixpkgs-ci bot closed this Sep 1, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Sep 1, 2025
@RossComputerGuy RossComputerGuy marked this pull request as ready for review September 1, 2025 15:35
@ofborg ofborg bot removed the ofborg-internal-error Ofborg encountered an error label Sep 1, 2025
aarch64 FMV (Function MultiVersioning) is not available before the libc
is available. This causes issues while building with compiler-rt on
aarch64. By disabling FMV before the libc is available resolves missing
symbol errors.
@RossComputerGuy
Copy link
Member Author

Rebasing to fix CI

@nix-owners nix-owners bot requested a review from emilazy September 13, 2025 16:33
@RossComputerGuy RossComputerGuy merged commit 4a9d557 into NixOS:staging Sep 13, 2025
27 of 31 checks passed
@RossComputerGuy RossComputerGuy deleted the fix/pkgsllvm/stdenv branch September 13, 2025 16:40
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Sep 13, 2025

Successfully created backport PR for staging-25.05:

@github-actions github-actions bot added the 8.has: port to stable This PR already has a backport to the stable release. label Sep 13, 2025
@emilazy
Copy link
Member

emilazy commented Sep 18, 2025

This doesn’t appear to be necessary for Darwin – should we undo it there? I suppose haveLibc is always effectively true on macOS.

@RossComputerGuy
Copy link
Member Author

I had pointed that out that this only really is needed for useLLVM. #409265 (comment)

@alyssais
Copy link
Member

Sounds like we should adjust the definition of haveLibc.

@peterwaller-arm
Copy link
Contributor

This doesn’t appear to be necessary for Darwin – should we undo it there?

@emilazy Per the diff, if haveLibc is always true on Darwin, it should not have any effect on Darwin, no? Can you help me parse your comment? I guess this leads to @alyssais's comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: libcxx with LLVM+LLD on aarch64-linux

6 participants