Skip to content

haskell.compiler.*: don't unnecessarily include LLVM for GHC >= 9.2#246045

Merged
sternenseemann merged 1 commit intoNixOS:haskell-updatesfrom
sternenseemann:ghc-ncg-aarch64-linux
Oct 4, 2023
Merged

haskell.compiler.*: don't unnecessarily include LLVM for GHC >= 9.2#246045
sternenseemann merged 1 commit intoNixOS:haskell-updatesfrom
sternenseemann:ghc-ncg-aarch64-linux

Conversation

@sternenseemann
Copy link
Copy Markdown
Member

When 9.2.1 was released, I apparently was confused by the wording. The NCG (-fasm) codegen backend for aarch64 not only works on aarch64-darwin, but also aarch64-linux. useLLVM being enabled on aarch64-linux had no adverse effect, as GHC used -fasm anyways, but it did inflate closure size unnecessarily which we can rectify now.

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (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.

@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Jul 29, 2023
@ofborg ofborg bot requested review from expipiplus1 and guibou July 29, 2023 13:46
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jul 29, 2023
When 9.2.1 was [released], I apparently was confused by the wording. The
NCG (-fasm) codegen backend for aarch64 not only works on
aarch64-darwin, but also aarch64-linux. `useLLVM` being enabled on
aarch64-linux had no adverse effect, as GHC used -fasm anyways, but it
did inflate closure size unnecessarily which we can rectify now.

[released]: https://www.haskell.org/ghc/blog/20211029-ghc-9.2.1-released.html
@sternenseemann sternenseemann merged commit 59ee081 into NixOS:haskell-updates Oct 4, 2023
@sternenseemann sternenseemann deleted the ghc-ncg-aarch64-linux branch October 4, 2023 18:17
sternenseemann added a commit that referenced this pull request Oct 22, 2023
The original change missed that we used to erroneously provide LLVM on
aarch64-linux, but not on aarch64-darwin which was later fixed
in #246045. Since the change was tested on aarch64-linux prior to this,
tls ended up being broken on both aarch64-linux and aarch64-darwin.

This commit resolves the situation by introducing a helper function to
achieve the effect of passing -fllvm while ensuring LLVM is provided.

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

Labels

6.topic: haskell General-purpose, statically typed, purely functional programming language 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants