Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/8.10.7-binary.nix
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ let
ghcBinDists.${distSetName}.${stdenv.hostPlatform.system}
or (throw "cannot bootstrap GHC on this platform ('${stdenv.hostPlatform.system}' with libc '${distSetName}')");

useLLVM = !stdenv.targetPlatform.isx86;
useLLVM = !(import ./common-have-ncg.nix { inherit lib stdenv version; });

libPath = lib.makeLibraryPath (
# Add arch-specific libraries.
Expand Down
9 changes: 6 additions & 3 deletions pkgs/development/compilers/ghc/8.10.7.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
let
version = "8.10.7";
in

{
lib,
stdenv,
Expand Down Expand Up @@ -32,8 +36,7 @@
libffi ? null,
libffi_3_3 ? null,

useLLVM ?
!(stdenv.targetPlatform.isx86 || stdenv.targetPlatform.isPower || stdenv.targetPlatform.isSparc),
useLLVM ? !(import ./common-have-ncg.nix { inherit lib stdenv version; }),
# LLVM is conceptually a run-time-only dependency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too.
Expand Down Expand Up @@ -271,7 +274,7 @@ in

stdenv.mkDerivation (
rec {
version = "8.10.7";
inherit version;
pname = "${targetPrefix}ghc${variantSuffix}";

src = fetchurl {
Expand Down
7 changes: 1 addition & 6 deletions pkgs/development/compilers/ghc/9.2.4-binary.nix
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,7 @@ let
) binDistUsed.archSpecificLibraries
)).nixPackage;

# GHC has other native backends (like PowerPC), but here only the ones
# we ship bindists for matter.
useLLVM =
!(
stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin)
);
useLLVM = !(import ./common-have-ncg.nix { inherit lib stdenv version; });

libPath = lib.makeLibraryPath (
# Add arch-specific libraries.
Expand Down
7 changes: 1 addition & 6 deletions pkgs/development/compilers/ghc/9.6.3-binary.nix
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,7 @@ let
) binDistUsed.archSpecificLibraries
)).nixPackage;

# GHC has other native backends (like PowerPC), but here only the ones
# we ship bindists for matter.
useLLVM =
!(
stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isAarch64 && stdenv.targetPlatform.isDarwin)
);
useLLVM = !(import ./common-have-ncg.nix { inherit lib stdenv version; });

libPath = lib.makeLibraryPath (
# Add arch-specific libraries.
Expand Down
6 changes: 1 addition & 5 deletions pkgs/development/compilers/ghc/common-hadrian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@
, # GHC can be built with system libffi or a bundled one.
libffi ? null

, useLLVM ? !(stdenv.targetPlatform.isx86
|| stdenv.targetPlatform.isPower
|| stdenv.targetPlatform.isAarch64
|| stdenv.targetPlatform.isGhcjs
|| (lib.versionAtLeast version "9.12" && stdenv.targetPlatform.isRiscV64))
, useLLVM ? !(import ./common-have-ncg.nix { inherit lib stdenv version; })
, # LLVM is conceptually a run-time-only dependency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too.
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/compilers/ghc/common-have-ncg.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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)
9 changes: 2 additions & 7 deletions pkgs/development/compilers/ghc/common-make-native-bignum.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,8 @@
# GHC can be built with system libffi or a bundled one.
libffi ? null,

useLLVM ?
!(
stdenv.targetPlatform.isx86
|| stdenv.targetPlatform.isPower
|| (lib.versionOlder version "9.4" && stdenv.targetPlatform.isSparc)
|| (lib.versionAtLeast version "9.2" && stdenv.targetPlatform.isAarch64)
),
useLLVM ? !(import ./common-have-ncg.nix { inherit lib stdenv version; }),

# LLVM is conceptually a run-time-only dependency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too.
Expand Down