This change only consolidates the logic for the source built GHCs which have used the same logic (at least as long as you'd only use the respective supported version ranges of the expressions as inputs).
15 lines
528 B
Nix
15 lines
528 B
Nix
# Determines whether the Native Code Generation (NCG) backend of the given
|
|
# GHC `version` is supported for compiling to `stdenv.targetPlatform`.
|
|
{
|
|
version,
|
|
stdenv,
|
|
lib,
|
|
}:
|
|
|
|
stdenv.targetPlatform.isx86
|
|
|| stdenv.targetPlatform.isPower
|
|
|| (lib.versionOlder version "9.4" && stdenv.targetPlatform.isSparc)
|
|
|| (lib.versionAtLeast version "9.2" && stdenv.targetPlatform.isAarch64)
|
|
|| (lib.versionAtLeast version "9.6" && stdenv.targetPlatform.isGhcjs)
|
|
|| (lib.versionAtLeast version "9.12" && stdenv.targetPlatform.isRiscV64)
|