This patch comes from the musl-cross project at
https://bitbucket.org/GregorR/musl-cross/src. Compared to the upstream version:
* the config.sub modifications have been removed, because Buildroot
already overwrites all config.sub with a more recent config.sub
* change to ensure that a dummy dynamic linker path
MUSL_DYNAMIC_LINKER<foo> is defined for all architectures,
otherwise building gcc for architectures not supported by musl was
causing build failure. Bug reported upstream at
https://bitbucket.org/GregorR/musl-gcc-patches/issue/4/musl-gcc-patches-break-the-build-on.
* change the USE_PT_GNU_EH_FRAME logic to keep the existing gcc logic
and only add the musl one as an addition, not as a replacement. Not
doing this breaks C++ exception handling with glibc, because
USE_PT_GNU_EH_FRAME doesn't get defined due to the configure script
not testing dl_iterate_phdr() on any system except Solaris.
[Gustavo: remove upstream applied gcc/config/sh/sh.c chunk for 4.9.1]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/fixincludes/mkfixinc.sh
===================================================================
--- a/fixincludes/mkfixinc.sh
+++ b/fixincludes/mkfixinc.sh
# IF there is no include fixing,
# THEN create a no-op fixer and exit
(echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
===================================================================
-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
# 32-bit x86 processors supported by --with-arch=. Each processor
# MUST be separated by exactly one space.
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"