about summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc
diff options
context:
space:
mode:
authorJohn Ericson <subscribe@JohnEricson.me>2018-10-01 17:19:31 -0400
committerGitHub <noreply@github.com>2018-10-01 17:19:31 -0400
commita3d86b49b4c927f1dbb01083c04a6500defac4b3 (patch)
treed279ee28180349eec3f1dbd78ad700cfa08771ab /pkgs/development/compilers/ghc
parent358a1c8a28902da87ccfe49cec3b5f23bafa3d67 (diff)
parentb19113380f0de343e4b18ae06ef5fd64681caa55 (diff)
downloadnixlib-a3d86b49b4c927f1dbb01083c04a6500defac4b3.tar
nixlib-a3d86b49b4c927f1dbb01083c04a6500defac4b3.tar.gz
nixlib-a3d86b49b4c927f1dbb01083c04a6500defac4b3.tar.bz2
nixlib-a3d86b49b4c927f1dbb01083c04a6500defac4b3.tar.lz
nixlib-a3d86b49b4c927f1dbb01083c04a6500defac4b3.tar.xz
nixlib-a3d86b49b4c927f1dbb01083c04a6500defac4b3.tar.zst
nixlib-a3d86b49b4c927f1dbb01083c04a6500defac4b3.zip
Merge pull request #47626 from obsidiansystems/ghc-cross-fixes
ghc: Misc cross fixes
Diffstat (limited to 'pkgs/development/compilers/ghc')
-rw-r--r--pkgs/development/compilers/ghc/8.2.2.nix10
-rw-r--r--pkgs/development/compilers/ghc/head.nix13
2 files changed, 16 insertions, 7 deletions
diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix
index aac8cf4fd220..3b6035f5ef41 100644
--- a/pkgs/development/compilers/ghc/8.2.2.nix
+++ b/pkgs/development/compilers/ghc/8.2.2.nix
@@ -22,7 +22,7 @@
 
 , # Whether to build dynamic libs for the standard library (on the target
   # platform). Static libs are always built.
-  enableShared ? true
+  enableShared ? !stdenv.targetPlatform.useiOSPrebuilt
 
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
@@ -79,7 +79,7 @@ let
   targetCC = builtins.head toolsForTarget;
 
 in
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (rec {
   version = "8.2.2";
   name = "${targetPrefix}ghc-${version}";
 
@@ -239,4 +239,8 @@ stdenv.mkDerivation rec {
     inherit (ghc.meta) license platforms;
   };
 
-}
+} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
+  dontStrip = true;
+  dontPatchELF = true;
+  noAuditTmpdir = true;
+})
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 87045815a37f..6546959e0a24 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -32,6 +32,8 @@
   ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross"
 }:
 
+assert !enableIntegerSimple -> gmp != null;
+
 let
   inherit (stdenv) buildPlatform hostPlatform targetPlatform;
 
@@ -48,8 +50,7 @@ let
     include mk/flavours/\$(BuildFlavour).mk
     endif
     DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
-  '' + stdenv.lib.optionalString enableIntegerSimple ''
-    INTEGER_LIBRARY = integer-simple
+    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"}
     CrossCompilePrefix = ${targetPrefix}
@@ -77,7 +78,7 @@ let
   targetCC = builtins.head toolsForTarget;
 
 in
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (rec {
   inherit version;
   inherit (src) rev;
   name = "${targetPrefix}ghc-${version}";
@@ -206,4 +207,8 @@ stdenv.mkDerivation rec {
     inherit (ghc.meta) license platforms;
   };
 
-}
+} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
+  dontStrip = true;
+  dontPatchELF = true;
+  noAuditTmpdir = true;
+})