Skip to content

Commit

Permalink
haskell.compiler.ghc963}: fix up for bootstrapping GHC 9.8 on Darwin
Browse files Browse the repository at this point in the history
After NixOS#307880 was merged, ld64 is 951.9, which is the version shipped with Xcode 15.4. It is new enough to support all of the linker flags used by the upstream bindist.

The only remaining blockers to bootstrapping with the bindist on Darwin is the GHC issue that tries to use `ar -L`, which creates archives that cannot be linked by ld64. Overriding the setting in the bindist suppresses that behavior.
  • Loading branch information
reckenrode committed Jul 28, 2024
1 parent e8c8a9a commit 3dac2da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/development/compilers/ghc/9.6.3-binary.nix
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ stdenv.mkDerivation rec {
isScript "$i" || continue
sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' "$i"
done
'' + lib.optionalString stdenv.targetPlatform.isDarwin ''
# Work around building with binary GHC on Darwin due to GHC’s use of `ar -L` when it
# detects `llvm-ar` even though the resulting archives are not supported by ld64.
# https://gitlab.haskell.org/ghc/ghc/-/issues/23188
# https://github.com/haskell/cabal/issues/8882
sed -i -e 's/,("ar supports -L", "YES")/,("ar supports -L", "NO")/' "$out/lib/ghc-${version}/lib/settings"
'';

# Apparently necessary for the ghc Alpine (musl) bindist:
Expand Down

0 comments on commit 3dac2da

Please sign in to comment.