aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix27
1 files changed, 21 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix b/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
index b199dc34fa3..e26eacca204 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
@@ -23,6 +23,9 @@
, # 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
@@ -52,19 +55,30 @@ 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"}
- '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
- Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
+ ''
+ # We only need to build stage1 on most cross-compilation because
+ # we will be running the compiler on the native system. In some
+ # situations, like native Musl compilation, we need the compiler
+ # to actually link to our new Libc. The iOS simulator is a special
+ # exception because we can’t actually run simulators binaries
+ # ourselves.
+ + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+ 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
@@ -122,7 +136,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
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
@@ -235,8 +249,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;
})