ghc{843,861}: clone linux-gnu targets so musl variants are available

Fixes build with "muslpi" (armv6l-unknown-linux-musleabihf).

This was done via patch at first but it wouldn't apply to both at once,
and it's probably best to stick to just having musl clones for now
(instead of patching 8.6.1 targets into 8.4.3 and hoping that's okay).
This commit is contained in:
Will Dietz 2018-07-10 11:50:44 -05:00
parent c5f9cd4cde
commit 894f313e3c
2 changed files with 16 additions and 0 deletions

View file

@ -124,6 +124,14 @@ stdenv.mkDerivation (rec {
export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + 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 "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /'
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/^/ /'
'';
# TODO(@Ericson2314): Always pass "--target" and always prefix.

View file

@ -116,6 +116,14 @@ stdenv.mkDerivation (rec {
export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + 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 "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /'
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/^/ /'
'';
# TODO(@Ericson2314): Always pass "--target" and always prefix.