summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc/8.6.5-binary.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/ghc/8.6.5-binary.nix')
-rw-r--r--pkgs/development/compilers/ghc/8.6.5-binary.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/pkgs/development/compilers/ghc/8.6.5-binary.nix b/pkgs/development/compilers/ghc/8.6.5-binary.nix
index 8a0994b8b6a..ea4542a38b2 100644
--- a/pkgs/development/compilers/ghc/8.6.5-binary.nix
+++ b/pkgs/development/compilers/ghc/8.6.5-binary.nix
@@ -121,8 +121,9 @@ stdenv.mkDerivation rec {
 
   configurePlatforms = [ ];
   configureFlags = [
-    "--with-gmp-libraries=${lib.getLib gmp}/lib"
     "--with-gmp-includes=${lib.getDev gmp}/include"
+    # Note `--with-gmp-libraries` does nothing for GHC bindists:
+    # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6124
   ] ++ lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
     ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
 
@@ -152,6 +153,15 @@ stdenv.mkDerivation rec {
     done
   '';
 
+  # In nixpkgs, musl based builds currently enable `pie` hardening by default
+  # (see `defaultHardeningFlags` in `make-derivation.nix`).
+  # But GHC cannot currently produce outputs that are ready for `-pie` linking.
+  # Thus, disable `pie` hardening, otherwise `recompile with -fPIE` errors appear.
+  # See:
+  # * https://github.com/NixOS/nixpkgs/issues/129247
+  # * https://gitlab.haskell.org/ghc/ghc/-/issues/19580
+  hardeningDisable = lib.optional stdenv.targetPlatform.isMusl "pie";
+
   doInstallCheck = true;
   installCheckPhase = ''
     unset ${libEnvVar}
@@ -180,5 +190,7 @@ stdenv.mkDerivation rec {
     license = lib.licenses.bsd3;
     platforms = ["x86_64-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
     hydraPlatforms = builtins.filter (p: p != "aarch64-linux") platforms;
+    # build segfaults, use ghc8102Binary which has proper musl support instead
+    broken = stdenv.hostPlatform.isMusl;
   };
 }