diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-09-25 04:11:13 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-09-25 04:22:53 +0000 |
commit | a82bb8c62a5cbece8238be92eac4037cd5f490e0 (patch) | |
tree | 62b80b941985ffe0d0c39d74905db3dcad488b9a /main | |
parent | ff8fb9916ea590f68fda1a6903f319ab4b5ca6e4 (diff) | |
download | aports-a82bb8c62a5cbece8238be92eac4037cd5f490e0.tar.bz2 aports-a82bb8c62a5cbece8238be92eac4037cd5f490e0.tar.xz |
main/gcc: unbreak libgcc on uclibc, update musl patches
- refresh all musl patches (gcc_cv_libc_provides_ssp detects now)
- add patch to fix the musl patch so that on uclibc we also use
gcc_cv_target_dl_iterate_phdr since the sources was changed to
use this instead of __GLIBC__ defines
Diffstat (limited to 'main')
-rw-r--r-- | main/gcc/APKBUILD | 13 | ||||
-rw-r--r-- | main/gcc/gcc-4.8-musl-fix-iteratephdr.patch | 22 | ||||
-rw-r--r-- | main/gcc/gcc-4.8-musl.patch | 468 |
3 files changed, 268 insertions, 235 deletions
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD index 788350b3e..864a66cde 100644 --- a/main/gcc/APKBUILD +++ b/main/gcc/APKBUILD @@ -12,7 +12,7 @@ _cross="" && _cross="-$CTARGET" pkgname="$pkgname$_cross" -pkgrel=4 +pkgrel=5 pkgdesc="The GNU Compiler Collection" url="http://gcc.gnu.org" arch="all" @@ -165,6 +165,7 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2 gcc-4.6-pr32219.patch gcc-4.8-dynamic-linker.patch gcc-4.8-musl.patch + gcc-4.8-musl-fix-iteratephdr.patch gcc-4.8-musl-libssp.patch boehm-gc-uclibc.patch boehm-gc-musl.patch @@ -272,7 +273,6 @@ build() { # alpine musl provides libssp_nonshared.a, so we don't need libssp either _libc_configure="--disable-libssp --disable-libmudflap --disable-libsanitizer" _symvers="--disable-symvers" - export gcc_cv_libc_provides_ssp=yes export libat_cv_have_ifunc=no ;; uclibc) @@ -652,7 +652,8 @@ ab83248e10b2bf4b3d9240de0fefb52b pt_gnu_eh_frame.patch 6cc2385c5bbd6d0da6eaedd53c8bf547 uclibc-getipinfo.patch 32e8e4c0e23ed8f5de95a591cb30f1da gcc-4.6-pr32219.patch 79d00ee1284fac5192456f7f7d3908aa gcc-4.8-dynamic-linker.patch -c45de4791c63d42731dc4c36a84b6717 gcc-4.8-musl.patch +ae660a0cb265b3115cde8f7efb41f7cc gcc-4.8-musl.patch +6e5c32243a86ff35b7b47d18c95b31bd gcc-4.8-musl-fix-iteratephdr.patch 60de2c9f78f00b8b0ba5d24fb44ea592 gcc-4.8-musl-libssp.patch 2c6cb49bb9bfd8b6e690222e66ccc901 boehm-gc-uclibc.patch ea2749b1337a5d850a8f463071cc4747 boehm-gc-musl.patch @@ -686,7 +687,8 @@ da6bbb5dc654d5e1df8ecae5c9ebb56265426c405931f14f5878248b8c79f78d 51_all_libiber 53184f842477569973c232dac7c85e71b0018cbe5c4962f95dd9e0273f42083e uclibc-getipinfo.patch 89207a8b62137a857ee2c43499d6b5247d37b530d1338844dbb330a6846b2ad2 gcc-4.6-pr32219.patch f3863b997acf8fdf5ad1d3626b41a8a0670b896505e9b7afb517916c7599fb1c gcc-4.8-dynamic-linker.patch -d3e3c305d5da95703f53d615f901912ada9395e3ccf3670435d28d5409dfa956 gcc-4.8-musl.patch +847075eb79c94e062ab8fb566f3bbea007875e2fde6fe2ddf51a18e731796a67 gcc-4.8-musl.patch +151c11c3303233e6ff06e27aa6dc889140bc46a7b5e4870587c40e37d36ede2c gcc-4.8-musl-fix-iteratephdr.patch ce0168ce009d77ce5831cb71739675cad6d68283b6e57fa8f2e559d65502022d gcc-4.8-musl-libssp.patch 02751ccf223dcfc898c0ce2214cd0859d275e90b742f1a66e38db5c50f94b38c boehm-gc-uclibc.patch 6adcddbc9d52b4e39878155bc7ff0114c322e0f05c0c82dff8c06c7278313f73 boehm-gc-musl.patch @@ -720,7 +722,8 @@ d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2 e3edf75df1f27af8771bd263e1bd607f6207c4eb5b2a5e11032577deba43ea201825e3b5008a720105f24e49d2821dd77a61c7ceba7ed91b3621c0dbd9292fc6 uclibc-getipinfo.patch 9fc5e32f2573ae67b6cf22119d636d10a47c42718635bceff7d457a93a3f664ae1ed10e154f70964ba2d26b0de04f879a8c05de6411112760d40433373dd0a80 gcc-4.6-pr32219.patch db84b6582950378116723116be4f277881f7bdd05add216c58c2b86c0fb3a70abeb7798507a74a64b9b949d5b311167bd4df84a048d2d2d32f5836ea1d34c42e gcc-4.8-dynamic-linker.patch -42b05a87f8785d3dc4ba6c5cd8d1e7b5fb119aef9cb59523ac695b8c7c910edc7d428ea4f2f1080e1f53f990a8d6070d3f0025cc02b4418f230493b7672c94d6 gcc-4.8-musl.patch +12871b62d31a8e524547f2f0b37e711bae027aaadc487d893f8dc4cef2c2fee09f5c558cd7e1d28e0c687bc3be0465d1088c5ef7b87e8ac43ac06d86dc455761 gcc-4.8-musl.patch +b5b0210dfaccfe0b06f0a9090666b1fae2a3faa4140b7930146b29531f0da9beb1f2c1f7e7bc2bd29179f9fe05dc30e246e96220b8ff75a90f75e8350c9058a1 gcc-4.8-musl-fix-iteratephdr.patch 701c79ea7b90e622facb16fc71902aec25c443e376d675fc3f07cd55eff7a6b95ca365b2c60fff1dad3c3dc02b96c4c2ebbb45e4d2895496137e060443ae3e79 gcc-4.8-musl-libssp.patch e1d6a450dfb40b134ad7f759c4c10174d2490b0093fe47cb33479245f26a3a8c54ebcf6255943c0ccfcb5095600d1c05e530baeed35609c8ffe75caac8e57c49 boehm-gc-uclibc.patch 7db904f83546edb4f7e54d3eaa0a8ab3235bca69e03a35000f083d26626bff92713f73150935c89f51e47c952bf29c36ec7d2fc8fedcde38048975e3e590faf9 boehm-gc-musl.patch diff --git a/main/gcc/gcc-4.8-musl-fix-iteratephdr.patch b/main/gcc/gcc-4.8-musl-fix-iteratephdr.patch new file mode 100644 index 000000000..b06597ec7 --- /dev/null +++ b/main/gcc/gcc-4.8-musl-fix-iteratephdr.patch @@ -0,0 +1,22 @@ +--- gcc-4.8.1/gcc/configure.ac.orig 2013-09-25 04:08:25.046595893 +0000 ++++ gcc-4.8.1/gcc/configure.ac 2013-09-25 04:09:06.023263205 +0000 +@@ -4822,7 +4822,7 @@ + gcc_cv_target_dl_iterate_phdr=no + fi + ;; +- *-linux-musl*) ++ *-linux-musl* | *-linux-uclibc* | *-linux-gnu*) + gcc_cv_target_dl_iterate_phdr=yes + ;; + esac +--- gcc-4.8.1/gcc/configure.orig 2013-09-25 04:08:17.826596392 +0000 ++++ gcc-4.8.1/gcc/configure 2013-09-25 04:09:24.393263387 +0000 +@@ -26923,7 +26923,7 @@ + gcc_cv_target_dl_iterate_phdr=no + fi + ;; +- *-linux-musl*) ++ *-linux-musl* | *-linux-uclibc* | *-linux-gnu*) + gcc_cv_target_dl_iterate_phdr=yes + ;; + esac diff --git a/main/gcc/gcc-4.8-musl.patch b/main/gcc/gcc-4.8-musl.patch index 26f89eb68..2d0934ea0 100644 --- a/main/gcc/gcc-4.8-musl.patch +++ b/main/gcc/gcc-4.8-musl.patch @@ -1,117 +1,34 @@ ---- a/gcc/config/aarch64/aarch64-linux.h 2013-01-10 21:38:27.000000000 +0100 -+++ b/gcc/config/aarch64/aarch64-linux.h 2013-09-12 21:39:34.004829498 +0200 -@@ -21,7 +21,11 @@ - #ifndef GCC_AARCH64_LINUX_H - #define GCC_AARCH64_LINUX_H - -+/* The AArch64 port currently supports two dynamic linkers: -+ - ld-linux-aarch64.so.1 - GLIBC dynamic linker -+ - ld-musl-aarch64.so.1 - musl libc dynamic linker */ - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64.so.1" -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64.so.1" - - #define LINUX_TARGET_LINK_SPEC "%{h*} \ - %{static:-Bstatic} \ # HG changeset patch -# Parent c3eb69047e35491fda9cd9ab1ee2ace1299c793c -Support for arm-linux-musl. +# Parent f50bb54f331f73405131a30b4f353cfda1c70304 +Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one. -diff -r c3eb69047e35 gcc/config/arm/linux-eabi.h ---- a/gcc/config/arm/linux-eabi.h Thu Sep 19 07:11:38 2013 -0400 -+++ b/gcc/config/arm/linux-eabi.h Thu Sep 19 08:56:47 2013 -0400 -@@ -77,6 +77,23 @@ - %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ - %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" - -+/* For ARM musl currently supports four dynamic linkers: -+ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI -+ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI -+ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB -+ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB -+ musl does not support the legacy OABI mode. -+ All the dynamic linkers live in /lib. -+ We default to soft-float, EL. */ -+#undef MUSL_DYNAMIC_LINKER -+#if TARGET_BIG_ENDIAN_DEFAULT -+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}" -+#else -+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" -+#endif -+#define MUSL_DYNAMIC_LINKER \ -+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" +diff -r f50bb54f331f libstdc++-v3/configure.host +--- a/libstdc++-v3/configure.host Fri Mar 29 16:38:52 2013 -0400 ++++ b/libstdc++-v3/configure.host Fri Mar 29 16:41:10 2013 -0400 +@@ -264,6 +264,13 @@ + os_include_dir="os/bsd/freebsd" + ;; + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) ++ # check for musl by target ++ case "${host_os}" in ++ *-musl*) ++ os_include_dir="os/generic" ++ ;; ++ *) + - /* 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 -diff -r c3eb69047e35 libitm/config/arm/hwcap.cc ---- a/libitm/config/arm/hwcap.cc Thu Sep 19 07:11:38 2013 -0400 -+++ b/libitm/config/arm/hwcap.cc Thu Sep 19 08:56:47 2013 -0400 -@@ -40,7 +40,11 @@ - - #ifdef __linux__ - #include <unistd.h> -+#ifdef __GLIBC__ - #include <sys/fcntl.h> -+#else -+#include <fcntl.h> -+#endif - #include <elf.h> - - static void __attribute__((constructor)) -diff -r ef9a64dbe461 gcc/configure ---- a/gcc/configure Thu Sep 19 09:37:33 2013 -0400 -+++ b/gcc/configure Thu Sep 19 09:40:09 2013 -0400 -@@ -26764,11 +26764,12 @@ - gcc_cv_libc_provides_ssp=yes - fi - ;; -- *-*-gnu*) -+ *-*-gnu* | *-*-musl*) - # Avoid complicated tests (see - # <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. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" -@@ -26851,6 +26852,9 @@ - gcc_cv_target_dl_iterate_phdr=no + if [ "$uclibc" = "yes" ]; then + os_include_dir="os/uclibc" + elif [ "$bionic" = "yes" ]; then +@@ -272,6 +279,9 @@ + os_include_dir="os/gnu-linux" fi ;; -+ *-linux-musl*) -+ gcc_cv_target_dl_iterate_phdr=yes ++ ++ esac + ;; - esac - - if test x$gcc_cv_target_dl_iterate_phdr = xyes; then -diff -r ef9a64dbe461 gcc/configure.ac ---- a/gcc/configure.ac Thu Sep 19 09:37:33 2013 -0400 -+++ b/gcc/configure.ac Thu Sep 19 09:40:09 2013 -0400 -@@ -4747,11 +4747,12 @@ - gcc_cv_libc_provides_ssp=yes - fi] - ;; -- *-*-gnu*) -+ *-*-gnu* | *-*-musl*) - # Avoid complicated tests (see - # <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. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], -@@ -4817,6 +4818,9 @@ - gcc_cv_target_dl_iterate_phdr=no - fi + hpux*) + os_include_dir="os/hpux" ;; -+ *-linux-musl*) -+ gcc_cv_target_dl_iterate_phdr=yes -+ ;; - esac - GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) - if test x$gcc_cv_target_dl_iterate_phdr = xyes; then # HG changeset patch # Parent 572f7b4d1c50cefde3aa2c43d06040fc308ad989 Adding -mmusl as a musl libc specifier, and the necessary hacks for it to know how to find musl's dynamic linker. @@ -340,6 +257,111 @@ diff -r 2b94537ce249 libgomp/config/posix/time.c #include "libgomp.h" #include <unistd.h> #if TIME_WITH_SYS_TIME +diff -r 7cba4201a2ae libgcc/unwind-dw2-fde-dip.c +--- a/libgcc/unwind-dw2-fde-dip.c Sat Jul 27 22:53:05 2013 -0400 ++++ b/libgcc/unwind-dw2-fde-dip.c Sat Jul 27 22:57:08 2013 -0400 +@@ -46,33 +46,13 @@ + #include "unwind-compat.h" + #include "gthr.h" + +-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ +- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ +- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) ++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR) + # define USE_PT_GNU_EH_FRAME +-#endif +- +-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ +- && defined(__BIONIC__) +-# define USE_PT_GNU_EH_FRAME +-#endif +- +-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ +- && defined(__FreeBSD__) && __FreeBSD__ >= 7 +-# define ElfW __ElfN +-# define USE_PT_GNU_EH_FRAME +-#endif +- +-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ +- && defined(__OpenBSD__) +-# define ElfW(type) Elf_##type +-# define USE_PT_GNU_EH_FRAME +-#endif +- +-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ +- && defined(TARGET_DL_ITERATE_PHDR) \ +- && defined(__sun__) && defined(__svr4__) +-# define USE_PT_GNU_EH_FRAME ++# ifdef __OpenBSD__ ++# define ElfW(type) Elf_##typ ++# elif defined(__FreeBSD__) && __FreeBSD__ >= 7 ++# define ElfW __ElfN ++# endif + #endif + + #if defined(USE_PT_GNU_EH_FRAME) +diff -r 75d9c38318a7 gcc/configure +--- a/gcc/configure Tue Sep 24 06:52:49 2013 -0400 ++++ b/gcc/configure Tue Sep 24 06:54:33 2013 -0400 +@@ -26736,6 +26736,9 @@ + else + gcc_cv_libc_provides_ssp=no + case "$target" in ++ *-*-musl*) ++ # All versions of musl provide stack protector ++ gcc_cv_libc_provides_ssp=yes;; + *-*-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. +@@ -26769,6 +26772,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. ++ # All supported versions of musl provide it as well + gcc_cv_libc_provides_ssp=yes;; + *-*-darwin* | *-*-freebsd*) + ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" +@@ -26851,6 +26855,9 @@ + gcc_cv_target_dl_iterate_phdr=no + fi + ;; ++ *-linux-musl*) ++ gcc_cv_target_dl_iterate_phdr=yes ++ ;; + esac + + if test x$gcc_cv_target_dl_iterate_phdr = xyes; then +diff -r 75d9c38318a7 gcc/configure.ac +--- a/gcc/configure.ac Tue Sep 24 06:52:49 2013 -0400 ++++ b/gcc/configure.ac Tue Sep 24 06:54:33 2013 -0400 +@@ -4719,6 +4719,9 @@ + gcc_cv_libc_provides_ssp, + [gcc_cv_libc_provides_ssp=no + case "$target" in ++ *-*-musl*) ++ # All versions of musl provide stack protector ++ gcc_cv_libc_provides_ssp=yes;; + *-*-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. +@@ -4752,6 +4755,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. ++ # All supported versions of musl provide it as well + gcc_cv_libc_provides_ssp=yes;; + *-*-darwin* | *-*-freebsd*) + AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], +@@ -4817,6 +4821,9 @@ + gcc_cv_target_dl_iterate_phdr=no + fi + ;; ++ *-linux-musl*) ++ gcc_cv_target_dl_iterate_phdr=yes ++ ;; + esac + GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) + if test x$gcc_cv_target_dl_iterate_phdr = xyes; then # HG changeset patch # Parent 94e435662aff38e86c9ca0dff4bbf451e0190b34 Get rid of ever-broken fixincludes on musl. @@ -359,36 +381,106 @@ diff -r 94e435662aff -r e27957848dc8 fixincludes/mkfixinc.sh # THEN create a no-op fixer and exit (echo "#! /bin/sh" ; echo "exit 0" ) > ${target} # HG changeset patch -# Parent f50bb54f331f73405131a30b4f353cfda1c70304 -Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one. +# Parent 3ea10cd626cb7abdfd56d3fe8d2c9ed58a82797b +Support for i386-linux-musl and x86_64-linux-musl. -diff -r f50bb54f331f libstdc++-v3/configure.host ---- a/libstdc++-v3/configure.host Fri Mar 29 16:38:52 2013 -0400 -+++ b/libstdc++-v3/configure.host Fri Mar 29 16:41:10 2013 -0400 -@@ -264,6 +264,13 @@ - os_include_dir="os/bsd/freebsd" - ;; - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) -+ # check for musl by target -+ case "${host_os}" in -+ *-musl*) -+ os_include_dir="os/generic" -+ ;; -+ *) +diff -r 3ea10cd626cb gcc/config/i386/linux.h +--- a/gcc/config/i386/linux.h Fri Mar 29 16:41:17 2013 -0400 ++++ b/gcc/config/i386/linux.h Fri Mar 29 16:41:20 2013 -0400 +@@ -21,3 +21,4 @@ + + #define GNU_USER_LINK_EMULATION "elf_i386" + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" +diff -r 3ea10cd626cb gcc/config/i386/linux64.h +--- a/gcc/config/i386/linux64.h Fri Mar 29 16:41:17 2013 -0400 ++++ b/gcc/config/i386/linux64.h Fri Mar 29 16:41:20 2013 -0400 +@@ -30,3 +30,7 @@ + #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" + #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" + - if [ "$uclibc" = "yes" ]; then - os_include_dir="os/uclibc" - elif [ "$bionic" = "yes" ]; then -@@ -272,6 +279,9 @@ - os_include_dir="os/gnu-linux" - fi - ;; ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" ++#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" +diff -r 3ea10cd626cb libitm/config/linux/x86/tls.h +--- a/libitm/config/linux/x86/tls.h Fri Mar 29 16:41:17 2013 -0400 ++++ b/libitm/config/linux/x86/tls.h Fri Mar 29 16:41:20 2013 -0400 +@@ -25,16 +25,19 @@ + #ifndef LIBITM_X86_TLS_H + #define LIBITM_X86_TLS_H 1 + +-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) ++#if defined(__GLIBC_PREREQ) ++#if __GLIBC_PREREQ(2, 10) + /* Use slots in the TCB head rather than __thread lookups. + GLIBC has reserved words 10 through 13 for TM. */ + #define HAVE_ARCH_GTM_THREAD 1 + #define HAVE_ARCH_GTM_THREAD_DISP 1 + #endif ++#endif + + #include "config/generic/tls.h" + +-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) ++#if defined(__GLIBC_PREREQ) ++#if __GLIBC_PREREQ(2, 10) + namespace GTM HIDDEN { + + #ifdef __x86_64__ +@@ -101,5 +104,6 @@ + + } // namespace GTM + #endif /* >= GLIBC 2.10 */ ++#endif + + #endif // LIBITM_X86_TLS_H +# HG changeset patch +# Parent c3eb69047e35491fda9cd9ab1ee2ace1299c793c +Support for arm-linux-musl. + +diff -r c3eb69047e35 gcc/config/arm/linux-eabi.h +--- a/gcc/config/arm/linux-eabi.h Thu Sep 19 07:11:38 2013 -0400 ++++ b/gcc/config/arm/linux-eabi.h Thu Sep 19 08:56:47 2013 -0400 +@@ -77,6 +77,23 @@ + %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ + %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" + ++/* For ARM musl currently supports four dynamic linkers: ++ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI ++ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI ++ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB ++ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB ++ musl does not support the legacy OABI mode. ++ All the dynamic linkers live in /lib. ++ We default to soft-float, EL. */ ++#undef MUSL_DYNAMIC_LINKER ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}" ++#else ++#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" ++#endif ++#define MUSL_DYNAMIC_LINKER \ ++ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + -+ esac -+ ;; - hpux*) - os_include_dir="os/hpux" - ;; + /* 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 +diff -r c3eb69047e35 libitm/config/arm/hwcap.cc +--- a/libitm/config/arm/hwcap.cc Thu Sep 19 07:11:38 2013 -0400 ++++ b/libitm/config/arm/hwcap.cc Thu Sep 19 08:56:47 2013 -0400 +@@ -40,7 +40,11 @@ + + #ifdef __linux__ + #include <unistd.h> ++#ifdef __GLIBC__ + #include <sys/fcntl.h> ++#else ++#include <fcntl.h> ++#endif + #include <elf.h> + + static void __attribute__((constructor)) # HG changeset patch # Parent 4618ad6f036f1e944a5262ae5875dcdf62c41f8b Support for mips-linux-musl. @@ -515,101 +607,17 @@ diff -r 2ffe76b215fd gcc/config/rs6000/sysv4.h { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ -diff -r 7cba4201a2ae libgcc/unwind-dw2-fde-dip.c ---- a/libgcc/unwind-dw2-fde-dip.c Sat Jul 27 22:53:05 2013 -0400 -+++ b/libgcc/unwind-dw2-fde-dip.c Sat Jul 27 22:57:08 2013 -0400 -@@ -46,33 +46,13 @@ - #include "unwind-compat.h" - #include "gthr.h" - --#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ -- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ -- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) -+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR) - # define USE_PT_GNU_EH_FRAME --#endif -- --#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ -- && defined(__BIONIC__) --# define USE_PT_GNU_EH_FRAME --#endif -- --#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ -- && defined(__FreeBSD__) && __FreeBSD__ >= 7 --# define ElfW __ElfN --# define USE_PT_GNU_EH_FRAME --#endif -- --#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ -- && defined(__OpenBSD__) --# define ElfW(type) Elf_##type --# define USE_PT_GNU_EH_FRAME --#endif -- --#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ -- && defined(TARGET_DL_ITERATE_PHDR) \ -- && defined(__sun__) && defined(__svr4__) --# define USE_PT_GNU_EH_FRAME -+# ifdef __OpenBSD__ -+# define ElfW(type) Elf_##typ -+# elif defined(__FreeBSD__) && __FreeBSD__ >= 7 -+# define ElfW __ElfN -+# endif - #endif - - #if defined(USE_PT_GNU_EH_FRAME) -# HG changeset patch -# Parent 3ea10cd626cb7abdfd56d3fe8d2c9ed58a82797b -Support for i386-linux-musl and x86_64-linux-musl. - -diff -r 3ea10cd626cb gcc/config/i386/linux.h ---- a/gcc/config/i386/linux.h Fri Mar 29 16:41:17 2013 -0400 -+++ b/gcc/config/i386/linux.h Fri Mar 29 16:41:20 2013 -0400 -@@ -21,3 +21,4 @@ - - #define GNU_USER_LINK_EMULATION "elf_i386" - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" -diff -r 3ea10cd626cb gcc/config/i386/linux64.h ---- a/gcc/config/i386/linux64.h Fri Mar 29 16:41:17 2013 -0400 -+++ b/gcc/config/i386/linux64.h Fri Mar 29 16:41:20 2013 -0400 -@@ -30,3 +30,7 @@ - #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" - #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" - #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" -+ -+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" -+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" -+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" -diff -r 3ea10cd626cb libitm/config/linux/x86/tls.h ---- a/libitm/config/linux/x86/tls.h Fri Mar 29 16:41:17 2013 -0400 -+++ b/libitm/config/linux/x86/tls.h Fri Mar 29 16:41:20 2013 -0400 -@@ -25,16 +25,19 @@ - #ifndef LIBITM_X86_TLS_H - #define LIBITM_X86_TLS_H 1 - --#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) -+#if defined(__GLIBC_PREREQ) -+#if __GLIBC_PREREQ(2, 10) - /* Use slots in the TCB head rather than __thread lookups. - GLIBC has reserved words 10 through 13 for TM. */ - #define HAVE_ARCH_GTM_THREAD 1 - #define HAVE_ARCH_GTM_THREAD_DISP 1 - #endif -+#endif - - #include "config/generic/tls.h" - --#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) -+#if defined(__GLIBC_PREREQ) -+#if __GLIBC_PREREQ(2, 10) - namespace GTM HIDDEN { - - #ifdef __x86_64__ -@@ -101,5 +104,6 @@ +--- a/gcc/config/aarch64/aarch64-linux.h 2013-01-10 21:38:27.000000000 +0100 ++++ b/gcc/config/aarch64/aarch64-linux.h 2013-09-12 21:39:34.004829498 +0200 +@@ -21,7 +21,11 @@ + #ifndef GCC_AARCH64_LINUX_H + #define GCC_AARCH64_LINUX_H - } // namespace GTM - #endif /* >= GLIBC 2.10 */ -+#endif ++/* The AArch64 port currently supports two dynamic linkers: ++ - ld-linux-aarch64.so.1 - GLIBC dynamic linker ++ - ld-musl-aarch64.so.1 - musl libc dynamic linker */ + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64.so.1" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64.so.1" - #endif // LIBITM_X86_TLS_H + #define LINUX_TARGET_LINK_SPEC "%{h*} \ + %{static:-Bstatic} \ |