|
|
|
@ -14,12 +14,11 @@ https://bitbucket.org/GregorR/musl-cross/src. Compared to the upstream version:
|
|
|
|
|
https://bitbucket.org/GregorR/musl-gcc-patches/issue/4/musl-gcc-patches-break-the-build-on.
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
---
|
|
|
|
|
[Gustavo: Update for gcc 4.8.3]
|
|
|
|
|
|
|
|
|
|
Index: b/fixincludes/mkfixinc.sh
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/fixincludes/mkfixinc.sh
|
|
|
|
|
+++ b/fixincludes/mkfixinc.sh
|
|
|
|
|
diff -Nura gcc-4.8.3/fixincludes/mkfixinc.sh gcc-4.8.3-musl/fixincludes/mkfixinc.sh
|
|
|
|
|
--- gcc-4.8.3/fixincludes/mkfixinc.sh 2012-10-28 18:42:48.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/fixincludes/mkfixinc.sh 2014-05-22 15:07:17.966799753 -0300
|
|
|
|
|
@@ -19,7 +19,8 @@
|
|
|
|
|
powerpc-*-eabi* | \
|
|
|
|
|
powerpc-*-rtems* | \
|
|
|
|
@ -30,44 +29,9 @@ Index: 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}
|
|
|
|
|
Index: b/gcc/config.gcc
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config.gcc
|
|
|
|
|
+++ b/gcc/config.gcc
|
|
|
|
|
@@ -550,7 +550,7 @@
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
# Common C libraries.
|
|
|
|
|
-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"
|
|
|
|
|
|
|
|
|
|
# Common parts for widely ported systems.
|
|
|
|
|
case ${target} in
|
|
|
|
|
@@ -653,6 +653,9 @@
|
|
|
|
|
*-*-*uclibc*)
|
|
|
|
|
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
|
|
|
|
|
;;
|
|
|
|
|
+ *-*-*musl*)
|
|
|
|
|
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
|
|
|
|
|
+ ;;
|
|
|
|
|
*)
|
|
|
|
|
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
|
|
|
|
|
;;
|
|
|
|
|
@@ -2114,6 +2117,10 @@
|
|
|
|
|
powerpc*-*-linux*paired*)
|
|
|
|
|
tm_file="${tm_file} rs6000/750cl.h" ;;
|
|
|
|
|
esac
|
|
|
|
|
+ case ${target} in
|
|
|
|
|
+ *-linux*-musl*)
|
|
|
|
|
+ enable_secureplt=yes ;;
|
|
|
|
|
+ esac
|
|
|
|
|
if test x${enable_secureplt} = xyes; then
|
|
|
|
|
tm_file="rs6000/secureplt.h ${tm_file}"
|
|
|
|
|
fi
|
|
|
|
|
Index: b/gcc/config/aarch64/aarch64-linux.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/aarch64/aarch64-linux.h
|
|
|
|
|
+++ b/gcc/config/aarch64/aarch64-linux.h
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/aarch64/aarch64-linux.h gcc-4.8.3-musl/gcc/config/aarch64/aarch64-linux.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/aarch64/aarch64-linux.h 2013-08-13 10:22:18.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/aarch64/aarch64-linux.h 2014-05-22 15:07:17.967799807 -0300
|
|
|
|
|
@@ -21,7 +21,12 @@
|
|
|
|
|
#ifndef GCC_AARCH64_LINUX_H
|
|
|
|
|
#define GCC_AARCH64_LINUX_H
|
|
|
|
@ -81,10 +45,9 @@ Index: b/gcc/config/aarch64/aarch64-linux.h
|
|
|
|
|
|
|
|
|
|
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
|
|
|
|
|
|
|
|
|
|
Index: b/gcc/config/arm/linux-eabi.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/arm/linux-eabi.h
|
|
|
|
|
+++ b/gcc/config/arm/linux-eabi.h
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/arm/linux-eabi.h gcc-4.8.3-musl/gcc/config/arm/linux-eabi.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/arm/linux-eabi.h 2013-01-10 17:38:27.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/arm/linux-eabi.h 2014-05-22 15:07:17.968799848 -0300
|
|
|
|
|
@@ -77,6 +77,23 @@
|
|
|
|
|
%{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
|
|
|
|
|
%{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
|
|
|
|
@ -109,20 +72,9 @@ Index: b/gcc/config/arm/linux-eabi.h
|
|
|
|
|
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
|
|
|
|
|
use the GNU/Linux version, not the generic BPABI version. */
|
|
|
|
|
#undef LINK_SPEC
|
|
|
|
|
Index: b/gcc/config/i386/linux.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/i386/linux.h
|
|
|
|
|
+++ b/gcc/config/i386/linux.h
|
|
|
|
|
@@ -21,3 +21,5 @@
|
|
|
|
|
|
|
|
|
|
#define GNU_USER_LINK_EMULATION "elf_i386"
|
|
|
|
|
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
|
|
|
|
+#undef MUSL_DYNAMIC_LINKER
|
|
|
|
|
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
|
|
|
|
|
Index: b/gcc/config/i386/linux64.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/i386/linux64.h
|
|
|
|
|
+++ b/gcc/config/i386/linux64.h
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/i386/linux64.h gcc-4.8.3-musl/gcc/config/i386/linux64.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/i386/linux64.h 2013-01-10 17:38:27.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/i386/linux64.h 2014-05-22 15:07:17.968799848 -0300
|
|
|
|
|
@@ -30,3 +30,10 @@
|
|
|
|
|
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
|
|
|
|
|
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
|
|
|
|
@ -134,10 +86,18 @@ Index: b/gcc/config/i386/linux64.h
|
|
|
|
|
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
|
|
|
|
|
+#undef MUSL_DYNAMIC_LINKERX32
|
|
|
|
|
+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
|
|
|
|
|
Index: b/gcc/config/linux.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/linux.h
|
|
|
|
|
+++ b/gcc/config/linux.h
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/i386/linux.h gcc-4.8.3-musl/gcc/config/i386/linux.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/i386/linux.h 2013-01-10 17:38:27.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/i386/linux.h 2014-05-22 15:07:17.968799848 -0300
|
|
|
|
|
@@ -21,3 +21,5 @@
|
|
|
|
|
|
|
|
|
|
#define GNU_USER_LINK_EMULATION "elf_i386"
|
|
|
|
|
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
|
|
|
|
+#undef MUSL_DYNAMIC_LINKER
|
|
|
|
|
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/linux.h gcc-4.8.3-musl/gcc/config/linux.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/linux.h 2013-01-10 17:38:27.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/linux.h 2014-05-22 15:07:17.968799848 -0300
|
|
|
|
|
@@ -32,10 +32,12 @@
|
|
|
|
|
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
|
|
|
|
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
|
|
|
@ -294,10 +254,9 @@ Index: b/gcc/config/linux.h
|
|
|
|
|
+ { 0, 0, 0, 0, 0, 0 } \
|
|
|
|
|
+ }
|
|
|
|
|
+#endif
|
|
|
|
|
Index: b/gcc/config/linux.opt
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/linux.opt
|
|
|
|
|
+++ b/gcc/config/linux.opt
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/linux.opt gcc-4.8.3-musl/gcc/config/linux.opt
|
|
|
|
|
--- gcc-4.8.3/gcc/config/linux.opt 2013-01-10 17:38:27.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/linux.opt 2014-05-22 15:07:17.969799879 -0300
|
|
|
|
|
@@ -30,3 +30,7 @@
|
|
|
|
|
muclibc
|
|
|
|
|
Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
|
|
|
|
@ -306,10 +265,9 @@ Index: b/gcc/config/linux.opt
|
|
|
|
|
+mmusl
|
|
|
|
|
+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
|
|
|
|
|
+Use musl C library
|
|
|
|
|
Index: b/gcc/config/microblaze/linux.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/microblaze/linux.h
|
|
|
|
|
+++ b/gcc/config/microblaze/linux.h
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/microblaze/linux.h gcc-4.8.3-musl/gcc/config/microblaze/linux.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/microblaze/linux.h 2013-03-14 12:43:23.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/microblaze/linux.h 2014-05-22 15:07:17.969799879 -0300
|
|
|
|
|
@@ -25,7 +25,23 @@
|
|
|
|
|
#undef TLS_NEEDS_GOT
|
|
|
|
|
#define TLS_NEEDS_GOT 1
|
|
|
|
@ -335,27 +293,18 @@ Index: b/gcc/config/microblaze/linux.h
|
|
|
|
|
#undef SUBTARGET_EXTRA_SPECS
|
|
|
|
|
#define SUBTARGET_EXTRA_SPECS \
|
|
|
|
|
{ "dynamic_linker", DYNAMIC_LINKER }
|
|
|
|
|
Index: b/gcc/config/microblaze/microblaze.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/microblaze/microblaze.h
|
|
|
|
|
+++ b/gcc/config/microblaze/microblaze.h
|
|
|
|
|
@@ -213,6 +213,12 @@
|
|
|
|
|
#define STRICT_ALIGNMENT 1
|
|
|
|
|
#define PCC_BITFIELD_TYPE_MATTERS 1
|
|
|
|
|
|
|
|
|
|
+#undef SIZE_TYPE
|
|
|
|
|
+#define SIZE_TYPE "unsigned int"
|
|
|
|
|
+
|
|
|
|
|
+#undef PTRDIFF_TYPE
|
|
|
|
|
+#define PTRDIFF_TYPE "int"
|
|
|
|
|
+
|
|
|
|
|
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
|
|
|
|
|
((TREE_CODE (EXP) == STRING_CST || TREE_CODE (EXP) == CONSTRUCTOR) \
|
|
|
|
|
&& (ALIGN) < BITS_PER_WORD \
|
|
|
|
|
Index: b/gcc/config/mips/linux.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/mips/linux.h
|
|
|
|
|
+++ b/gcc/config/mips/linux.h
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/mips/linux64.h gcc-4.8.3-musl/gcc/config/mips/linux64.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/mips/linux64.h 2013-01-10 17:38:27.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/mips/linux64.h 2014-05-22 15:07:52.473979031 -0300
|
|
|
|
|
@@ -29,4 +29,4 @@
|
|
|
|
|
#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
|
|
|
|
|
#define GNU_USER_DYNAMIC_LINKERN32 \
|
|
|
|
|
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
|
|
|
|
|
- BIONIC_DYNAMIC_LINKERN32)
|
|
|
|
|
+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKER)
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/mips/linux.h gcc-4.8.3-musl/gcc/config/mips/linux.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/mips/linux.h 2013-01-10 17:38:27.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/mips/linux.h 2014-05-22 15:07:52.455978418 -0300
|
|
|
|
|
@@ -18,3 +18,11 @@
|
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
|
@ -368,12 +317,11 @@ Index: b/gcc/config/mips/linux.h
|
|
|
|
|
+#endif
|
|
|
|
|
+#undef MUSL_DYNAMIC_LINKER
|
|
|
|
|
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
|
|
|
|
|
Index: b/gcc/config/rs6000/linux64.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/rs6000/linux64.h
|
|
|
|
|
+++ b/gcc/config/rs6000/linux64.h
|
|
|
|
|
@@ -354,17 +354,23 @@
|
|
|
|
|
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/rs6000/linux64.h gcc-4.8.3-musl/gcc/config/rs6000/linux64.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/rs6000/linux64.h 2014-04-04 12:10:24.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/rs6000/linux64.h 2014-05-22 15:07:52.455978418 -0300
|
|
|
|
|
@@ -374,17 +374,23 @@
|
|
|
|
|
#endif
|
|
|
|
|
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
|
|
|
|
|
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
|
|
|
|
|
+#undef MUSL_DYNAMIC_LINKER32
|
|
|
|
@ -400,20 +348,18 @@ Index: b/gcc/config/rs6000/linux64.h
|
|
|
|
|
|
|
|
|
|
#undef DEFAULT_ASM_ENDIAN
|
|
|
|
|
#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
|
|
|
|
|
Index: b/gcc/config/rs6000/secureplt.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/rs6000/secureplt.h
|
|
|
|
|
+++ b/gcc/config/rs6000/secureplt.h
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/rs6000/secureplt.h gcc-4.8.3-musl/gcc/config/rs6000/secureplt.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/rs6000/secureplt.h 2013-01-10 17:38:27.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/rs6000/secureplt.h 2014-05-22 15:07:52.455978418 -0300
|
|
|
|
|
@@ -18,3 +18,4 @@
|
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
|
|
#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
|
|
|
|
|
+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
|
|
|
|
|
Index: b/gcc/config/rs6000/sysv4.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/rs6000/sysv4.h
|
|
|
|
|
+++ b/gcc/config/rs6000/sysv4.h
|
|
|
|
|
@@ -550,6 +550,9 @@
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/rs6000/sysv4.h gcc-4.8.3-musl/gcc/config/rs6000/sysv4.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/rs6000/sysv4.h 2014-04-04 11:50:31.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/rs6000/sysv4.h 2014-05-22 15:07:52.456978446 -0300
|
|
|
|
|
@@ -537,6 +537,9 @@
|
|
|
|
|
#ifndef CC1_SECURE_PLT_DEFAULT_SPEC
|
|
|
|
|
#define CC1_SECURE_PLT_DEFAULT_SPEC ""
|
|
|
|
|
#endif
|
|
|
|
@ -421,9 +367,9 @@ Index: b/gcc/config/rs6000/sysv4.h
|
|
|
|
|
+#define LINK_SECURE_PLT_DEFAULT_SPEC ""
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
/* Pass -G xxx to the compiler and set correct endian mode. */
|
|
|
|
|
/* Pass -G xxx to the compiler. */
|
|
|
|
|
#define CC1_SPEC "%{G*} %(cc1_cpu)" \
|
|
|
|
|
@@ -600,7 +603,8 @@
|
|
|
|
|
@@ -585,7 +588,8 @@
|
|
|
|
|
|
|
|
|
|
/* Override the default target of the linker. */
|
|
|
|
|
#define LINK_TARGET_SPEC \
|
|
|
|
@ -433,7 +379,7 @@ Index: b/gcc/config/rs6000/sysv4.h
|
|
|
|
|
|
|
|
|
|
/* Any specific OS flags. */
|
|
|
|
|
#define LINK_OS_SPEC "\
|
|
|
|
|
@@ -778,15 +782,18 @@
|
|
|
|
|
@@ -763,15 +767,18 @@
|
|
|
|
|
|
|
|
|
|
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
|
|
|
|
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
|
|
|
|
@ -455,18 +401,17 @@ Index: b/gcc/config/rs6000/sysv4.h
|
|
|
|
|
|
|
|
|
|
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
|
|
|
|
|
%{rdynamic:-export-dynamic} \
|
|
|
|
|
@@ -912,6 +919,7 @@
|
|
|
|
|
{ "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
|
|
|
|
|
{ "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \
|
|
|
|
|
@@ -894,6 +901,7 @@
|
|
|
|
|
{ "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
|
|
|
|
|
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
|
|
|
|
|
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
|
|
|
|
|
+ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
|
|
|
|
|
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \
|
|
|
|
|
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
|
|
|
|
|
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
|
|
|
|
|
Index: b/gcc/config/sh/linux.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/sh/linux.h
|
|
|
|
|
+++ b/gcc/config/sh/linux.h
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config/sh/linux.h gcc-4.8.3-musl/gcc/config/sh/linux.h
|
|
|
|
|
--- gcc-4.8.3/gcc/config/sh/linux.h 2013-03-14 00:01:53.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config/sh/linux.h 2014-05-22 15:07:52.456978446 -0300
|
|
|
|
|
@@ -43,7 +43,15 @@
|
|
|
|
|
|
|
|
|
|
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
|
|
|
|
@ -483,45 +428,43 @@ Index: b/gcc/config/sh/linux.h
|
|
|
|
|
|
|
|
|
|
#undef SUBTARGET_LINK_EMUL_SUFFIX
|
|
|
|
|
#define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
|
|
|
|
|
Index: b/gcc/config/sh/sh.c
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/sh/sh.c
|
|
|
|
|
+++ b/gcc/config/sh/sh.c
|
|
|
|
|
@@ -22,8 +22,17 @@
|
|
|
|
|
/* FIXME: This is a temporary hack, so that we can include <algorithm>
|
|
|
|
|
below. <algorithm> will try to include <cstdlib> which will reference
|
|
|
|
|
malloc & co, which are poisoned by "system.h". The proper solution is
|
|
|
|
|
- to include <cstdlib> in "system.h" instead of <stdlib.h>. */
|
|
|
|
|
+ to include <cstdlib> in "system.h" instead of <stdlib.h>.
|
|
|
|
|
+ It's also a temporary hack as the inclusion of sstream will cause inclusion
|
|
|
|
|
+ of libc's pthread.h (istream->ios->ios_base->atomicity->gth->gthr-default)
|
|
|
|
|
+ which in turn includes sched.h, which defines the CPU_ALLOC, which uses
|
|
|
|
|
+ the poisoned calloc. the proper fix would be to shield the poison pragmas
|
|
|
|
|
+ with some define that is only set when gcc developers do testing.
|
|
|
|
|
+*/
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
+#include <sstream>
|
|
|
|
|
+#include <vector>
|
|
|
|
|
+#include <algorithm>
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/config.gcc gcc-4.8.3-musl/gcc/config.gcc
|
|
|
|
|
--- gcc-4.8.3/gcc/config.gcc 2014-05-06 12:29:04.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/config.gcc 2014-05-22 15:07:17.967799807 -0300
|
|
|
|
|
@@ -550,7 +550,7 @@
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
#include "system.h"
|
|
|
|
|
@@ -60,10 +69,6 @@
|
|
|
|
|
#include "tm-constrs.h"
|
|
|
|
|
#include "opts.h"
|
|
|
|
|
# Common C libraries.
|
|
|
|
|
-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"
|
|
|
|
|
|
|
|
|
|
-#include <sstream>
|
|
|
|
|
-#include <vector>
|
|
|
|
|
-#include <algorithm>
|
|
|
|
|
-
|
|
|
|
|
int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch;
|
|
|
|
|
|
|
|
|
|
#define MSW (TARGET_LITTLE_ENDIAN ? 1 : 0)
|
|
|
|
|
Index: b/gcc/configure
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/configure
|
|
|
|
|
+++ b/gcc/configure
|
|
|
|
|
@@ -26739,6 +26739,9 @@
|
|
|
|
|
# Common parts for widely ported systems.
|
|
|
|
|
case ${target} in
|
|
|
|
|
@@ -653,6 +653,9 @@
|
|
|
|
|
*-*-*uclibc*)
|
|
|
|
|
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
|
|
|
|
|
;;
|
|
|
|
|
+ *-*-*musl*)
|
|
|
|
|
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
|
|
|
|
|
+ ;;
|
|
|
|
|
*)
|
|
|
|
|
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
|
|
|
|
|
;;
|
|
|
|
|
@@ -2135,6 +2138,10 @@
|
|
|
|
|
powerpc*-*-linux*paired*)
|
|
|
|
|
tm_file="${tm_file} rs6000/750cl.h" ;;
|
|
|
|
|
esac
|
|
|
|
|
+ case ${target} in
|
|
|
|
|
+ *-linux*-musl*)
|
|
|
|
|
+ enable_secureplt=yes ;;
|
|
|
|
|
+ esac
|
|
|
|
|
if test x${enable_secureplt} = xyes; then
|
|
|
|
|
tm_file="rs6000/secureplt.h ${tm_file}"
|
|
|
|
|
fi
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/configure gcc-4.8.3-musl/gcc/configure
|
|
|
|
|
--- gcc-4.8.3/gcc/configure 2014-04-28 07:05:29.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/configure 2014-05-22 15:07:52.469978896 -0300
|
|
|
|
|
@@ -26821,6 +26821,9 @@
|
|
|
|
|
else
|
|
|
|
|
gcc_cv_libc_provides_ssp=no
|
|
|
|
|
case "$target" in
|
|
|
|
@ -531,7 +474,7 @@ Index: b/gcc/configure
|
|
|
|
|
*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
|
|
|
|
|
# glibc 2.4 and later provides __stack_chk_fail and
|
|
|
|
|
# either __stack_chk_guard, or TLS access to stack guard canary.
|
|
|
|
|
@@ -26772,6 +26775,7 @@
|
|
|
|
|
@@ -26854,6 +26857,7 @@
|
|
|
|
|
# <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
|
|
|
|
|
# simply assert that glibc does provide this, which is true for all
|
|
|
|
|
# realistically usable GNU/Hurd configurations.
|
|
|
|
@ -539,7 +482,7 @@ Index: b/gcc/configure
|
|
|
|
|
gcc_cv_libc_provides_ssp=yes;;
|
|
|
|
|
*-*-darwin* | *-*-freebsd*)
|
|
|
|
|
ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
|
|
|
|
|
@@ -26854,6 +26858,9 @@
|
|
|
|
|
@@ -26936,6 +26940,9 @@
|
|
|
|
|
gcc_cv_target_dl_iterate_phdr=no
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
@ -549,11 +492,10 @@ Index: b/gcc/configure
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
|
|
|
|
|
Index: b/gcc/configure.ac
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/configure.ac
|
|
|
|
|
+++ b/gcc/configure.ac
|
|
|
|
|
@@ -4722,6 +4722,9 @@
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/configure.ac gcc-4.8.3-musl/gcc/configure.ac
|
|
|
|
|
--- gcc-4.8.3/gcc/configure.ac 2014-04-28 07:05:29.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/configure.ac 2014-05-22 15:07:52.471978964 -0300
|
|
|
|
|
@@ -4750,6 +4750,9 @@
|
|
|
|
|
gcc_cv_libc_provides_ssp,
|
|
|
|
|
[gcc_cv_libc_provides_ssp=no
|
|
|
|
|
case "$target" in
|
|
|
|
@ -563,7 +505,7 @@ Index: b/gcc/configure.ac
|
|
|
|
|
*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
|
|
|
|
|
[# glibc 2.4 and later provides __stack_chk_fail and
|
|
|
|
|
# either __stack_chk_guard, or TLS access to stack guard canary.
|
|
|
|
|
@@ -4755,6 +4758,7 @@
|
|
|
|
|
@@ -4783,6 +4786,7 @@
|
|
|
|
|
# <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
|
|
|
|
|
# simply assert that glibc does provide this, which is true for all
|
|
|
|
|
# realistically usable GNU/Hurd configurations.
|
|
|
|
@ -571,7 +513,7 @@ Index: b/gcc/configure.ac
|
|
|
|
|
gcc_cv_libc_provides_ssp=yes;;
|
|
|
|
|
*-*-darwin* | *-*-freebsd*)
|
|
|
|
|
AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
|
|
|
|
|
@@ -4820,6 +4824,9 @@
|
|
|
|
|
@@ -4848,6 +4852,9 @@
|
|
|
|
|
gcc_cv_target_dl_iterate_phdr=no
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
@ -581,10 +523,9 @@ Index: b/gcc/configure.ac
|
|
|
|
|
esac
|
|
|
|
|
GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
|
|
|
|
|
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
|
|
|
|
|
Index: b/gcc/ginclude/stddef.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/ginclude/stddef.h
|
|
|
|
|
+++ b/gcc/ginclude/stddef.h
|
|
|
|
|
diff -Nura gcc-4.8.3/gcc/ginclude/stddef.h gcc-4.8.3-musl/gcc/ginclude/stddef.h
|
|
|
|
|
--- gcc-4.8.3/gcc/ginclude/stddef.h 2013-01-10 17:38:27.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/gcc/ginclude/stddef.h 2014-05-22 15:07:52.472978998 -0300
|
|
|
|
|
@@ -181,6 +181,7 @@
|
|
|
|
|
#ifndef _GCC_SIZE_T
|
|
|
|
|
#ifndef _SIZET_
|
|
|
|
@ -609,10 +550,9 @@ Index: b/gcc/ginclude/stddef.h
|
|
|
|
|
#endif /* __size_t */
|
|
|
|
|
#endif /* _SIZET_ */
|
|
|
|
|
#endif /* _GCC_SIZE_T */
|
|
|
|
|
Index: b/libgcc/unwind-dw2-fde-dip.c
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/libgcc/unwind-dw2-fde-dip.c
|
|
|
|
|
+++ b/libgcc/unwind-dw2-fde-dip.c
|
|
|
|
|
diff -Nura gcc-4.8.3/libgcc/unwind-dw2-fde-dip.c gcc-4.8.3-musl/libgcc/unwind-dw2-fde-dip.c
|
|
|
|
|
--- gcc-4.8.3/libgcc/unwind-dw2-fde-dip.c 2013-02-04 16:06:20.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/libgcc/unwind-dw2-fde-dip.c 2014-05-22 15:07:52.472978998 -0300
|
|
|
|
|
@@ -46,33 +46,13 @@
|
|
|
|
|
#include "unwind-compat.h"
|
|
|
|
|
#include "gthr.h"
|
|
|
|
@ -653,10 +593,9 @@ Index: b/libgcc/unwind-dw2-fde-dip.c
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(USE_PT_GNU_EH_FRAME)
|
|
|
|
|
Index: b/libgomp/config/posix/time.c
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/libgomp/config/posix/time.c
|
|
|
|
|
+++ b/libgomp/config/posix/time.c
|
|
|
|
|
diff -Nura gcc-4.8.3/libgomp/config/posix/time.c gcc-4.8.3-musl/libgomp/config/posix/time.c
|
|
|
|
|
--- gcc-4.8.3/libgomp/config/posix/time.c 2013-01-14 15:18:49.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/libgomp/config/posix/time.c 2014-05-22 15:07:52.472978998 -0300
|
|
|
|
|
@@ -28,6 +28,8 @@
|
|
|
|
|
The following implementation uses the most simple POSIX routines.
|
|
|
|
|
If present, POSIX 4 clocks should be used instead. */
|
|
|
|
@ -666,10 +605,9 @@ Index: b/libgomp/config/posix/time.c
|
|
|
|
|
#include "libgomp.h"
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#if TIME_WITH_SYS_TIME
|
|
|
|
|
Index: b/libitm/config/arm/hwcap.cc
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/libitm/config/arm/hwcap.cc
|
|
|
|
|
+++ b/libitm/config/arm/hwcap.cc
|
|
|
|
|
diff -Nura gcc-4.8.3/libitm/config/arm/hwcap.cc gcc-4.8.3-musl/libitm/config/arm/hwcap.cc
|
|
|
|
|
--- gcc-4.8.3/libitm/config/arm/hwcap.cc 2013-02-03 14:46:11.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/libitm/config/arm/hwcap.cc 2014-05-22 15:07:52.473979031 -0300
|
|
|
|
|
@@ -40,7 +40,11 @@
|
|
|
|
|
|
|
|
|
|
#ifdef __linux__
|
|
|
|
@ -682,10 +620,9 @@ Index: b/libitm/config/arm/hwcap.cc
|
|
|
|
|
#include <elf.h>
|
|
|
|
|
|
|
|
|
|
static void __attribute__((constructor))
|
|
|
|
|
Index: b/libitm/config/linux/x86/tls.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/libitm/config/linux/x86/tls.h
|
|
|
|
|
+++ b/libitm/config/linux/x86/tls.h
|
|
|
|
|
diff -Nura gcc-4.8.3/libitm/config/linux/x86/tls.h gcc-4.8.3-musl/libitm/config/linux/x86/tls.h
|
|
|
|
|
--- gcc-4.8.3/libitm/config/linux/x86/tls.h 2013-02-03 14:46:11.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/libitm/config/linux/x86/tls.h 2014-05-22 15:07:52.473979031 -0300
|
|
|
|
|
@@ -25,16 +25,19 @@
|
|
|
|
|
#ifndef LIBITM_X86_TLS_H
|
|
|
|
|
#define LIBITM_X86_TLS_H 1
|
|
|
|
@ -715,10 +652,9 @@ Index: b/libitm/config/linux/x86/tls.h
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
#endif // LIBITM_X86_TLS_H
|
|
|
|
|
Index: b/libstdc++-v3/configure.host
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/libstdc++-v3/configure.host
|
|
|
|
|
+++ b/libstdc++-v3/configure.host
|
|
|
|
|
diff -Nura gcc-4.8.3/libstdc++-v3/configure.host gcc-4.8.3-musl/libstdc++-v3/configure.host
|
|
|
|
|
--- gcc-4.8.3/libstdc++-v3/configure.host 2013-06-18 22:18:38.000000000 -0300
|
|
|
|
|
+++ gcc-4.8.3-musl/libstdc++-v3/configure.host 2014-05-22 15:07:52.473979031 -0300
|
|
|
|
|
@@ -264,6 +264,13 @@
|
|
|
|
|
os_include_dir="os/bsd/freebsd"
|
|
|
|
|
;;
|
|
|
|
@ -743,13 +679,3 @@ Index: b/libstdc++-v3/configure.host
|
|
|
|
|
hpux*)
|
|
|
|
|
os_include_dir="os/hpux"
|
|
|
|
|
;;
|
|
|
|
|
Index: b/gcc/config/mips/linux64.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- a/gcc/config/mips/linux64.h
|
|
|
|
|
+++ b/gcc/config/mips/linux64.h
|
|
|
|
|
@@ -29,4 +29,4 @@
|
|
|
|
|
#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
|
|
|
|
|
#define GNU_USER_DYNAMIC_LINKERN32 \
|
|
|
|
|
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
|
|
|
|
|
- BIONIC_DYNAMIC_LINKERN32)
|
|
|
|
|
+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKER)
|