Commit Graph

5 Commits

Author SHA1 Message Date
John Ericson
4f97d78936
Merge pull request #126205 from sternenseemann/ghc-linker-checks
ghc: check for targetPlatform.linker to determine if gold is available
2021-06-08 16:42:13 -04:00
sternenseemann
036eef1d1e 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.
2021-06-08 22:17:24 +02:00
sternenseemann
118b28a127 haskell.compiler.*: pull in unwrapped bintools for darwin
GHC calls otool on darwin which is contained in the
stdenv.cc.bintools.bintools derivation and thus needs adding to the
runtime PATH of GHC. Since this is toolchain specific technically, we
check for cctools instead of darwin (although I don't know if GHC
or nixpkgs work on macOS without cctools).

This fixes usage of GHC in an environment where otool is not available
and more specifically in stdenvNoCC which is used by writers.writeHaskell.
Resolves #123228.
2021-06-08 14:20:09 +02:00
oxalica
354d262db8
lib.meta: introduce availableOn 2021-04-02 19:20:23 +08:00
(cdep)illabout
b0a16b29e2 haskell.compiler.ghc8104: add ghc-8.10.4 2021-02-12 20:35:21 +01:00