From 62d5cb4c615bfce1ec997e8ad67352594fc1c077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Sun, 4 Jul 2021 21:44:23 +0000 Subject: [PATCH] haskell.compiler.ghc865Binary: Disable "pie" hardening. See #129247 While this does not fix `ghc865Binary` with musl, it at least prevents that the other, newer errors are shadowed (see #129247). --- pkgs/development/compilers/ghc/8.6.5-binary.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/compilers/ghc/8.6.5-binary.nix b/pkgs/development/compilers/ghc/8.6.5-binary.nix index 8a0994b8b6a54..42b60ec32312b 100644 --- a/pkgs/development/compilers/ghc/8.6.5-binary.nix +++ b/pkgs/development/compilers/ghc/8.6.5-binary.nix @@ -152,6 +152,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}