diff -Nur gcc-4.9.2-or1k.orig/fixincludes/mkfixinc.sh gcc-4.9.2-or1k/fixincludes/mkfixinc.sh
--- gcc-4.9.2-or1k.orig/fixincludes/mkfixinc.sh 2015-07-13 13:42:13.000000000 -0500
+++ gcc-4.9.2-or1k/fixincludes/mkfixinc.sh 2015-07-13 14:13:48.314287003 -0500
@@ -19,7 +19,8 @@
powerpc-*-eabi* | \
powerpc-*-rtems* | \
powerpcle-*-eabisim* | \
- powerpcle-*-eabi* )
+ powerpcle-*-eabi* | \
+ *-musl* )
# IF there is no include fixing,
# THEN create a no-op fixer and exit
(echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/aarch64/aarch64-linux.h gcc-4.9.2-or1k/gcc/config/aarch64/aarch64-linux.h
--- gcc-4.9.2-or1k.orig/gcc/config/aarch64/aarch64-linux.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/aarch64/aarch64-linux.h 2015-07-13 14:13:48.314287003 -0500
@@ -23,6 +23,8 @@
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64.so.1"
+
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
#define LINUX_TARGET_LINK_SPEC "%{h*} \
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/arm/linux-eabi.h gcc-4.9.2-or1k/gcc/config/arm/linux-eabi.h
--- gcc-4.9.2-or1k.orig/gcc/config/arm/linux-eabi.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/arm/linux-eabi.h 2015-07-13 14:13:48.314287003 -0500
@@ -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"
+
/* 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 -Nur gcc-4.9.2-or1k.orig/gcc/config/i386/linux64.h gcc-4.9.2-or1k/gcc/config/i386/linux64.h
--- gcc-4.9.2-or1k.orig/gcc/config/i386/linux64.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/i386/linux64.h 2015-07-13 14:13:48.314287003 -0500
@@ -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 -Nur gcc-4.9.2-or1k.orig/gcc/config/i386/linux.h gcc-4.9.2-or1k/gcc/config/i386/linux.h
--- gcc-4.9.2-or1k.orig/gcc/config/i386/linux.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/i386/linux.h 2015-07-13 14:13:48.318287001 -0500
@@ -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 -Nur gcc-4.9.2-or1k.orig/gcc/config/linux.h gcc-4.9.2-or1k/gcc/config/linux.h
--- gcc-4.9.2-or1k.orig/gcc/config/linux.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/linux.h 2015-07-13 14:13:48.318287001 -0500
@@ -32,10 +32,12 @@
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
#else
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
#endif
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
@@ -53,18 +55,21 @@
uClibc or Bionic is the default C library and whether
-muclibc or -mglibc or -mbionic has been passed to change the default. */
-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
#if DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
#elif DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
#elif DEFAULT_LIBC == LIBC_BIONIC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
#else
#error "Unsupported DEFAULT_LIBC"
#endif /* DEFAULT_LIBC */
@@ -84,21 +89,92 @@
#define GNU_USER_DYNAMIC_LINKER \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
- BIONIC_DYNAMIC_LINKER)
+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
#define GNU_USER_DYNAMIC_LINKER32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
- BIONIC_DYNAMIC_LINKER32)
+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
#define GNU_USER_DYNAMIC_LINKER64 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
- BIONIC_DYNAMIC_LINKER64)
+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
#define GNU_USER_DYNAMIC_LINKERX32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
- BIONIC_DYNAMIC_LINKERX32)
+ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
/* Whether we have Bionic libc runtime */
#undef TARGET_HAS_BIONIC
#define TARGET_HAS_BIONIC (OPTION_BIONIC)
+/* musl avoids problematic includes by rearranging the include directories.
+ * Unfortunately, this is mostly duplicated from cppdefault.c */
+#if DEFAULT_LIBC == LIBC_MUSL
+#define INCLUDE_DEFAULTS_MUSL_GPP \
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+
+#ifdef LOCAL_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_LOCAL \
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
+#else
+#define INCLUDE_DEFAULTS_MUSL_LOCAL
+#endif
+
+#ifdef PREFIX_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_PREFIX \
+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
+#else
+#define INCLUDE_DEFAULTS_MUSL_PREFIX
+#endif
+
+#ifdef CROSS_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_CROSS \
+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
+#else
+#define INCLUDE_DEFAULTS_MUSL_CROSS
+#endif
+
+#ifdef TOOL_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_TOOL \
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
+#else
+#define INCLUDE_DEFAULTS_MUSL_TOOL
+#endif
+
+#ifdef NATIVE_SYSTEM_HEADER_DIR
+#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
+#else
+#define INCLUDE_DEFAULTS_MUSL_NATIVE
+#endif
+
+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
+# undef INCLUDE_DEFAULTS_MUSL_LOCAL
+# define INCLUDE_DEFAULTS_MUSL_LOCAL
+# undef INCLUDE_DEFAULTS_MUSL_NATIVE
+# define INCLUDE_DEFAULTS_MUSL_NATIVE
+#else
+# undef INCLUDE_DEFAULTS_MUSL_CROSS
+# define INCLUDE_DEFAULTS_MUSL_CROSS
+#endif
+
+#undef INCLUDE_DEFAULTS
+#define INCLUDE_DEFAULTS \
+ { \
+ INCLUDE_DEFAULTS_MUSL_GPP \
+ INCLUDE_DEFAULTS_MUSL_PREFIX \
+ INCLUDE_DEFAULTS_MUSL_CROSS \
+ INCLUDE_DEFAULTS_MUSL_TOOL \
+ INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
+ { 0, 0, 0, 0, 0, 0 } \
+ }
+#endif
+
#if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
/* This is a *uclinux* target. We don't define below macros to normal linux
versions, because doing so would require *uclinux* targets to include
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/linux.opt gcc-4.9.2-or1k/gcc/config/linux.opt
--- gcc-4.9.2-or1k.orig/gcc/config/linux.opt 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/linux.opt 2015-07-13 14:13:48.318287001 -0500
@@ -30,3 +30,7 @@
muclibc
Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
Use uClibc C library
+
+mmusl
+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
+Use musl C library
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/microblaze/linux.h gcc-4.9.2-or1k/gcc/config/microblaze/linux.h
--- gcc-4.9.2-or1k.orig/gcc/config/microblaze/linux.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/microblaze/linux.h 2015-07-13 14:13:48.318287001 -0500
@@ -25,7 +25,22 @@
#undef TLS_NEEDS_GOT
#define TLS_NEEDS_GOT 1
-#define DYNAMIC_LINKER "/lib/ld.so.1"
+#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */
+#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
+#else
+#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
+#endif
+
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1"
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
+#if DEFAULT_LIBC == LIBC_MUSL
+#define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER
+#else
+#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
+#endif
+
+
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "dynamic_linker", DYNAMIC_LINKER }
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/microblaze/microblaze.h gcc-4.9.2-or1k/gcc/config/microblaze/microblaze.h
--- gcc-4.9.2-or1k.orig/gcc/config/microblaze/microblaze.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/microblaze/microblaze.h 2015-07-13 14:13:48.318287001 -0500
@@ -218,6 +218,12 @@
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "int"
+#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 \
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/mips/linux.h gcc-4.9.2-or1k/gcc/config/mips/linux.h
--- gcc-4.9.2-or1k.orig/gcc/config/mips/linux.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/mips/linux.h 2015-07-13 14:13:48.318287001 -0500
@@ -23,3 +23,10 @@
#undef UCLIBC_DYNAMIC_LINKER
#define UCLIBC_DYNAMIC_LINKER \
"%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
+
+#if TARGET_ENDIAN_DEFAULT == 0 /* LE */
+#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
+#else
+#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
+#endif
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/or1k/linux-elf.h gcc-4.9.2-or1k/gcc/config/or1k/linux-elf.h
--- gcc-4.9.2-or1k.orig/gcc/config/or1k/linux-elf.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/or1k/linux-elf.h 2015-07-13 14:19:46.226287005 -0500
@@ -65,6 +65,7 @@
#define DRIVER_SELF_SPECS ""
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-or1k.so.1"
/* Define a set of Linux builtins. This is copied from linux.h. We can't
include the whole file for now, because that causes configure to require ld
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/rs6000/linux64.h gcc-4.9.2-or1k/gcc/config/rs6000/linux64.h
--- gcc-4.9.2-or1k.orig/gcc/config/rs6000/linux64.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/rs6000/linux64.h 2015-07-13 14:13:48.318287001 -0500
@@ -375,17 +375,21 @@
#endif
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
#if DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
#elif DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
#else
#error "Unsupported DEFAULT_LIBC"
#endif
#define GNU_USER_DYNAMIC_LINKER32 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
#define GNU_USER_DYNAMIC_LINKER64 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
#undef DEFAULT_ASM_ENDIAN
#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/rs6000/secureplt.h gcc-4.9.2-or1k/gcc/config/rs6000/secureplt.h
--- gcc-4.9.2-or1k.orig/gcc/config/rs6000/secureplt.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/rs6000/secureplt.h 2015-07-13 14:13:48.318287001 -0500
@@ -18,3 +18,4 @@
. */
#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/rs6000/sysv4.h gcc-4.9.2-or1k/gcc/config/rs6000/sysv4.h
--- gcc-4.9.2-or1k.orig/gcc/config/rs6000/sysv4.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/rs6000/sysv4.h 2015-07-13 14:13:48.318287001 -0500
@@ -537,6 +537,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. */
#define CC1_SPEC "%{G*} %(cc1_cpu)" \
@@ -585,7 +588,8 @@
/* Override the default target of the linker. */
#define LINK_TARGET_SPEC \
- ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
+ ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \
+ "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
/* Any specific OS flags. */
#define LINK_OS_SPEC "\
@@ -763,15 +767,18 @@
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
#if DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
#else
#error "Unsupported DEFAULT_LIBC"
#endif
#define GNU_USER_DYNAMIC_LINKER \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
@@ -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 }, \
diff -Nur gcc-4.9.2-or1k.orig/gcc/config/sh/linux.h gcc-4.9.2-or1k/gcc/config/sh/linux.h
--- gcc-4.9.2-or1k.orig/gcc/config/sh/linux.h 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config/sh/linux.h 2015-07-13 14:13:48.318287001 -0500
@@ -43,7 +43,14 @@
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+#if TARGET_BIG_ENDIAN_DEFAULT /* BE */
+#define MUSL_DYNAMIC_LINKER_E "eb"
+#else
+#define MUSL_DYNAMIC_LINKER_E
+#endif
+
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E ".so.1"
#undef SUBTARGET_LINK_EMUL_SUFFIX
#define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
diff -Nur gcc-4.9.2-or1k.orig/gcc/config.gcc gcc-4.9.2-or1k/gcc/config.gcc
--- gcc-4.9.2-or1k.orig/gcc/config.gcc 2015-07-13 13:42:14.000000000 -0500
+++ gcc-4.9.2-or1k/gcc/config.gcc 2015-07-13 14:13:48.318287001 -0500
@@ -600,7 +600,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"
# 32-bit x86 processors supported by --with-arch=. Each processor
# MUST be separated by exactly one space.
@@ -725,6 +725,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"
;;
@@ -2363,6 +2366,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 -Nur gcc-4.9.2-or1k.orig/gcc/config.gcc.orig gcc-4.9.2-or1k/gcc/config.gcc.orig
--- gcc-4.9.2-or1k.orig/gcc/config.gcc.orig 1969-12-31 18:00:00.000000000 -0600
+++ gcc-4.9.2-or1k/gcc/config.gcc.orig 2015-07-13 13:42:14.000000000 -0500
@@ -0,0 +1,4265 @@
+# GCC target-specific configuration file.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+#This file is part of GCC.
+
+#GCC is free software; you can redistribute it and/or modify it under
+#the terms of the GNU General Public License as published by the Free
+#Software Foundation; either version 3, or (at your option) any later
+#version.
+
+#GCC is distributed in the hope that it will be useful, but WITHOUT
+#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+#for more details.
+
+#You should have received a copy of the GNU General Public License
+#along with GCC; see the file COPYING3. If not see
+#.
+
+# This is the GCC target-specific configuration file
+# where a configuration type is mapped to different system-specific
+# definitions and files. This is invoked by the autoconf-generated
+# configure script. Putting it in a separate shell file lets us skip
+# running autoconf when modifying target-specific information.
+
+# When you change the cases in the OS or target switches, consider
+# updating ../libgcc/config.host also.
+
+# This file switches on the shell variable ${target}, and also uses the
+# following shell variables:
+#
+# with_* Various variables as set by configure.
+#
+# enable_threads Either the name, yes or no depending on whether
+# threads support was requested.
+#
+# default_use_cxa_atexit
+# The default value for the $enable___cxa_atexit
+# variable. enable___cxa_atexit needs to be set to
+# "yes" for the correct operation of C++ destructors
+# but it relies upon the presence of a non-standard C
+# library function called __cxa_atexit.
+# Since not all C libraries provide __cxa_atexit the
+# default value of $default_use_cxa_atexit is set to
+# "no" except for targets which are known to be OK.
+#
+# default_gnu_indirect_function
+# The default value for the $enable_gnu_indirect_function
+# variable. enable_gnu_indirect_function relies
+# upon the presence of a non-standard gnu ifunc support
+# in the assembler, linker and dynamic linker.
+# Since not all libraries provide the dynamic linking
+# support, the default value of
+# $default_gnu_indirect_function is set to
+# "no" except for targets which are known to be OK.
+#
+# gas_flag Either yes or no depending on whether GNU as was
+# requested.
+#
+# gnu_ld_flag Either yes or no depending on whether GNU ld was
+# requested.
+
+# This file sets the following shell variables for use by the
+# autoconf-generated configure script:
+#
+# cpu_type The name of the cpu, if different from the first
+# chunk of the canonical target name.
+#
+# tm_defines List of target macros to define for all compilations.
+#
+# tm_file A list of target macro files, if different from
+# "$cpu_type/$cpu_type.h". Usually it's constructed
+# per target in a way like this:
+# tm_file="${tm_file} dbxelf.h elfos.h ${cpu_type.h}/elf.h"
+# Note that the preferred order is:
+# - specific target header "${cpu_type}/${cpu_type.h}"
+# - generic headers like dbxelf.h elfos.h, etc.
+# - specializing target headers like ${cpu_type.h}/elf.h
+# This helps to keep OS specific stuff out of the CPU
+# defining header ${cpu_type}/${cpu_type.h}.
+#
+# It is possible to include automatically-generated
+# build-directory files by prefixing them with "./".
+# All other files should relative to $srcdir/config.
+#
+# tm_p_file Location of file with declarations for functions
+# in $out_file.
+#
+# out_file The name of the machine description C support
+# file, if different from "$cpu_type/$cpu_type.c".
+#
+# common_out_file The name of the source file for code shared between
+# the compiler proper and the driver.
+#
+# md_file The name of the machine-description file, if
+# different from "$cpu_type/$cpu_type.md".
+#
+# tmake_file A list of machine-description-specific
+# makefile-fragments, if different from
+# "$cpu_type/t-$cpu_type".
+#
+# extra_modes The name of the file containing a list of extra
+# machine modes, if necessary and different from
+# "$cpu_type/$cpu_type-modes.def".
+#
+# extra_objs List of extra objects that should be linked into
+# the compiler proper (cc1, cc1obj, cc1plus)
+# depending on target.
+#
+# extra_gcc_objs List of extra objects that should be linked into
+# the compiler driver (gcc) depending on target.
+#
+# extra_headers List of used header files from the directory
+# config/${cpu_type}.
+#
+# user_headers_inc_next_pre
+# List of header file names of internal gcc header
+# files, which should be prefixed by an include_next.
+# user_headers_inc_next_post
+# List of header file names of internal gcc header
+# files, which should be postfixed by an include_next.
+# use_gcc_tgmath If set, add tgmath.h to the list of used header
+# files.
+#
+# use_gcc_stdint If "wrap", install a version of stdint.h that
+# wraps the system's copy for hosted compilations;
+# if "provide", provide a version of systems without
+# such a system header; otherwise "none", do not
+# provide such a header at all.
+#
+# extra_programs List of extra executables compiled for this target
+# machine, used when linking.
+#
+# extra_options List of target-dependent .opt files.
+#
+# c_target_objs List of extra target-dependent objects that be
+# linked into the C compiler only.
+#
+# cxx_target_objs List of extra target-dependent objects that be
+# linked into the C++ compiler only.
+#
+# fortran_target_objs List of extra target-dependent objects that be
+# linked into the fortran compiler only.
+#
+# target_gtfiles List of extra source files with type information.
+#
+# xm_defines List of macros to define when compiling for the
+# target machine.
+#
+# xm_file List of files to include when compiling for the
+# target machine.
+#
+# use_collect2 Set to yes or no, depending on whether collect2
+# will be used.
+#
+# target_cpu_default Set to override the default target model.
+#
+# gdb_needs_out_file_path
+# Set to yes if gdb needs a dir command with
+# `dirname $out_file`.
+#
+# thread_file Set to control which thread package to use.
+#
+# gas Set to yes or no depending on whether the target
+# system normally uses GNU as.
+#
+# need_64bit_hwint Set to yes if HOST_WIDE_INT must be 64 bits wide
+# for this target. This is true if this target
+# supports "long" or "wchar_t" wider than 32 bits,
+# or BITS_PER_WORD is wider than 32 bits.
+# The setting made here must match the one made in
+# other locations such as libcpp/configure.ac
+#
+# configure_default_options
+# Set to an initializer for configure_default_options
+# in configargs.h, based on --with-cpu et cetera.
+#
+# native_system_header_dir
+# Where system header files are found for this
+# target. This defaults to /usr/include. If
+# the --with-sysroot configure option or the
+# --sysroot command line option is used this
+# will be relative to the sysroot.
+# target_type_format_char
+# The default character to be used for formatting
+# the attribute in a
+# .type symbol_name, ${t_t_f_c}
+# directive.
+
+# The following variables are used in each case-construct to build up the
+# outgoing variables:
+#
+# gnu_ld Set to yes or no depending on whether the target
+# system normally uses GNU ld.
+#
+# target_has_targetcm Set to yes or no depending on whether the target
+# has its own definition of targetcm.
+#
+# target_has_targetm_common Set to yes or no depending on whether the
+# target has its own definition of targetm_common.
+
+out_file=
+common_out_file=
+tmake_file=
+extra_headers=
+user_headers_inc_next_pre=
+user_headers_inc_next_post=
+use_gcc_tgmath=yes
+use_gcc_stdint=none
+extra_programs=
+extra_objs=
+extra_gcc_objs=
+extra_options=
+c_target_objs=
+cxx_target_objs=
+fortran_target_objs=
+target_has_targetcm=no
+target_has_targetm_common=yes
+tm_defines=
+xm_defines=
+# Set this to force installation and use of collect2.
+use_collect2=
+# Set this to override the default target model.
+target_cpu_default=
+# Set this if gdb needs a dir command with `dirname $out_file`
+gdb_needs_out_file_path=
+# Set this to control which thread package will be used.
+thread_file=
+# Reinitialize these from the flag values every loop pass, since some
+# configure entries modify them.
+gas="$gas_flag"
+gnu_ld="$gnu_ld_flag"
+default_use_cxa_atexit=no
+default_gnu_indirect_function=no
+target_gtfiles=
+need_64bit_hwint=
+need_64bit_isa=
+native_system_header_dir=/usr/include
+target_type_format_char='@'
+
+# Don't carry these over build->host->target. Please.
+xm_file=
+md_file=
+
+# Obsolete configurations.
+case ${target} in
+ picochip-* \
+ | score-* \
+ | *-*-solaris2.9* \
+ )
+ if test "x$enable_obsolete" != xyes; then
+ echo "*** Configuration ${target} is obsolete." >&2
+ echo "*** Specify --enable-obsolete to build it anyway." >&2
+ echo "*** Support will be REMOVED in the next major release of GCC," >&2
+ echo "*** unless a maintainer comes forward." >&2
+ exit 1
+ fi;;
+esac
+
+# Unsupported targets list. Do not put an entry in this list unless
+# it would otherwise be caught by a more permissive pattern. The list
+# should be in alphabetical order.
+case ${target} in
+ # Avoid special cases that are not obsolete
+ arm*-*-*eabi* \
+ )
+ ;;
+ arm*-wince-pe* \
+ | arm*-*-ecos-elf \
+ | arm*-*-elf \
+ | arm*-*-freebsd* \
+ | arm*-*-linux* \
+ | arm*-*-uclinux* \
+ | i[34567]86-go32-* \
+ | i[34567]86-*-go32* \
+ | m68k-*-uclinuxoldabi* \
+ | mips64orion*-*-rtems* \
+ | pdp11-*-bsd \
+ | sparc-hal-solaris2* \
+ | thumb-*-* \
+ | *-*-freebsd[12] | *-*-freebsd[12].* \
+ | *-*-freebsd*aout* \
+ | *-*-linux*aout* \
+ | *-*-linux*coff* \
+ | *-*-linux*libc1* \
+ | *-*-linux*oldld* \
+ | *-*-rtemsaout* \
+ | *-*-rtemscoff* \
+ | *-*-solaris2 \
+ | *-*-solaris2.[0-8] \
+ | *-*-solaris2.[0-8].* \
+ | *-*-sysv* \
+ | vax-*-vms* \
+ )
+ echo "*** Configuration ${target} not supported" 1>&2
+ exit 1
+ ;;
+esac
+
+# Set default cpu_type, tm_file, tm_p_file and xm_file so it can be
+# updated in each machine entry. Also set default extra_headers for some
+# machines.
+tm_p_file=
+cpu_type=`echo ${target} | sed 's/-.*$//'`
+cpu_is_64bit=
+case ${target} in
+m32c*-*-*)
+ cpu_type=m32c
+ tmake_file=m32c/t-m32c
+ target_has_targetm_common=no
+ ;;
+aarch64*-*-*)
+ cpu_type=aarch64
+ need_64bit_hwint=yes
+ extra_headers="arm_neon.h"
+ extra_objs="aarch64-builtins.o aarch-common.o"
+ target_has_targetm_common=yes
+ ;;
+alpha*-*-*)
+ cpu_type=alpha
+ need_64bit_hwint=yes
+ extra_options="${extra_options} g.opt"
+ ;;
+am33_2.0-*-linux*)
+ cpu_type=mn10300
+ ;;
+arc*-*-*)
+ cpu_type=arc
+ ;;
+arm*-*-*)
+ cpu_type=arm
+ extra_objs="aarch-common.o"
+ extra_headers="mmintrin.h arm_neon.h arm_acle.h"
+ target_type_format_char='%'
+ c_target_objs="arm-c.o"
+ cxx_target_objs="arm-c.o"
+ need_64bit_hwint=yes
+ extra_options="${extra_options} arm/arm-tables.opt"
+ ;;
+avr-*-*)
+ cpu_type=avr
+ c_target_objs="avr-c.o"
+ cxx_target_objs="avr-c.o"
+ extra_options="${extra_options} avr/avr-tables.opt"
+ ;;
+bfin*-*)
+ cpu_type=bfin
+ ;;
+crisv32-*)
+ cpu_type=cris
+ ;;
+frv*) cpu_type=frv
+ extra_options="${extra_options} g.opt"
+ ;;
+moxie*) cpu_type=moxie
+ target_has_targetm_common=no
+ ;;
+fido-*-*)
+ cpu_type=m68k
+ extra_headers=math-68881.h
+ extra_options="${extra_options} m68k/m68k-tables.opt"
+ ;;
+i[34567]86-*-*)
+ cpu_type=i386
+ c_target_objs="i386-c.o"
+ cxx_target_objs="i386-c.o"
+ need_64bit_hwint=yes
+ extra_options="${extra_options} fused-madd.opt"
+ extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
+ pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
+ nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
+ immintrin.h x86intrin.h avxintrin.h xopintrin.h
+ ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
+ lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
+ avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
+ rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
+ adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
+ avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
+ shaintrin.h"
+ ;;
+x86_64-*-*)
+ cpu_type=i386
+ c_target_objs="i386-c.o"
+ cxx_target_objs="i386-c.o"
+ extra_options="${extra_options} fused-madd.opt"
+ extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
+ pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
+ nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
+ immintrin.h x86intrin.h avxintrin.h xopintrin.h
+ ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
+ lzcntintrin.h bmiintrin.h tbmintrin.h bmi2intrin.h
+ avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
+ rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
+ adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
+ avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
+ shaintrin.h"
+ need_64bit_hwint=yes
+ ;;
+ia64-*-*)
+ extra_headers=ia64intrin.h
+ need_64bit_hwint=yes
+ extra_options="${extra_options} g.opt fused-madd.opt"
+ ;;
+hppa*-*-*)
+ cpu_type=pa
+ ;;
+lm32*)
+ extra_options="${extra_options} g.opt"
+ ;;
+m32r*-*-*)
+ cpu_type=m32r
+ extra_options="${extra_options} g.opt"
+ ;;
+m68k-*-*)
+ extra_headers=math-68881.h
+ extra_options="${extra_options} m68k/m68k-tables.opt"
+ ;;
+microblaze*-*-*)
+ cpu_type=microblaze
+ extra_options="${extra_options} g.opt"
+ ;;
+mips*-*-*)
+ cpu_type=mips
+ need_64bit_hwint=yes
+ extra_headers="loongson.h"
+ extra_options="${extra_options} g.opt mips/mips-tables.opt"
+ ;;
+nds32*)
+ cpu_type=nds32
+ extra_headers="nds32_intrinsic.h"
+ ;;
+nios2-*-*)
+ cpu_type=nios2
+ extra_options="${extra_options} g.opt"
+ ;;
+or1k-*-*)
+ cpu_type=or1k
+ ;;
+or1knd-*-*)
+ cpu_type=or1k
+ ;;
+picochip-*-*)
+ cpu_type=picochip
+ ;;
+powerpc*-*-*)
+ cpu_type=rs6000
+ extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h"
+ need_64bit_hwint=yes
+ case x$with_cpu in
+ xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|Xe6500)
+ cpu_is_64bit=yes
+ ;;
+ esac
+ extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
+ ;;
+rs6000*-*-*)
+ need_64bit_hwint=yes
+ extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
+ ;;
+score*-*-*)
+ cpu_type=score
+ extra_options="${extra_options} g.opt"
+ ;;
+sparc*-*-*)
+ cpu_type=sparc
+ c_target_objs="sparc-c.o"
+ cxx_target_objs="sparc-c.o"
+ extra_headers="visintrin.h"
+ need_64bit_hwint=yes
+ ;;
+spu*-*-*)
+ cpu_type=spu
+ need_64bit_hwint=yes
+ ;;
+s390*-*-*)
+ cpu_type=s390
+ need_64bit_hwint=yes
+ extra_options="${extra_options} fused-madd.opt"
+ extra_headers="s390intrin.h htmintrin.h htmxlintrin.h"
+ ;;
+# Note the 'l'; we need to be able to match e.g. "shle" or "shl".
+sh[123456789lbe]*-*-* | sh-*-*)
+ cpu_type=sh
+ need_64bit_hwint=yes
+ extra_options="${extra_options} fused-madd.opt"
+ extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
+ ;;
+v850*-*-*)
+ cpu_type=v850
+ ;;
+tic6x-*-*)
+ cpu_type=c6x
+ extra_headers="c6x_intrinsics.h"
+ extra_options="${extra_options} c6x/c6x-tables.opt"
+ ;;
+xtensa*-*-*)
+ extra_options="${extra_options} fused-madd.opt"
+ ;;
+tilegx*-*-*)
+ cpu_type=tilegx
+ need_64bit_hwint=yes
+ ;;
+tilepro*-*-*)
+ cpu_type=tilepro
+ need_64bit_hwint=yes
+ ;;
+esac
+
+tm_file=${cpu_type}/${cpu_type}.h
+if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-protos.h
+then
+ tm_p_file=${cpu_type}/${cpu_type}-protos.h
+fi
+extra_modes=
+if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def
+then
+ extra_modes=${cpu_type}/${cpu_type}-modes.def
+fi
+if test -f ${srcdir}/config/${cpu_type}/${cpu_type}.opt
+then
+ extra_options="${extra_options} ${cpu_type}/${cpu_type}.opt"
+fi
+
+case ${target} in
+aarch64*-*-*)
+ tm_p_file="${tm_p_file} arm/aarch-common-protos.h"
+ case ${with_abi} in
+ "")
+ if test "x$with_multilib_list" = xilp32; then
+ tm_file="aarch64/biarchilp32.h ${tm_file}"
+ else
+ tm_file="aarch64/biarchlp64.h ${tm_file}"
+ fi
+ ;;
+ ilp32)
+ tm_file="aarch64/biarchilp32.h ${tm_file}"
+ ;;
+ lp64)
+ tm_file="aarch64/biarchlp64.h ${tm_file}"
+ ;;
+ *)
+ echo "Unknown ABI used in --with-abi=$with_abi"
+ exit 1
+ esac
+ ;;
+i[34567]86-*-*)
+ if test "x$with_abi" != x; then
+ echo "This target does not support --with-abi."
+ exit 1
+ fi
+ if test "x$enable_cld" = xyes; then
+ tm_defines="${tm_defines} USE_IX86_CLD=1"
+ fi
+ if test "x$enable_frame_pointer" = xyes; then
+ tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
+ fi
+ tm_file="vxworks-dummy.h ${tm_file}"
+ ;;
+x86_64-*-*)
+ case ${with_abi} in
+ "")
+ if test "x$with_multilib_list" = xmx32; then
+ tm_file="i386/biarchx32.h ${tm_file}"
+ else
+ tm_file="i386/biarch64.h ${tm_file}"
+ fi
+ ;;
+ 64 | m64)
+ tm_file="i386/biarch64.h ${tm_file}"
+ ;;
+ x32 | mx32)
+ tm_file="i386/biarchx32.h ${tm_file}"
+ ;;
+ *)
+ echo "Unknown ABI used in --with-abi=$with_abi"
+ exit 1
+ esac
+ if test "x$enable_cld" = xyes; then
+ tm_defines="${tm_defines} USE_IX86_CLD=1"
+ fi
+ if test "x$enable_frame_pointer" = xyes; then
+ tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
+ fi
+ tm_file="vxworks-dummy.h ${tm_file}"
+ ;;
+arm*-*-*)
+ tm_p_file="${tm_p_file} arm/aarch-common-protos.h"
+ tm_file="vxworks-dummy.h ${tm_file}"
+ ;;
+mips*-*-* | sh*-*-* | sparc*-*-*)
+ tm_file="vxworks-dummy.h ${tm_file}"
+ ;;
+esac
+
+# On a.out targets, we need to use collect2.
+case ${target} in
+*-*-*aout*)
+ use_collect2=yes
+ ;;
+esac
+
+# Common C libraries.
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
+
+# 32-bit x86 processors supported by --with-arch=. Each processor
+# MUST be separated by exactly one space.
+x86_archs="athlon athlon-4 athlon-fx athlon-mp athlon-tbird \
+athlon-xp k6 k6-2 k6-3 geode c3 c3-2 winchip-c6 winchip2 i386 i486 \
+i586 i686 pentium pentium-m pentium-mmx pentium2 pentium3 pentium3m \
+pentium4 pentium4m pentiumpro prescott"
+
+# 64-bit x86 processors supported by --with-arch=. Each processor
+# MUST be separated by exactly one space.
+x86_64_archs="amdfam10 athlon64 athlon64-sse3 barcelona bdver1 bdver2 \
+bdver3 bdver4 btver1 btver2 k8 k8-sse3 opteron opteron-sse3 nocona \
+core2 corei7 corei7-avx core-avx-i core-avx2 atom slm nehalem westmere \
+sandybridge ivybridge haswell broadwell bonnell silvermont x86-64 native"
+
+# Additional x86 processors supported by --with-cpu=. Each processor
+# MUST be separated by exactly one space.
+x86_cpus="generic intel"
+
+# Common parts for widely ported systems.
+case ${target} in
+*-*-darwin*)
+ tmake_file="t-darwin ${cpu_type}/t-darwin"
+ tm_file="${tm_file} darwin.h"
+ case ${target} in
+ *-*-darwin9*)
+ tm_file="${tm_file} darwin9.h"
+ ;;
+ *-*-darwin[12][0-9]*)
+ tm_file="${tm_file} darwin9.h darwin10.h"
+ ;;
+ esac
+ tm_file="${tm_file} ${cpu_type}/darwin.h"
+ tm_p_file="${tm_p_file} darwin-protos.h"
+ target_gtfiles="\$(srcdir)/config/darwin.c"
+ extra_options="${extra_options} darwin.opt"
+ c_target_objs="${c_target_objs} darwin-c.o"
+ cxx_target_objs="${cxx_target_objs} darwin-c.o"
+ fortran_target_objs="darwin-f.o"
+ target_has_targetcm=yes
+ extra_objs="darwin.o"
+ extra_gcc_objs="darwin-driver.o"
+ default_use_cxa_atexit=yes
+ use_gcc_stdint=wrap
+ case ${enable_threads} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
+ ;;
+*-*-freebsd*)
+ # This is the generic ELF configuration of FreeBSD. Later
+ # machine-specific sections may refine and add to this
+ # configuration.
+ #
+ # Due to tm_file entry ordering issues that vary between cpu
+ # architectures, we only define fbsd_tm_file to allow the
+ # machine-specific section to dictate the final order of all
+ # entries of tm_file with the minor exception that components
+ # of the tm_file set here will always be of the form:
+ #
+ # freebsd.h [freebsd-.h ...] freebsd-spec.h freebsd.h
+ #
+ # The machine-specific section should not tamper with this
+ # ordering but may order all other entries of tm_file as it
+ # pleases around the provided core setting.
+ gas=yes
+ gnu_ld=yes
+ fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
+ tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
+ tmake_file="t-slibgcc"
+ case ${enable_threads} in
+ no)
+ fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h"
+ ;;
+ "" | yes | posix)
+ thread_file='posix'
+ ;;
+ *)
+ echo 'Unknown thread configuration for FreeBSD'
+ exit 1
+ ;;
+ esac
+ fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h freebsd-stdint.h"
+ extra_options="$extra_options rpath.opt freebsd.opt"
+ case ${target} in
+ *-*-freebsd[345].*)
+ :;;
+ *)
+ default_use_cxa_atexit=yes;;
+ esac
+ # need_64bit_hwint=yes # system compiler has this for all arch!
+ use_gcc_stdint=wrap
+ ;;
+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+ extra_options="$extra_options gnu-user.opt"
+ gas=yes
+ gnu_ld=yes
+ case ${enable_threads} in
+ "" | yes | posix) thread_file='posix' ;;
+ esac
+ tmake_file="t-slibgcc"
+ case $target in
+ *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-kopensolaris*-gnu)
+ :;;
+ *-*-gnu*)
+ native_system_header_dir=/include
+ ;;
+ esac
+ # Linux C libraries selection switch: glibc / uclibc / bionic.
+ # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD.
+ case $target in
+ *linux*)
+ tm_p_file="${tm_p_file} linux-protos.h"
+ tmake_file="${tmake_file} t-linux"
+ extra_objs="${extra_objs} linux.o"
+ extra_options="${extra_options} linux.opt"
+ ;;
+ esac
+ case $target in
+ *-*-*android*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"
+ ;;
+ *-*-*uclibc*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
+ ;;
+ *)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
+ ;;
+ esac
+ # Assume that glibc or uClibc or Bionic are being used and so __cxa_atexit
+ # is provided.
+ default_use_cxa_atexit=yes
+ use_gcc_tgmath=no
+ use_gcc_stdint=wrap
+ # Enable compilation for Android by default for *android* targets.
+ case $target in
+ *-*-*android*)
+ tm_defines="$tm_defines ANDROID_DEFAULT=1"
+ ;;
+ *)
+ tm_defines="$tm_defines ANDROID_DEFAULT=0"
+ ;;
+ esac
+ c_target_objs="${c_target_objs} glibc-c.o"
+ cxx_target_objs="${cxx_target_objs} glibc-c.o"
+ tmake_file="${tmake_file} t-glibc"
+ target_has_targetcm=yes
+ ;;
+*-*-netbsd*)
+ tmake_file="t-slibgcc"
+ gas=yes
+ gnu_ld=yes
+
+ # NetBSD 2.0 and later get POSIX threads enabled by default.
+ # Allow them to be explicitly enabled on any other version.
+ case ${enable_threads} in
+ "")
+ case ${target} in
+ *-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
+ thread_file='posix'
+ tm_defines="${tm_defines} NETBSD_ENABLE_PTHREADS"
+ ;;
+ esac
+ ;;
+ yes | posix)
+ thread_file='posix'
+ tm_defines="${tm_defines} NETBSD_ENABLE_PTHREADS"
+ ;;
+ esac
+
+ # NetBSD 2.0 and later provide __cxa_atexit(), which we use by
+ # default (unless overridden by --disable-__cxa_atexit).
+ case ${target} in
+ *-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
+ default_use_cxa_atexit=yes
+ ;;
+ esac
+ ;;
+*-*-openbsd*)
+ tmake_file="t-openbsd"
+ case ${enable_threads} in
+ yes)
+ thread_file='posix'
+ ;;
+ esac
+ case ${target} in
+ *-*-openbsd2.*|*-*-openbsd3.[012])
+ tm_defines="${tm_defines} HAS_LIBC_R=1" ;;
+ esac
+ case ${target} in
+ *-*-openbsd4.[3-9]|*-*-openbsd[5-9]*)
+ default_use_cxa_atexit=yes
+ ;;
+ esac
+ ;;
+*-*-rtems*)
+ case ${enable_threads} in
+ "" | yes | rtems) thread_file='rtems' ;;
+ posix) thread_file='posix' ;;
+ no) ;;
+ *)
+ echo 'Unknown thread configuration for RTEMS'
+ exit 1
+ ;;
+ esac
+ tmake_file="${tmake_file} t-rtems"
+ extra_options="${extra_options} rtems.opt"
+ default_use_cxa_atexit=yes
+ use_gcc_stdint=wrap
+ ;;
+*-*-uclinux*)
+ extra_options="$extra_options gnu-user.opt"
+ use_gcc_stdint=wrap
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
+ ;;
+*-*-rdos*)
+ use_gcc_stdint=wrap
+ ;;
+*-*-solaris2*)
+ # i?86-*-solaris2* needs to insert headers between cpu default and
+ # Solaris 2 specific ones.
+ sol2_tm_file="dbxelf.h elfos.h ${cpu_type}/sysv4.h sol2.h ${cpu_type}/sol2.h"
+ case ${target} in
+ *-*-solaris2.1[0-9]*)
+ sol2_tm_file="${sol2_tm_file} sol2-10.h"
+ use_gcc_stdint=wrap
+ ;;
+ *)
+ use_gcc_stdint=provide
+ ;;
+ esac
+ if test x$gnu_ld = xyes; then
+ tm_file="usegld.h ${tm_file}"
+ fi
+ if test x$gas = xyes; then
+ tm_file="usegas.h ${tm_file}"
+ fi
+ tm_p_file="${tm_p_file} sol2-protos.h"
+ tmake_file="${tmake_file} t-sol2 t-slibgcc"
+ c_target_objs="${c_target_objs} sol2-c.o"
+ cxx_target_objs="${cxx_target_objs} sol2-c.o sol2-cxx.o"
+ extra_objs="sol2.o sol2-stubs.o"
+ extra_options="${extra_options} sol2.opt"
+ case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
+ "":yes:* | yes:yes:* )
+ thread_file=posix
+ ;;
+ esac
+ ;;
+*-*-*vms*)
+ extra_options="${extra_options} vms/vms.opt"
+ xmake_file=vms/x-vms
+ tmake_file="vms/t-vms t-slibgcc"
+ extra_objs="vms.o"
+ target_gtfiles="$target_gtfiles \$(srcdir)/config/vms/vms.c"
+ tm_p_file="${tm_p_file} vms/vms-protos.h"
+ xm_file="vms/xm-vms.h"
+ c_target_objs="vms-c.o"
+ cxx_target_objs="vms-c.o"
+ fortran_target_objs="vms-f.o"
+ use_gcc_stdint=provide
+ tm_file="${tm_file} vms/vms-stdint.h"
+ if test x$gnu_ld != xyes; then
+ # Build wrappers for native case.
+ extra_programs="ld\$(exeext) ar\$(exeext)"
+ tmake_file="$tmake_file vms/t-vmsnative"
+ fi
+ ;;
+*-*-vxworks*)
+ tmake_file=t-vxworks
+ xm_defines=POSIX
+ extra_options="${extra_options} vxworks.opt"
+ extra_objs="$extra_objs vxworks.o"
+ case ${enable_threads} in
+ no) ;;
+ "" | yes | vxworks) thread_file='vxworks' ;;
+ *) echo 'Unknown thread configuration for VxWorks'; exit 1 ;;
+ esac
+ ;;
+*-*-elf|arc*-*-elf*)
+ # Assume that newlib is being used and so __cxa_atexit is provided.
+ default_use_cxa_atexit=yes
+ use_gcc_stdint=wrap
+ ;;
+esac
+
+case ${target} in
+aarch64*-*-elf)
+ tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
+ tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-elf-raw.h"
+ tmake_file="${tmake_file} aarch64/t-aarch64"
+ use_gcc_stdint=wrap
+ case $target in
+ aarch64_be-*)
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+ ;;
+ esac
+ aarch64_multilibs="${with_multilib_list}"
+ if test "$aarch64_multilibs" = "default"; then
+ aarch64_multilibs="lp64,ilp32"
+ fi
+ aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
+ for aarch64_multilib in ${aarch64_multilibs}; do
+ case ${aarch64_multilib} in
+ ilp32 | lp64 )
+ TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
+ ;;
+ *)
+ echo "--with-multilib-list=${aarch64_multilib} not supported."
+ exit 1
+ esac
+ done
+ TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
+ ;;
+aarch64*-*-linux*)
+ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
+ tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"
+ tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
+ case $target in
+ aarch64_be-*)
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+ ;;
+ esac
+ aarch64_multilibs="${with_multilib_list}"
+ if test "$aarch64_multilibs" = "default"; then
+ # TODO: turn on ILP32 multilib build after its support is mature.
+ # aarch64_multilibs="lp64,ilp32"
+ aarch64_multilibs="lp64"
+ fi
+ aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
+ for aarch64_multilib in ${aarch64_multilibs}; do
+ case ${aarch64_multilib} in
+ ilp32 | lp64 )
+ TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
+ ;;
+ *)
+ echo "--with-multilib-list=${aarch64_multilib} not supported."
+ exit 1
+ esac
+ done
+ TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
+ ;;
+alpha*-*-linux*)
+ tm_file="elfos.h ${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h glibc-stdint.h"
+ tmake_file="${tmake_file} alpha/t-linux"
+ extra_options="${extra_options} alpha/elf.opt"
+ ;;
+alpha*-*-freebsd*)
+ tm_file="elfos.h ${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h"
+ extra_options="${extra_options} alpha/elf.opt"
+ ;;
+alpha*-*-netbsd*)
+ tm_file="elfos.h ${tm_file} netbsd.h alpha/elf.h netbsd-elf.h alpha/netbsd.h"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
+ alpha/elf.opt"
+ ;;
+alpha*-*-openbsd*)
+ tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
+ tm_file="elfos.h alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h"
+ extra_options="${extra_options} openbsd.opt alpha/elf.opt"
+ # default x-alpha is only appropriate for dec-osf.
+ ;;
+alpha*-dec-*vms*)
+ tm_file="${tm_file} vms/vms.h alpha/vms.h"
+ tmake_file="${tmake_file} alpha/t-vms"
+ ;;
+arc*-*-elf*)
+ extra_headers="arc-simd.h"
+ tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+ tmake_file="arc/t-arc-newlib arc/t-arc"
+ case x"${with_cpu}" in
+ xarc600|xarc601|xarc700)
+ target_cpu_default="TARGET_CPU_$with_cpu"
+ ;;
+ esac
+ if test x${with_endian} = x; then
+ case ${target} in
+ arc*be-*-* | arc*eb-*-*) with_endian=big ;;
+ *) with_endian=little ;;
+ esac
+ fi
+ case ${with_endian} in
+ big|little) ;;
+ *) echo "with_endian=${with_endian} not supported."; exit 1 ;;
+ esac
+ case ${with_endian} in
+ big*) tm_defines="DRIVER_ENDIAN_SELF_SPECS=\\\"%{!EL:%{!mlittle-endian:-mbig-endian}}\\\" ${tm_defines}"
+ esac
+ ;;
+arc*-*-linux-uclibc*)
+ extra_headers="arc-simd.h"
+ tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file}"
+ tmake_file="${tmake_file} arc/t-arc-uClibc arc/t-arc"
+ tm_defines="${tm_defines} TARGET_SDATA_DEFAULT=0"
+ tm_defines="${tm_defines} TARGET_MMEDIUM_CALLS_DEFAULT=1"
+ case x"${with_cpu}" in
+ xarc600|xarc601|xarc700)
+ target_cpu_default="TARGET_CPU_$with_cpu"
+ ;;
+ esac
+ if test x${with_endian} = x; then
+ case ${target} in
+ arc*be-*-* | arc*eb-*-*) with_endian=big ;;
+ *) with_endian=little ;;
+ esac
+ fi
+ case ${with_endian} in
+ big|little) ;;
+ *) echo "with_endian=${with_endian} not supported."; exit 1 ;;
+ esac
+ case ${with_endian} in
+ big*) tm_defines="DRIVER_ENDIAN_SELF_SPECS=\\\"%{!EL:%{!mlittle-endian:-mbig-endian}}\\\" ${tm_defines}"
+ esac
+ ;;
+arm-wrs-vxworks)
+ tm_file="elfos.h arm/elf.h arm/aout.h ${tm_file} vx-common.h vxworks.h arm/vxworks.h"
+ extra_options="${extra_options} arm/vxworks.opt"
+ tmake_file="${tmake_file} arm/t-arm arm/t-vxworks"
+ ;;
+arm*-*-netbsdelf*)
+ tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ tmake_file="${tmake_file} arm/t-arm"
+ ;;
+arm*-*-linux-*) # ARM GNU/Linux with ELF
+ tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
+ extra_options="${extra_options} linux-android.opt"
+ case $target in
+ arm*b-*-linux*)
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+ ;;
+ esac
+ tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
+ tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h vxworks-dummy.h arm/arm.h"
+ # Define multilib configuration for arm-linux-androideabi.
+ case ${target} in
+ *-androideabi)
+ tmake_file="$tmake_file arm/t-linux-androideabi"
+ ;;
+ esac
+ # The EABI requires the use of __cxa_atexit.
+ default_use_cxa_atexit=yes
+ with_tls=${with_tls:-gnu}
+ ;;
+arm*-*-uclinux*eabi*) # ARM ucLinux
+ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
+ tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi"
+ tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h arm/aout.h vxworks-dummy.h arm/arm.h"
+ # The EABI requires the use of __cxa_atexit.
+ default_use_cxa_atexit=yes
+ ;;
+arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*)
+ case ${target} in
+ arm*eb-*-eabi*)
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+ esac
+ default_use_cxa_atexit=yes
+ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
+ tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf"
+ case ${target} in
+ arm*-*-eabi*)
+ tm_file="$tm_file newlib-stdint.h"
+ tmake_file="${tmake_file} arm/t-bpabi"
+ use_gcc_stdint=wrap
+ ;;
+ arm*-*-rtems*)
+ tm_file="${tm_file} rtems.h arm/rtems-eabi.h newlib-stdint.h"
+ tmake_file="${tmake_file} arm/t-bpabi arm/t-rtems-eabi"
+ ;;
+ arm*-*-symbianelf*)
+ tm_file="${tm_file} arm/symbian.h"
+ # We do not include t-bpabi for Symbian OS because the system
+ # provides its own implementation of the BPABI functions.
+ tmake_file="${tmake_file} arm/t-symbian"
+ ;;
+ esac
+ tm_file="${tm_file} arm/aout.h vxworks-dummy.h arm/arm.h"
+ ;;
+avr-*-rtems*)
+ tm_file="elfos.h avr/elf.h avr/avr-arch.h avr/avr.h dbxelf.h avr/rtems.h rtems.h newlib-stdint.h"
+ tmake_file="${tmake_file} avr/t-avr avr/t-multilib avr/t-rtems"
+ extra_gcc_objs="driver-avr.o avr-devices.o"
+ extra_objs="avr-devices.o avr-log.o"
+ ;;
+avr-*-*)
+ tm_file="elfos.h avr/elf.h avr/avr-arch.h avr/avr.h dbxelf.h avr/avr-stdint.h"
+ if test x${with_avrlibc} != xno; then
+ tm_file="${tm_file} ${cpu_type}/avrlibc.h"
+ tm_defines="${tm_defines} WITH_AVRLIBC"
+ fi
+ tmake_file="${tmake_file} avr/t-avr avr/t-multilib"
+ use_gcc_stdint=wrap
+ extra_gcc_objs="driver-avr.o avr-devices.o"
+ extra_objs="avr-devices.o avr-log.o"
+ ;;
+bfin*-elf*)
+ tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
+ tmake_file=bfin/t-bfin-elf
+ use_collect2=no
+ ;;
+bfin*-uclinux*)
+ tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/uclinux.h"
+ tmake_file=bfin/t-bfin-uclinux
+ use_collect2=no
+ ;;
+bfin*-linux-uclibc*)
+ tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/linux.h ./linux-sysroot-suffix.h"
+ tmake_file="bfin/t-bfin-linux t-slibgcc t-linux"
+ use_collect2=no
+ ;;
+bfin*-rtems*)
+ tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h newlib-stdint.h"
+ tmake_file="${tmake_file} bfin/t-rtems"
+ ;;
+bfin*-*)
+ tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
+ use_collect2=no
+ use_gcc_stdint=wrap
+ ;;
+cr16-*-elf)
+ tm_file="elfos.h ${tm_file}"
+ tmake_file="${tmake_file} cr16/t-cr16 "
+ use_collect2=no
+ ;;
+crisv32-*-elf | crisv32-*-none)
+ tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+ tmake_file="cris/t-cris"
+ target_cpu_default=32
+ gas=yes
+ extra_options="${extra_options} cris/elf.opt"
+ use_gcc_stdint=wrap
+ ;;
+cris-*-elf | cris-*-none)
+ tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+ tmake_file="cris/t-cris cris/t-elfmulti"
+ gas=yes
+ extra_options="${extra_options} cris/elf.opt"
+ use_gcc_stdint=wrap
+ ;;
+crisv32-*-linux* | cris-*-linux*)
+ tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h cris/linux.h"
+ tmake_file="${tmake_file} cris/t-cris cris/t-linux"
+ extra_options="${extra_options} cris/linux.opt"
+ case $target in
+ cris-*-*)
+ target_cpu_default=10
+ ;;
+ crisv32-*-*)
+ target_cpu_default=32
+ ;;
+ esac
+ ;;
+epiphany-*-elf )
+ tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+ tmake_file="epiphany/t-epiphany"
+ extra_options="${extra_options} fused-madd.opt"
+ extra_objs="$extra_objs mode-switch-use.o resolve-sw-modes.o"
+ tm_defines="${tm_defines} EPIPHANY_STACK_OFFSET=${with_stack_offset:-8}"
+ extra_headers="epiphany_intrinsics.h"
+ ;;
+fr30-*-elf)
+ tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+ ;;
+frv-*-elf)
+ tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+ tmake_file=frv/t-frv
+ ;;
+frv-*-*linux*)
+ tm_file="dbxelf.h elfos.h ${tm_file} \
+ gnu-user.h linux.h glibc-stdint.h frv/linux.h"
+ tmake_file="${tmake_file} frv/t-frv frv/t-linux"
+ ;;
+moxie-*-elf)
+ gas=yes
+ gnu_ld=yes
+ tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+ tmake_file="${tmake_file} moxie/t-moxie"
+ ;;
+moxie-*-uclinux*)
+ gas=yes
+ gnu_ld=yes
+ tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h"
+ tmake_file="${tmake_file} moxie/t-moxie"
+ ;;
+moxie-*-rtems*)
+ tmake_file="${tmake_file} moxie/t-moxie"
+ tm_file="moxie/moxie.h dbxelf.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h"
+ ;;
+h8300-*-rtems*)
+ tmake_file="${tmake_file} h8300/t-h8300 h8300/t-rtems"
+ tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h h8300/rtems.h rtems.h newlib-stdint.h"
+ ;;
+h8300-*-elf*)
+ tmake_file="h8300/t-h8300"
+ tm_file="h8300/h8300.h dbxelf.h elfos.h newlib-stdint.h h8300/elf.h"
+ ;;
+hppa*64*-*-linux*)
+ target_cpu_default="MASK_PA_11|MASK_PA_20"
+ tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h gnu-user.h linux.h \
+ glibc-stdint.h pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h \
+ pa/pa64-linux.h"
+ gas=yes gnu_ld=yes
+ need_64bit_hwint=yes
+ ;;
+hppa*-*-linux*)
+ target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
+ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h pa/pa-linux.h \
+ pa/pa32-regs.h pa/pa32-linux.h"
+ tmake_file="${tmake_file} pa/t-linux"
+ ;;
+hppa*-*-openbsd*)
+ target_cpu_default="MASK_PA_11"
+ tm_file="${tm_file} dbxelf.h elfos.h openbsd.h openbsd-stdint.h openbsd-libpthread.h \
+ pa/pa-openbsd.h pa/pa32-regs.h pa/pa32-openbsd.h"
+ extra_options="${extra_options} openbsd.opt"
+ gas=yes
+ gnu_ld=yes
+ ;;
+hppa[12]*-*-hpux10*)
+ case ${target} in
+ hppa1.1-*-* | hppa2*-*-*)
+ target_cpu_default="MASK_PA_11"
+ ;;
+ esac
+ tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
+ pa/pa-hpux.h pa/pa-hpux10.h"
+ extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux10.opt"
+ case ${target} in
+ *-*-hpux10.[1-9]*)
+ tm_file="${tm_file} pa/pa-hpux1010.h"
+ extra_options="${extra_options} pa/pa-hpux1010.opt"
+ ;;
+ esac
+ use_gcc_stdint=provide
+ tm_file="${tm_file} hpux-stdint.h"
+ tmake_file="t-slibgcc"
+ case ${enable_threads} in
+ "")
+ if test x$have_pthread_h = xyes ; then
+ tmake_file="${tmake_file} pa/t-dce-thr"
+ fi
+ ;;
+ yes | dce)
+ tmake_file="${tmake_file} pa/t-dce-thr"
+ ;;
+ esac
+ use_collect2=yes
+ gas=yes
+ if test "x$with_dwarf2" != x; then
+ echo "Warning: dwarf2 debug format is not supported for this target, --with-dwarf2 ignored" 1>&2
+ dwarf2=no
+ fi
+ ;;
+hppa*64*-*-hpux11*)
+ target_cpu_default="MASK_PA_11|MASK_PA_20"
+ if test x$gnu_ld = xyes
+ then
+ target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
+ fi
+ tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \
+ pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \
+ pa/pa-hpux11.h"
+ case ${target} in
+ *-*-hpux11.[12]*)
+ tm_file="${tm_file} pa/pa-hpux1111.h pa/pa-64.h pa/pa64-hpux.h"
+ extra_options="${extra_options} pa/pa-hpux1111.opt"
+ ;;
+ *-*-hpux11.[3-9]*)
+ tm_file="${tm_file} pa/pa-hpux1131.h pa/pa-64.h pa/pa64-hpux.h"
+ extra_options="${extra_options} pa/pa-hpux1131.opt"
+ ;;
+ *)
+ tm_file="${tm_file} pa/pa-64.h pa/pa64-hpux.h"
+ ;;
+ esac
+ extra_options="${extra_options} pa/pa-hpux.opt \
+ pa/pa-hpux1010.opt pa/pa64-hpux.opt hpux11.opt"
+ need_64bit_hwint=yes
+ tmake_file="t-slibgcc"
+ case x${enable_threads} in
+ x | xyes | xposix )
+ thread_file=posix
+ ;;
+ esac
+ gas=yes
+ case ${target} in
+ *-*-hpux11.[01]*)
+ use_gcc_stdint=provide
+ tm_file="${tm_file} hpux-stdint.h"
+ ;;
+ *-*-hpux11.[23]*)
+ use_gcc_stdint=wrap
+ tm_file="${tm_file} hpux-stdint.h"
+ ;;
+ esac
+ ;;
+hppa[12]*-*-hpux11*)
+ case ${target} in
+ hppa1.1-*-* | hppa2*-*-*)
+ target_cpu_default="MASK_PA_11"
+ ;;
+ esac
+ tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
+ pa/pa-hpux.h pa/pa-hpux1010.h pa/pa-hpux11.h"
+ extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux1010.opt \
+ hpux11.opt"
+ case ${target} in
+ *-*-hpux11.[12]*)
+ tm_file="${tm_file} pa/pa-hpux1111.h"
+ extra_options="${extra_options} pa/pa-hpux1111.opt"
+ ;;
+ *-*-hpux11.[3-9]*)
+ tm_file="${tm_file} pa/pa-hpux1131.h"
+ extra_options="${extra_options} pa/pa-hpux1131.opt"
+ ;;
+ esac
+ tmake_file="t-slibgcc"
+ case x${enable_threads} in
+ x | xyes | xposix )
+ thread_file=posix
+ ;;
+ esac
+ use_collect2=yes
+ gas=yes
+ case ${target} in
+ *-*-hpux11.[01]*)
+ use_gcc_stdint=provide
+ tm_file="${tm_file} hpux-stdint.h"
+ ;;
+ *-*-hpux11.[23]*)
+ use_gcc_stdint=wrap
+ tm_file="${tm_file} hpux-stdint.h"
+ ;;
+ esac
+ if test "x$with_dwarf2" != x; then
+ echo "Warning: dwarf2 debug format is not supported for this target, --with-dwarf2 ignored" 1>&2
+ dwarf2=no
+ fi
+ ;;
+i[34567]86-*-darwin*)
+ need_64bit_isa=yes
+ # Baseline choice for a machine that allows m64 support.
+ with_cpu=${with_cpu:-core2}
+ tmake_file="${tmake_file} t-slibgcc"
+ ;;
+x86_64-*-darwin*)
+ with_cpu=${with_cpu:-core2}
+ tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc"
+ tm_file="${tm_file} ${cpu_type}/darwin64.h"
+ ;;
+i[34567]86-*-elf*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
+ ;;
+x86_64-*-elf*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
+ ;;
+i[34567]86-*-rdos*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/rdos.h"
+ ;;
+x86_64-*-rdos*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rdos.h i386/rdos64.h"
+ tmake_file="i386/t-i386elf t-svr4"
+ ;;
+i[34567]86-*-freebsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
+ ;;
+x86_64-*-freebsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
+ ;;
+i[34567]86-*-netbsdelf*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ ;;
+x86_64-*-netbsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ ;;
+i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
+ tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h"
+ extra_options="${extra_options} openbsd.opt"
+ # needed to unconfuse gdb
+ tmake_file="${tmake_file} t-openbsd i386/t-openbsd"
+ # we need collect2 until our bug is fixed...
+ use_collect2=yes
+ ;;
+i[34567]86-*-openbsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
+ tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h"
+ extra_options="${extra_options} openbsd.opt"
+ gas=yes
+ gnu_ld=yes
+ ;;
+x86_64-*-openbsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
+ tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/x86-64.h i386/openbsdelf.h"
+ extra_options="${extra_options} openbsd.opt"
+ gas=yes
+ gnu_ld=yes
+ ;;
+i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
+ # Intel 80386's running GNU/*
+ # with ELF format using glibc 2
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h"
+ case ${target} in
+ i[34567]86-*-linux*)
+ tm_file="${tm_file} linux.h linux-android.h"
+ extra_options="${extra_options} linux-android.opt"
+ # Assume modern glibc
+ default_gnu_indirect_function=yes
+ if test x$enable_targets = xall; then
+ tm_file="${tm_file} i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h i386/linux-common.h i386/linux64.h"
+ tm_defines="${tm_defines} TARGET_BI_ARCH=1"
+ tmake_file="${tmake_file} i386/t-linux64"
+ x86_multilibs="${with_multilib_list}"
+ if test "$x86_multilibs" = "default"; then
+ x86_multilibs="m64,m32"
+ fi
+ x86_multilibs=`echo $x86_multilibs | sed -e 's/,/ /g'`
+ for x86_multilib in ${x86_multilibs}; do
+ case ${x86_multilib} in
+ m32 | m64 | mx32)
+ TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${x86_multilib}"
+ ;;
+ *)
+ echo "--with-multilib-list=${x86_with_multilib} not supported."
+ exit 1
+ esac
+ done
+ TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
+ need_64bit_isa=yes
+ if test x$with_cpu = x; then
+ if test x$with_cpu_64 = x; then
+ with_cpu_64=generic
+ fi
+ else
+ case " $x86_cpus $x86_archs $x86_64_archs " in
+ *" $with_cpu "*)
+ ;;
+ *)
+ echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
+ echo "$x86_cpus $x86_archs $x86_64_archs " 1>&2
+ exit 1
+ ;;
+ esac
+ fi
+ else
+ tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux-common.h i386/linux.h"
+ fi
+ ;;
+ i[34567]86-*-knetbsd*-gnu)
+ tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h knetbsd-gnu.h i386/knetbsd-gnu.h"
+ ;;
+ i[34567]86-*-kfreebsd*-gnu)
+ tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kfreebsd-gnu.h i386/kfreebsd-gnu.h"
+ ;;
+ i[34567]86-*-kopensolaris*-gnu)
+ tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kopensolaris-gnu.h i386/kopensolaris-gnu.h"
+ ;;
+ i[34567]86-*-gnu*)
+ tm_file="$tm_file i386/gnu-user-common.h i386/gnu-user.h gnu.h i386/gnu.h"
+ ;;
+ esac
+ ;;
+x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
+ i386/