@@ -125,13 +125,21 @@ stdenv.mkDerivation (rec {
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
127127 '' + stdenv.lib.optionalString targetPlatform.isMusl ''
128− echo "patching llvm-targets for musl targets...."
128+ echo "patching llvm-targets for musl targets..."
129129 echo "Cloning these existing '*-linux-gnu*' targets:"
130130 grep linux-gnu llvm-targets | sed 's/^/ /'
131− echo "go go gadget sed"
131+ echo "(go go gadget sed)"
132132 sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
133133 echo "llvm-targets now contains these '*-linux-musl*' targets:"
134134 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
135143 '';
136144
137145 # TODO(@Ericson2314): Always pass "--target" and always prefix.