From 8adcd395041665bad739f777e7b6284186a4c507 Mon Sep 17 00:00:00 2001 From: Niklas Hambüchen Date: Sun, 4 Jul 2021 21:59:24 +0000 Subject: ghc: Add comments about `hardeningDisable` `pie` for musl --- pkgs/development/compilers/ghc/8.10.4.nix | 11 ++++++++++- pkgs/development/compilers/ghc/8.8.4.nix | 11 ++++++++++- pkgs/development/compilers/ghc/9.0.1.nix | 11 ++++++++++- pkgs/development/compilers/ghc/head.nix | 11 ++++++++++- 4 files changed, 40 insertions(+), 4 deletions(-) (limited to 'pkgs/development/compilers') diff --git a/pkgs/development/compilers/ghc/8.10.4.nix b/pkgs/development/compilers/ghc/8.10.4.nix index f007dcf7898..8062062f42b 100644 --- a/pkgs/development/compilers/ghc/8.10.4.nix +++ b/pkgs/development/compilers/ghc/8.10.4.nix @@ -238,7 +238,16 @@ stdenv.mkDerivation (rec { checkTarget = "test"; - hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie"; + hardeningDisable = + [ "format" ] + # 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 + ++ lib.optional stdenv.targetPlatform.isMusl "pie"; postInstall = '' # Install the bash completion file. diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index c907928d5ef..1f643d53be4 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.nix @@ -248,7 +248,16 @@ stdenv.mkDerivation (rec { checkTarget = "test"; - hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie"; + hardeningDisable = + [ "format" ] + # 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 + ++ lib.optional stdenv.targetPlatform.isMusl "pie"; postInstall = '' # Install the bash completion file. diff --git a/pkgs/development/compilers/ghc/9.0.1.nix b/pkgs/development/compilers/ghc/9.0.1.nix index d7db4d66f74..f461fa6d440 100644 --- a/pkgs/development/compilers/ghc/9.0.1.nix +++ b/pkgs/development/compilers/ghc/9.0.1.nix @@ -225,7 +225,16 @@ stdenv.mkDerivation (rec { checkTarget = "test"; - hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie"; + hardeningDisable = + [ "format" ] + # 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 + ++ lib.optional stdenv.targetPlatform.isMusl "pie"; postInstall = '' # Install the bash completion file. diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index ec236731afd..18df8c538d7 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -242,7 +242,16 @@ stdenv.mkDerivation (rec { checkTarget = "test"; - hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie"; + hardeningDisable = + [ "format" ] + # 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 + ++ lib.optional stdenv.targetPlatform.isMusl "pie"; postInstall = '' # Install the bash completion file. -- cgit 1.4.1