From 6454fb1bc0b5884d0c11c98a8a99735ef5a0cae8 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Fri, 14 Jul 2023 00:33:51 -0600 Subject: [PATCH] haskell.compiler.ghc962: fix build on Darwin after stdenv rework merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- pkgs/development/compilers/ghc/common-hadrian.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index b90a4934fdba..099a7fd2568f 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -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 doesn’t 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.