aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/compilers/ghc/head.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/ghc/head.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/head.nix38
1 files changed, 23 insertions, 15 deletions
diff --git a/nixpkgs/pkgs/development/compilers/ghc/head.nix b/nixpkgs/pkgs/development/compilers/ghc/head.nix
index a15ef7f7dbf..6f9f577743f 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/head.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/head.nix
@@ -20,14 +20,17 @@
# build-time dependency too.
buildLlvmPackages, llvmPackages
-, # If enabled, GHC will be built with the GPL-free but slower integer-simple
- # library instead of the faster but GPLed integer-gmp library.
- enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms)
+, # If enabled, GHC will be built with the GPL-free but slightly slower native
+ # bignum backend instead of the faster but GPLed gmp backend.
+ enableNativeBignum ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms)
, gmp
, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
+ # aarch64 outputs otherwise exceed 2GB limit
+, enableProfiledLibs ? !stdenv.targetPlatform.isAarch64
+
, # Whether to build dynamic libs for the standard library (on the target
# platform). Static libs are always built.
enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
@@ -35,7 +38,7 @@
, # Whether to build terminfo.
enableTerminfo ? !stdenv.targetPlatform.isWindows
-, version ? "8.11.20200505"
+, version ? "8.11.20200824"
, # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
@@ -46,7 +49,7 @@
disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64
}:
-assert !enableIntegerSimple -> gmp != null;
+assert !enableNativeBignum -> gmp != null;
let
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
@@ -58,19 +61,23 @@ let
(targetPlatform != hostPlatform)
"${targetPlatform.config}-";
- buildMK = ''
+ buildMK = dontStrip: ''
BuildFlavour = ${ghcFlavour}
ifneq \"\$(BuildFlavour)\" \"\"
include mk/flavours/\$(BuildFlavour).mk
endif
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
- INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
+ BIGNUM_BACKEND = ${if enableNativeBignum then "native" else "gmp"}
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
- Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
+ Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO
+ '' + stdenv.lib.optionalString dontStrip ''
+ STRIP_CMD = :
+ '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+ GhcLibWays = "v dyn"
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC
@@ -81,7 +88,7 @@ let
# Splicer will pull out correct variations
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
++ [libffi]
- ++ stdenv.lib.optional (!enableIntegerSimple) gmp
+ ++ stdenv.lib.optional (!enableNativeBignum) gmp
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv
++ stdenv.lib.optional enableDwarf elfutils;
@@ -103,8 +110,8 @@ stdenv.mkDerivation (rec {
src = fetchgit {
url = "https://gitlab.haskell.org/ghc/ghc.git/";
- rev = "40c71c2cf38b4e134d81b7184a4d5e02949ae70c";
- sha256 = "04h9rcyzm9w3an1z00hjs062dp7dl19b8pkyxjsypr7a2i9dmvkb";
+ rev = "3f50154591ada9064351ccec4adfe6df53ca2439";
+ sha256 = "1w2p5bc74aswspzvgvrhcb95hvj5ky38rgqqjvrri19z2qyiky6d";
};
enableParallelBuilding = true;
@@ -132,7 +139,7 @@ stdenv.mkDerivation (rec {
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
- echo -n "${buildMK}" > mk/build.mk
+ echo -n "${buildMK dontStrip}" > mk/build.mk
echo ${version} > VERSION
echo ${src.rev} > GIT_COMMIT_ID
./boot
@@ -173,7 +180,7 @@ stdenv.mkDerivation (rec {
"--with-system-libffi"
"--with-ffi-includes=${targetPackages.libffi.dev}/include"
"--with-ffi-libraries=${targetPackages.libffi.out}/lib"
- ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+ ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
"--with-gmp-includes=${targetPackages.gmp.dev}/include"
"--with-gmp-libraries=${targetPackages.gmp.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
@@ -251,8 +258,9 @@ stdenv.mkDerivation (rec {
inherit (ghc.meta) license platforms;
};
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
- dontStrip = true;
+ dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
+
+} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
dontPatchELF = true;
noAuditTmpdir = true;
})