ghcWithPackages: list missing targets with NCG available

Based on https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms, although
it sadly doesn't list when the backends were introduced.

* PowerPC, x86 (and x86_64) and Sparc have been supported for longer.

* aarch64-darwin is new in 9.2.1 and backported to 8.10.5, 8.10.6 and
  8.10.7 (check is dumb here since we'll grep for 8.10.7 anyways when
  upgrading)

Fixes ghcWithPackages failing to evaluate on aarch64-darwin because of
missing support for the platform in LLVM 9's compiler-rt.
This commit is contained in:
sternenseemann 2021-11-18 16:27:24 +01:00
parent cfdc073da4
commit 571f3e504b

View File

@ -1,5 +1,14 @@
{ lib, stdenv, ghc, llvmPackages, packages, symlinkJoin, makeWrapper
, withLLVM ? !(stdenv.targetPlatform.isx86_64 || stdenv.targetPlatform.isPowerPC)
# Include LLVM by default if GHC doesn't have native code generation support
# See https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms
, withLLVM ? !(lib.any lib.id ([
stdenv.targetPlatform.isx86
stdenv.targetPlatform.isPowerPC
stdenv.targetPlatform.isSparc
] ++ lib.optionals (lib.versionAtLeast ghc.version "9.2" || ghc.version == "8.10.7") [
(stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin)
# TODO(@sternenseemann): Is armv7a supported for iOS?
]))
, postBuild ? ""
, ghcLibdir ? null # only used by ghcjs, when resolving plugins
}: