-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apple-m1 compiler optimisations for aarch64-darwin? #166401
Comments
The current flags come from #105026 (comment) by @bobrik.
Not that I know of.
That does also sound like an improvement, and might even resolve the TODO items added in 4aa95e3 (#115235 (comment)). We could probably handle llvm11 compatibility in the cc-wrapper as a special case, if it's still needed. I don't expect there to be a large difference between llvm11 and llvm12. Though we made a concession to llvm11 to revert the new default setting of |
This should allow clang to better optimise for the only aarch64-darwin CPU µarch Closes NixOS#166401
@thefloweringash fno-common migration is merged. Does that mean we can upgrade llvm to 12 (or higher?) for aarch64-darwin? |
Main blocker rn would be we can't upgrade the LLVM in the bootstraptools currently, relevant information linked from this PR. |
I don't know of any significant blockers.
Hopefully we don't have to update the bootstrap tools to update to a new version of llvm. The main part I don't know how to handle is the contents of this issue. For llvm that supports it, we want to use "apple-m1", but while bootstrapping from the older version (and presumably also for gcc) we'd need to provide a string the compiler understands. |
@thefloweringash, you want to update stdenv LLVM without bumping the version in the bootstrap-tools? |
I have seen nixpkgs use llvm v4 in bootstrap tools and llvm v7 in the stdenv. It should be possible to bootstrap llvm like this. I'm not advocating for it though, and in general I don't mind updating bootstrap tools more frequently if it makes things easier. |
Issue description
nixpkgs/lib/systems/platforms.nix
Lines 393 to 398 in dd697d4
adds inappropriate
arch
args for apple-m1. According to Apple clang,arch = "armv8.5a+fp-armv8+neon+crc+crypto+dotprod+fp16fml+ras+lse+rdm+rcpc+zcm+zcz+fullfp16+sm4+sha3+sha2+aes";
.(The string isn't even correct for
apple-13
AFAICT, it'sarmv8.4a
.)Is there any reason against setting
arch
to the string above?Secondly, is there any reason against setting
cpu = "apple-m1";
once llvm12 is default? llvm11 doesn't support that cpu type; what would happen if a package's llvm was overridden to be llvm11?cc @thefloweringash @NixOS/darwin-maintainers
The text was updated successfully, but these errors were encountered: