about summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2021-11-30 02:45:18 +0100
committersternenseemann <sternenseemann@systemli.org>2021-11-30 22:22:30 +0100
commitb2e47081059a37d6edbd7f1d89066cb7f640297e (patch)
tree00486f4581465e91b9b9fa82984553fe16f88e96 /pkgs/development/compilers/ghc
parentc402d95ba5919232f19f7f166bd52aa3e8344138 (diff)
haskell.compiler.ghc921: check if ld.gold is available in useLdGold
Since 4c75874560d114032e3d3ee0e6ffe9dd880a3859 it is possible to
introspect if ld.gold is contained in the used bintools, so we can also
check if it is available before deciding to use it as done in the other
GHC derivations in 0908812372ad7f983645530de1d32e1563adacd3.
Diffstat (limited to 'pkgs/development/compilers/ghc')
-rw-r--r--pkgs/development/compilers/ghc/9.2.1.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/development/compilers/ghc/9.2.1.nix b/pkgs/development/compilers/ghc/9.2.1.nix
index 20062358db507..16543ce49bcd4 100644
--- a/pkgs/development/compilers/ghc/9.2.1.nix
+++ b/pkgs/development/compilers/ghc/9.2.1.nix
@@ -129,7 +129,8 @@ let
   # 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.linker == "gold" || (targetPlatform.linker == "bfd" && !targetPlatform.isMusl);
+  useLdGold = targetPlatform.linker == "gold" ||
+    (targetPlatform.linker == "bfd" && (targetCC.bintools.bintools.hasGold or false) && !targetPlatform.isMusl);
 
   # Makes debugging easier to see which variant is at play in `nix-store -q --tree`.
   variantSuffix = lib.concatStrings [