summaryrefslogtreecommitdiff
path: root/toolchain/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain/gcc')
-rw-r--r--toolchain/gcc/Makefile4
-rw-r--r--toolchain/gcc/patches/4.7.3/musl-cross.patch36
-rw-r--r--toolchain/gcc/patches/4.7.3/musl-m68k.patch11
-rw-r--r--toolchain/gcc/patches/4.7.3/musl-sh.patch11
-rw-r--r--toolchain/gcc/patches/4.7.3/ppc-uclibc-cmath.patch217
5 files changed, 243 insertions, 36 deletions
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
index 2bc954347..5d00be19b 100644
--- a/toolchain/gcc/Makefile
+++ b/toolchain/gcc/Makefile
@@ -62,8 +62,12 @@ GCC_CONFOPTS+= --enable-tls
endif
ifeq ($(ARCH),powerpc)
+ifeq ($(ADK_TARGET_LIBC),musl)
GCC_CONFOPTS+= --disable-target-optspace --with-long-double-64 --enable-secureplt
else
+GCC_CONFOPTS+= --disable-target-optspace --with-long-double-128 --enable-secureplt
+endif
+else
GCC_CONFOPTS+= --enable-target-optspace
endif
diff --git a/toolchain/gcc/patches/4.7.3/musl-cross.patch b/toolchain/gcc/patches/4.7.3/musl-cross.patch
index bbba746b0..453ba9aec 100644
--- a/toolchain/gcc/patches/4.7.3/musl-cross.patch
+++ b/toolchain/gcc/patches/4.7.3/musl-cross.patch
@@ -386,37 +386,9 @@ diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/linux64.h gcc-4.7.3/gcc/config/rs6000
#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
-diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/secureplt.h gcc-4.7.3/gcc/config/rs6000/secureplt.h
---- gcc-4.7.3.orig/gcc/config/rs6000/secureplt.h 2007-08-02 12:49:31.000000000 +0200
-+++ gcc-4.7.3/gcc/config/rs6000/secureplt.h 2013-09-16 15:39:43.000000000 +0200
-@@ -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"
diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h gcc-4.7.3/gcc/config/rs6000/sysv4.h
--- gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h 2012-04-30 19:39:01.000000000 +0200
+++ gcc-4.7.3/gcc/config/rs6000/sysv4.h 2013-09-16 15:39:43.000000000 +0200
-@@ -566,6 +566,9 @@
- #ifndef CC1_SECURE_PLT_DEFAULT_SPEC
- #define CC1_SECURE_PLT_DEFAULT_SPEC ""
- #endif
-+#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
-+#define LINK_SECURE_PLT_DEFAULT_SPEC ""
-+#endif
-
- /* Pass -G xxx to the compiler and set correct endian mode. */
- #define CC1_SPEC "%{G*} %(cc1_cpu) \
-@@ -626,7 +629,8 @@
- %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
- %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
- %{mcall-i960-old: --oformat elf32-powerpcle} \
-- }}}}"
-+ }}}} \
-+%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
-
- /* Any specific OS flags. */
- #define LINK_OS_SPEC "\
@@ -804,15 +808,18 @@
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
@@ -439,14 +411,6 @@ diff -Nur gcc-4.7.3.orig/gcc/config/rs6000/sysv4.h gcc-4.7.3/gcc/config/rs6000/s
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
-@@ -938,6 +945,7 @@
- { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
- { "cc1_endian_default", CC1_ENDIAN_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 }, \
diff -Nur gcc-4.7.3.orig/gcc/config.gcc gcc-4.7.3/gcc/config.gcc
--- gcc-4.7.3.orig/gcc/config.gcc 2013-03-06 23:54:11.000000000 +0100
+++ gcc-4.7.3/gcc/config.gcc 2013-09-16 15:39:43.000000000 +0200
diff --git a/toolchain/gcc/patches/4.7.3/musl-m68k.patch b/toolchain/gcc/patches/4.7.3/musl-m68k.patch
new file mode 100644
index 000000000..54c7e0eef
--- /dev/null
+++ b/toolchain/gcc/patches/4.7.3/musl-m68k.patch
@@ -0,0 +1,11 @@
+diff -Nur gcc-4.7.3.orig/gcc/config/m68k/linux.h gcc-4.7.3/gcc/config/m68k/linux.h
+--- gcc-4.7.3.orig/gcc/config/m68k/linux.h 2011-11-27 00:57:37.000000000 +0100
++++ gcc-4.7.3/gcc/config/m68k/linux.h 2013-09-28 22:37:22.000000000 +0200
+@@ -73,6 +73,7 @@
+ done. */
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m m68kelf %{shared} \
diff --git a/toolchain/gcc/patches/4.7.3/musl-sh.patch b/toolchain/gcc/patches/4.7.3/musl-sh.patch
new file mode 100644
index 000000000..7738f266e
--- /dev/null
+++ b/toolchain/gcc/patches/4.7.3/musl-sh.patch
@@ -0,0 +1,11 @@
+diff -Nur gcc-4.7.3.orig/gcc/config/sh/linux.h gcc-4.7.3/gcc/config/sh/linux.h
+--- gcc-4.7.3.orig/gcc/config/sh/linux.h 2013-03-25 23:55:56.000000000 +0100
++++ gcc-4.7.3/gcc/config/sh/linux.h 2013-09-26 21:16:39.000000000 +0200
+@@ -46,6 +46,7 @@
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sh.1"
+
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
diff --git a/toolchain/gcc/patches/4.7.3/ppc-uclibc-cmath.patch b/toolchain/gcc/patches/4.7.3/ppc-uclibc-cmath.patch
new file mode 100644
index 000000000..0e64e8d0e
--- /dev/null
+++ b/toolchain/gcc/patches/4.7.3/ppc-uclibc-cmath.patch
@@ -0,0 +1,217 @@
+diff -Nur gcc-4.7.3.orig/libstdc++-v3/include/tr1/cmath gcc-4.7.3/libstdc++-v3/include/tr1/cmath
+--- gcc-4.7.3.orig/libstdc++-v3/include/tr1/cmath 2011-11-14 00:51:42.000000000 +0100
++++ gcc-4.7.3/libstdc++-v3/include/tr1/cmath 2013-09-22 20:13:54.000000000 +0200
+@@ -159,143 +159,213 @@
+ // functions
+ using ::acosh;
+ using ::acoshf;
++#ifdef __LONG_DOUBLE_128__
+ using ::acoshl;
++#endif
+
+ using ::asinh;
+ using ::asinhf;
++#ifdef __LONG_DOUBLE_128__
+ using ::asinhl;
++#endif
+
+ using ::atanh;
+ using ::atanhf;
++#ifdef __LONG_DOUBLE_128__
+ using ::atanhl;
++#endif
+
+ using ::cbrt;
+ using ::cbrtf;
++#ifdef __LONG_DOUBLE_128__
+ using ::cbrtl;
++#endif
+
+ using ::copysign;
+ using ::copysignf;
++#ifdef __LONG_DOUBLE_128__
+ using ::copysignl;
++#endif
+
+ using ::erf;
+ using ::erff;
++#ifdef __LONG_DOUBLE_128__
+ using ::erfl;
++#endif
+
+ using ::erfc;
+ using ::erfcf;
++#ifdef __LONG_DOUBLE_128__
+ using ::erfcl;
++#endif
+
+ using ::exp2;
+ using ::exp2f;
++#ifdef __LONG_DOUBLE_128__
+ using ::exp2l;
++#endif
+
+ using ::expm1;
+ using ::expm1f;
++#ifdef __LONG_DOUBLE_128__
+ using ::expm1l;
++#endif
+
+ using ::fdim;
+ using ::fdimf;
++#ifdef __LONG_DOUBLE_128__
+ using ::fdiml;
++#endif
+
+ using ::fma;
+ using ::fmaf;
++#ifdef __LONG_DOUBLE_128__
+ using ::fmal;
++#endif
+
+ using ::fmax;
+ using ::fmaxf;
++#ifdef __LONG_DOUBLE_128__
+ using ::fmaxl;
++#endif
+
+ using ::fmin;
+ using ::fminf;
++#ifdef __LONG_DOUBLE_128__
+ using ::fminl;
++#endif
+
+ using ::hypot;
+ using ::hypotf;
++#ifdef __LONG_DOUBLE_128__
+ using ::hypotl;
++#endif
+
+ using ::ilogb;
+ using ::ilogbf;
++#ifdef __LONG_DOUBLE_128__
+ using ::ilogbl;
++#endif
+
+ using ::lgamma;
+ using ::lgammaf;
++#ifdef __LONG_DOUBLE_128__
+ using ::lgammal;
++#endif
+
+ using ::llrint;
+ using ::llrintf;
++#ifdef __LONG_DOUBLE_128__
+ using ::llrintl;
++#endif
+
+ using ::llround;
+ using ::llroundf;
++#ifdef __LONG_DOUBLE_128__
+ using ::llroundl;
++#endif
+
+ using ::log1p;
+ using ::log1pf;
++#ifdef __LONG_DOUBLE_128__
+ using ::log1pl;
++#endif
+
+ using ::log2;
+ using ::log2f;
++#ifdef __LONG_DOUBLE_128__
+ using ::log2l;
++#endif
+
+ using ::logb;
+ using ::logbf;
++#ifdef __LONG_DOUBLE_128__
+ using ::logbl;
++#endif
+
+ using ::lrint;
+ using ::lrintf;
++#ifdef __LONG_DOUBLE_128__
+ using ::lrintl;
++#endif
+
+ using ::lround;
+ using ::lroundf;
++#ifdef __LONG_DOUBLE_128__
+ using ::lroundl;
++#endif
+
+ using ::nan;
+ using ::nanf;
++#ifdef __LONG_DOUBLE_128__
+ using ::nanl;
++#endif
+
+ using ::nearbyint;
+ using ::nearbyintf;
++#ifdef __LONG_DOUBLE_128__
+ using ::nearbyintl;
++#endif
+
+ using ::nextafter;
+ using ::nextafterf;
++#ifdef __LONG_DOUBLE_128__
+ using ::nextafterl;
++#endif
+
+ using ::nexttoward;
+ using ::nexttowardf;
++#ifdef __LONG_DOUBLE_128__
+ using ::nexttowardl;
++#endif
+
+ using ::remainder;
+ using ::remainderf;
++#ifdef __LONG_DOUBLE_128__
+ using ::remainderl;
++#endif
+
+ using ::remquo;
+ using ::remquof;
++#ifdef __LONG_DOUBLE_128__
+ using ::remquol;
++#endif
+
+ using ::rint;
+ using ::rintf;
++#ifdef __LONG_DOUBLE_128__
+ using ::rintl;
++#endif
+
+ using ::round;
+ using ::roundf;
++#ifdef __LONG_DOUBLE_128__
+ using ::roundl;
++#endif
+
+ using ::scalbln;
+ using ::scalblnf;
++#ifdef __LONG_DOUBLE_128__
+ using ::scalblnl;
++#endif
+
+ using ::scalbn;
+ using ::scalbnf;
++#ifdef __LONG_DOUBLE_128__
+ using ::scalbnl;
++#endif
+
+ using ::tgamma;
+ using ::tgammaf;
++#ifdef __LONG_DOUBLE_128__
+ using ::tgammal;
++#endif
+
+ using ::trunc;
+ using ::truncf;
++#ifdef __LONG_DOUBLE_128__
+ using ::truncl;
++#endif
+
+ #endif
+