git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #43306 from dtzWill/fix/ghc-musl-targets

ghc{843,861}: add musl variants of "llvm-targets"

commitbe0a056fcb9789c5be5c97b92f42378be0abcb07 authorWill Dietz <github@wdtz.org> dateWed 11 Jul 2018, 09:38 (8 years ago) parent5f59d13773ae70
2 files changed+32
pkgs/development/compilers/ghc/8.4.3.nix+16 pkgs/development/compilers/ghc/8.6.1.nix+16
pkgs/development/compilers/ghc/8.4.3.nix+16
@@ -124,6 +124,22 @@ stdenv.mkDerivation (rec {
124124 export NIX_LDFLAGS+=" -no_dtrace_dof"
125125 '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
126126 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
127+ '' + stdenv.lib.optionalString targetPlatform.isMusl ''
128+ echo "patching llvm-targets for musl targets..."
129+ echo "Cloning these existing '*-linux-gnu*' targets:"
130+ grep linux-gnu llvm-targets | sed 's/^/ /'
131+ echo "(go go gadget sed)"
132+ sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
133+ echo "llvm-targets now contains these '*-linux-musl*' targets:"
134+ grep linux-musl llvm-targets | sed 's/^/ /'
135+
136+ echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
137+ # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
138+ for x in configure aclocal.m4; do
139+ substituteInPlace $x \
140+ --replace '*-android*|*-gnueabi*)' \
141+ '*-android*|*-gnueabi*|*-musleabi*)'
142+ done
127143 '';
128144
129145 # TODO(@Ericson2314): Always pass "--target" and always prefix.
pkgs/development/compilers/ghc/8.6.1.nix+16
@@ -116,6 +116,22 @@ stdenv.mkDerivation (rec {
116116 export NIX_LDFLAGS+=" -no_dtrace_dof"
117117 '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
118118 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
119+ '' + stdenv.lib.optionalString targetPlatform.isMusl ''
120+ echo "patching llvm-targets for musl targets..."
121+ echo "Cloning these existing '*-linux-gnu*' targets:"
122+ grep linux-gnu llvm-targets | sed 's/^/ /'
123+ echo "(go go gadget sed)"
124+ sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
125+ echo "llvm-targets now contains these '*-linux-musl*' targets:"
126+ grep linux-musl llvm-targets | sed 's/^/ /'
127+
128+ echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
129+ # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
130+ for x in configure aclocal.m4; do
131+ substituteInPlace $x \
132+ --replace '*-android*|*-gnueabi*)' \
133+ '*-android*|*-gnueabi*|*-musleabi*)'
134+ done
119135 '';
120136
121137 # TODO(@Ericson2314): Always pass "--target" and always prefix.