summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-07-10 13:05:28 -0500
committerWill Dietz <w@wdtz.org>2018-07-10 19:08:56 -0500
commit773ae700b75174bb11146e5f588a22c4c54b73af (patch)
tree5e0440ad7bef283b05ef19a0a5c31fe4ef539713 /pkgs
parent894f313e3c654e62eb6d23fe0eb81760f10127ff (diff)
downloadnixlib-773ae700b75174bb11146e5f588a22c4c54b73af.tar
nixlib-773ae700b75174bb11146e5f588a22c4c54b73af.tar.gz
nixlib-773ae700b75174bb11146e5f588a22c4c54b73af.tar.bz2
nixlib-773ae700b75174bb11146e5f588a22c4c54b73af.tar.lz
nixlib-773ae700b75174bb11146e5f588a22c4c54b73af.tar.xz
nixlib-773ae700b75174bb11146e5f588a22c4c54b73af.tar.zst
nixlib-773ae700b75174bb11146e5f588a22c4c54b73af.zip
ghc{843,861}: keep '-musleabi' in targets like w/'-gnueabi'
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/ghc/8.4.3.nix12
-rw-r--r--pkgs/development/compilers/ghc/8.6.1.nix12
2 files changed, 20 insertions, 4 deletions
diff --git a/pkgs/development/compilers/ghc/8.4.3.nix b/pkgs/development/compilers/ghc/8.4.3.nix
index 853926a430a8..12e01a159a21 100644
--- a/pkgs/development/compilers/ghc/8.4.3.nix
+++ b/pkgs/development/compilers/ghc/8.4.3.nix
@@ -125,13 +125,21 @@ stdenv.mkDerivation (rec {
   '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
   '' + stdenv.lib.optionalString targetPlatform.isMusl ''
-      echo "patching llvm-targets for musl targets...."
+      echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
-      echo "go go gadget sed"
+      echo "(go go gadget sed)"
       sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
       echo "llvm-targets now contains these '*-linux-musl*' targets:"
       grep linux-musl llvm-targets | sed 's/^/  /'
+
+      echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
+      # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
+      for x in configure aclocal.m4; do
+        substituteInPlace $x \
+          --replace '*-android*|*-gnueabi*)' \
+                    '*-android*|*-gnueabi*|*-musleabi*)'
+      done
   '';
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
diff --git a/pkgs/development/compilers/ghc/8.6.1.nix b/pkgs/development/compilers/ghc/8.6.1.nix
index 1fd53f2544a1..9627e87f8bde 100644
--- a/pkgs/development/compilers/ghc/8.6.1.nix
+++ b/pkgs/development/compilers/ghc/8.6.1.nix
@@ -117,13 +117,21 @@ stdenv.mkDerivation (rec {
   '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
   '' + stdenv.lib.optionalString targetPlatform.isMusl ''
-      echo "patching llvm-targets for musl targets...."
+      echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
-      echo "go go gadget sed"
+      echo "(go go gadget sed)"
       sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
       echo "llvm-targets now contains these '*-linux-musl*' targets:"
       grep linux-musl llvm-targets | sed 's/^/  /'
+
+      echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
+      # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
+      for x in configure aclocal.m4; do
+        substituteInPlace $x \
+          --replace '*-android*|*-gnueabi*)' \
+                    '*-android*|*-gnueabi*|*-musleabi*)'
+      done
   '';
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.