haskell.compiler.ghc962: fix build on Darwin after stdenv rework merge

The switch to cctools-llvm made several LLVM tools the default on
Darwin, which includes llvm-ar. GHC will try to use `-L` with `ar` when
it is `llvm-ar`, but that doesn’t work currently on Darwin.

See https://gitlab.haskell.org/ghc/ghc/-/issues/23188.
This commit is contained in:
Randy Eckenrode 2023-07-14 00:33:51 -06:00
parent 03bf9ffd85
commit 6454fb1bc0
No known key found for this signature in database
GPG key ID: 64C1CD4EC2A600D9

View file

@ -385,6 +385,12 @@ stdenv.mkDerivation ({
"--enable-dwarf-unwind"
"--with-libdw-includes=${lib.getDev elfutils}/include"
"--with-libdw-libraries=${lib.getLib elfutils}/lib"
] ++ lib.optionals targetPlatform.isDarwin [
# Darwin uses llvm-ar. GHC will try to use `-L` with `ar` when it is `llvm-ar`
# but it doesnt currently work because Cabal never uses `-L` on Darwin. See:
# https://gitlab.haskell.org/ghc/ghc/-/issues/23188
# https://github.com/haskell/cabal/issues/8882
"fp_cv_prog_ar_supports_dash_l=no"
];
# Make sure we never relax`$PATH` and hooks support for compatibility.