about summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2018-05-22 17:48:29 +0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2018-05-22 17:48:29 +0300
commitf9feacfc7c389bacb937e24d7cccfe013271efaa (patch)
tree264c2e15652058f1f1dc16fa4739d453c533ba58 /pkgs/development/compilers/ghc
parentdb4d77779c9b52a35c5a4306d36e2727cba1b162 (diff)
parentc8a4562f5966e90cbbe04195b4a37a5d4a334f60 (diff)
downloadnixlib-f9feacfc7c389bacb937e24d7cccfe013271efaa.tar
nixlib-f9feacfc7c389bacb937e24d7cccfe013271efaa.tar.gz
nixlib-f9feacfc7c389bacb937e24d7cccfe013271efaa.tar.bz2
nixlib-f9feacfc7c389bacb937e24d7cccfe013271efaa.tar.lz
nixlib-f9feacfc7c389bacb937e24d7cccfe013271efaa.tar.xz
nixlib-f9feacfc7c389bacb937e24d7cccfe013271efaa.tar.zst
nixlib-f9feacfc7c389bacb937e24d7cccfe013271efaa.zip
Merge remote-tracking branch 'upstream/master' into staging
Diffstat (limited to 'pkgs/development/compilers/ghc')
-rw-r--r--pkgs/development/compilers/ghc/8.0.2.nix3
-rw-r--r--pkgs/development/compilers/ghc/8.2.2.nix3
-rw-r--r--pkgs/development/compilers/ghc/8.4.2.nix3
-rw-r--r--pkgs/development/compilers/ghc/backport-dylib-command-size-limit.patch24
4 files changed, 30 insertions, 3 deletions
diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix
index f52af4d96cc3..4e9e5a30b0d5 100644
--- a/pkgs/development/compilers/ghc/8.0.2.nix
+++ b/pkgs/development/compilers/ghc/8.0.2.nix
@@ -91,7 +91,8 @@ stdenv.mkDerivation rec {
       extraPrefix = "libraries/Cabal/";
     })
   ] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
-    ++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch;
+    ++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch
+    ++ stdenv.lib.optional stdenv.isDarwin ./backport-dylib-command-size-limit.patch;
 
   postPatch = "patchShebangs .";
 
diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix
index f52bd4a505e9..0d4e5d8ee670 100644
--- a/pkgs/development/compilers/ghc/8.2.2.nix
+++ b/pkgs/development/compilers/ghc/8.2.2.nix
@@ -99,7 +99,8 @@ stdenv.mkDerivation rec {
     (fetchpatch { # Backport of https://phabricator.haskell.org/D4388 for more determinism
       url = "https://github.com/shlevy/ghc/commit/fec1b8d3555c447c0d8da0e96b659be67c8bb4bc.patch";
       sha256 = "1lyysz6hfd1njcigpm8xppbnkadqfs0kvrp7s8vqgb38pjswj5hg";
-    });
+    })
+    ++ stdenv.lib.optional stdenv.isDarwin ./backport-dylib-command-size-limit.patch;
 
   postPatch = "patchShebangs .";
 
diff --git a/pkgs/development/compilers/ghc/8.4.2.nix b/pkgs/development/compilers/ghc/8.4.2.nix
index 7ac7a85fb7d9..1733c9b56683 100644
--- a/pkgs/development/compilers/ghc/8.4.2.nix
+++ b/pkgs/development/compilers/ghc/8.4.2.nix
@@ -94,7 +94,8 @@ stdenv.mkDerivation rec {
     sha256 = "0plzsbfaq6vb1023lsarrjglwgr9chld4q3m99rcfzx0yx5mibp3";
     extraPrefix = "utils/hsc2hs/";
     stripLen = 1;
-  })];
+  })]
+    ++ stdenv.lib.optional stdenv.isDarwin ./backport-dylib-command-size-limit.patch;
 
   postPatch = "patchShebangs .";
 
diff --git a/pkgs/development/compilers/ghc/backport-dylib-command-size-limit.patch b/pkgs/development/compilers/ghc/backport-dylib-command-size-limit.patch
new file mode 100644
index 000000000000..d0d94717d9c4
--- /dev/null
+++ b/pkgs/development/compilers/ghc/backport-dylib-command-size-limit.patch
@@ -0,0 +1,24 @@
+diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
+index acd0d61..3e83c15 100644
+--- a/compiler/main/DriverPipeline.hs
++++ b/compiler/main/DriverPipeline.hs
+@@ -1916,6 +1916,7 @@ linkBinary' staticLink dflags o_files dep_packages = do
+                       ++ pkg_framework_opts
+                       ++ debug_opts
+                       ++ thread_opts
++                      ++ (if (platformOS platform `elem` [OSDarwin]) then [ "-Wl,-dead_strip_dylibs" ] else [])
+                     ))
+ 
+ exeFileName :: Bool -> DynFlags -> FilePath
+diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
+index 1ab5b13..2ebbf51 100644
+--- a/compiler/main/SysTools.hs
++++ b/compiler/main/SysTools.hs
+@@ -1737,6 +1737,7 @@ linkDynLib dflags0 o_files dep_packages
+                  ++ map Option pkg_lib_path_opts
+                  ++ map Option pkg_link_opts
+                  ++ map Option pkg_framework_opts
++                 ++ [ Option "-Wl,-dead_strip_dylibs" ]
+               )
+         OSiOS -> throwGhcExceptionIO (ProgramError "dynamic libraries are not supported on iOS target")
+         _ -> do