gcc6: try patching MUSL_DYNAMIC_LINKER as well

This commit is contained in:
Will Dietz 2018-01-04 16:20:45 -06:00
parent ece06deee4
commit 5eea9e82f4
3 changed files with 12 additions and 7 deletions

View File

@ -258,13 +258,14 @@ stdenv.mkDerivation ({
let let
libc = if libcCross != null then libcCross else stdenv.cc.libc; libc = if libcCross != null then libcCross else stdenv.cc.libc;
in in
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..." '' echo "fixing the \`GLIBC_DYNAMIC_LINKER', \`UCLIBC_DYNAMIC_LINKER', and \`MUSL_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
do do
grep -q LIBC_DYNAMIC_LINKER "$header" || continue grep -q LIBC_DYNAMIC_LINKER "$header" || continue
echo " fixing \`$header'..." echo " fixing \`$header'..."
sed -i "$header" \ sed -i "$header" \
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' \
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done done
'' ''
else null; else null;
@ -396,6 +397,7 @@ stdenv.mkDerivation ({
# On Illumos/Solaris GNU as is preferred # On Illumos/Solaris GNU as is preferred
"--with-gnu-as" "--without-gnu-ld" "--with-gnu-as" "--without-gnu-ld"
] ]
++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
; ;
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;

View File

@ -260,13 +260,14 @@ stdenv.mkDerivation ({
let let
libc = if libcCross != null then libcCross else stdenv.cc.libc; libc = if libcCross != null then libcCross else stdenv.cc.libc;
in in
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..." '' echo "fixing the \`GLIBC_DYNAMIC_LINKER', \`UCLIBC_DYNAMIC_LINKER', and \`MUSL_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
do do
grep -q LIBC_DYNAMIC_LINKER "$header" || continue grep -q _DYNAMIC_LINKER "$header" || continue
echo " fixing \`$header'..." echo " fixing \`$header'..."
sed -i "$header" \ sed -i "$header" \
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' \
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done done
'' ''
else null; else null;

View File

@ -254,13 +254,14 @@ stdenv.mkDerivation ({
let let
libc = if libcCross != null then libcCross else stdenv.cc.libc; libc = if libcCross != null then libcCross else stdenv.cc.libc;
in in
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..." '' echo "fixing the \`GLIBC_DYNAMIC_LINKER', \`UCLIBC_DYNAMIC_LINKER', and \`MUSL_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
do do
grep -q LIBC_DYNAMIC_LINKER "$header" || continue grep -q LIBC_DYNAMIC_LINKER "$header" || continue
echo " fixing \`$header'..." echo " fixing \`$header'..."
sed -i "$header" \ sed -i "$header" \
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' \
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done done
'' ''
else null; else null;
@ -392,6 +393,7 @@ stdenv.mkDerivation ({
# On Illumos/Solaris GNU as is preferred # On Illumos/Solaris GNU as is preferred
"--with-gnu-as" "--without-gnu-ld" "--with-gnu-as" "--without-gnu-ld"
] ]
++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
; ;
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;