on iko/ghcjs-patch-master help sign in
Fix windows cross compile issues with C++ code (#1100)

This fixes issues when using packages like `double-conversion` in TH code.

commit5758f1c8b43652afb810fdcdb07729792495ef96 authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateFri 30 Apr 2021, 09:33 (6 years ago) parent66f90fc
3 files changed+22−1
overlays/bootstrap.nix+1 overlays/patches/ghc/ghc-8.10-z-drive-fix.patch+14 overlays/windows.nix+7−1
overlays/bootstrap.nix+1
@@ -157,6 +157,7 @@ in {
157157 ++ final.lib.optional (versionAtLeast "8.6.4") ./patches/ghc/Cabal-3886.patch
158158
159159 ++ fromUntil "8.10.3" "8.10.5" ./patches/ghc/ghc-8.10.3-rts-make-markLiveObject-thread-safe.patch
160+ ++ final.lib.optional (versionAtLeast "8.10.4" && final.targetPlatform.isWindows) ./patches/ghc/ghc-8.10-z-drive-fix.patch
160161 ;
161162 in ({
162163 ghc844 = final.callPackage ../compiler/ghc {
overlays/patches/ghc/ghc-8.10-z-drive-fix.patchnew file+14
@@ -0,0 +1,14 @@
1+diff --git a/libraries/libiserv/src/Remote/Slave.hs b/libraries/libiserv/src/Remote/Slave.hs
2+index 577161f35f..3a4dbbf842 100644
3+--- a/libraries/libiserv/src/Remote/Slave.hs
4++++ b/libraries/libiserv/src/Remote/Slave.hs
5+@@ -128,6 +128,8 @@ hook verbose base_path pipe m = case m of
6+ -- system libraries.
7+ Msg (LoadDLL path@('C':':':_)) -> do
8+ return m
9++ Msg (LoadDLL path@('Z':':':_)) -> do
10++ return m
11+ Msg (LoadDLL path) | isAbsolute path -> do
12+ when verbose $ trace ("Need DLL: " ++ (base_path <//> path))
13+ handleLoad pipe path (base_path <//> path)
14+
overlays/windows.nix+7−1
@@ -73,11 +73,17 @@ final: prev:
7373 # dependencies) and then placing them somewhere where wine+remote-iserv
7474 # will find them.
7575 remote-iserv.postInstall = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isWindows (
76− let extra-libs = [ pkgs.openssl.bin pkgs.libffi pkgs.gmp pkgs.libsodium ]; in ''
76+ let extra-libs = [ pkgs.openssl.bin pkgs.libffi pkgs.gmp pkgs.libsodium pkgs.windows.mcfgthreads pkgs.buildPackages.gcc.cc ]; in ''
7777 for p in ${lib.concatStringsSep " "extra-libs}; do
7878 find "$p" -iname '*.dll' -exec cp {} $out/bin/ \;
7979 find "$p" -iname '*.dll.a' -exec cp {} $out/bin/ \;
8080 done
81+ (
82+ cd $out/bin
83+ for l in lib*.dll; do
84+ ln -s "$l" "''${l#lib}"
85+ done
86+ )
8187 '');
8288
8389 # Apply https://github.com/haskell/cabal/pull/6055