summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc/8.10.4.nix
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-06-08 14:17:38 +0200
committersternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-06-08 22:17:24 +0200
commit036eef1d1e5d902486ca6a3f7c48f0a31e3c053c (patch)
tree1d81eeee5b9791d85becd40870a5d3127d188bbf /pkgs/development/compilers/ghc/8.10.4.nix
parent13c72a9a82a96751c185c653208cb13fa84f53bc (diff)
downloadnixpkgs-036eef1d1e5d902486ca6a3f7c48f0a31e3c053c.tar
nixpkgs-036eef1d1e5d902486ca6a3f7c48f0a31e3c053c.tar.gz
nixpkgs-036eef1d1e5d902486ca6a3f7c48f0a31e3c053c.tar.bz2
nixpkgs-036eef1d1e5d902486ca6a3f7c48f0a31e3c053c.tar.lz
nixpkgs-036eef1d1e5d902486ca6a3f7c48f0a31e3c053c.tar.xz
nixpkgs-036eef1d1e5d902486ca6a3f7c48f0a31e3c053c.tar.zst
nixpkgs-036eef1d1e5d902486ca6a3f7c48f0a31e3c053c.zip
haskell.compiler.*: use gold based on targetPlatform.linker
useLdGold previously just checked for useLLVM which (currently) implies
`linker == "lld"`. However more accurate is to check the `linker` of the
`targetPlatform` as it actually tells us which bintools package we can
expect.

`linker == "bfd"` implies that we are using the `binutils` package, so
gold is available, so we can use it unless musl is the libc. `linker ==
"gold"` implies that gold is the default linker already and we should
absolutely use it.
Diffstat (limited to 'pkgs/development/compilers/ghc/8.10.4.nix')
-rw-r--r--pkgs/development/compilers/ghc/8.10.4.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/development/compilers/ghc/8.10.4.nix b/pkgs/development/compilers/ghc/8.10.4.nix
index da957f93520..6787e8e591b 100644
--- a/pkgs/development/compilers/ghc/8.10.4.nix
+++ b/pkgs/development/compilers/ghc/8.10.4.nix
@@ -89,9 +89,10 @@ let
 
   targetCC = builtins.head toolsForTarget;
 
-  # ld.gold is disabled for musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856
+  # Use gold either following the default, or to avoid the BFD linker due to some bugs / perf issues.
+  # But we cannot avoid BFD when using musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856
   # see #84670 and #49071 for more background.
-  useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl;
+  useLdGold = targetPlatform.linker == "gold" || (targetPlatform.linker == "bfd" && !targetPlatform.isMusl);
 
 in
 stdenv.mkDerivation (rec {