move support for non-latest versions in gcc 5 and 6 series
this is to prevent unbounded growth of patch sets to be maintained and backported to.
This commit is contained in:
parent
9f502174c2
commit
b0d7c70efe
|
@ -1 +0,0 @@
|
|||
fe3f5390949d47054b613edc36c557eb1d51c18e gcc-5.2.0.tar.bz2
|
|
@ -1 +0,0 @@
|
|||
583e29c7fe69d9a1031a89752c2551ab5aeacb91 gcc-6.2.0.tar.bz2
|
|
@ -1 +0,0 @@
|
|||
928ab552666ee08eed645ff20ceb49d139205dea gcc-6.3.0.tar.bz2
|
|
@ -1,892 +0,0 @@
|
|||
diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
|
||||
index 6653fed..0d96c8c 100755
|
||||
--- a/fixincludes/mkfixinc.sh
|
||||
+++ b/fixincludes/mkfixinc.sh
|
||||
@@ -19,7 +19,8 @@ case $machine in
|
||||
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 --git a/gcc/config.gcc b/gcc/config.gcc
|
||||
index 3ede69b..d9eb8cf 100644
|
||||
--- a/gcc/config.gcc
|
||||
+++ b/gcc/config.gcc
|
||||
@@ -575,7 +575,7 @@ case ${target} in
|
||||
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.
|
||||
@@ -720,6 +720,9 @@ case ${target} in
|
||||
*-*-*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"
|
||||
;;
|
||||
diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
|
||||
index ba7fc3b..1600a32 100644
|
||||
--- a/gcc/config/aarch64/aarch64-linux.h
|
||||
+++ b/gcc/config/aarch64/aarch64-linux.h
|
||||
@@ -23,6 +23,9 @@
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
|
||||
|
||||
+#undef MUSL_DYNAMIC_LINKER
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
|
||||
+
|
||||
#undef ASAN_CC1_SPEC
|
||||
#define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
|
||||
|
||||
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
|
||||
index c567f43..475ea06 100644
|
||||
--- a/gcc/config/alpha/linux.h
|
||||
+++ b/gcc/config/alpha/linux.h
|
||||
@@ -61,10 +61,14 @@ along with GCC; see the file COPYING3. If not see
|
||||
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL
|
||||
+#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)
|
||||
+#undef OPTION_MUSL
|
||||
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
||||
#endif
|
||||
|
||||
/* Determine what functions are present at the runtime;
|
||||
diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
|
||||
index e9d65dc..f12e6bd 100644
|
||||
--- a/gcc/config/arm/linux-eabi.h
|
||||
+++ b/gcc/config/arm/linux-eabi.h
|
||||
@@ -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 --git a/gcc/config/glibc-stdint.h b/gcc/config/glibc-stdint.h
|
||||
index 3fc67dc..98f4f04 100644
|
||||
--- a/gcc/config/glibc-stdint.h
|
||||
+++ b/gcc/config/glibc-stdint.h
|
||||
@@ -22,6 +22,12 @@ a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
+/* Systems using musl libc should use this header and make sure
|
||||
+ OPTION_MUSL is defined correctly before using the TYPE macros. */
|
||||
+#ifndef OPTION_MUSL
|
||||
+#define OPTION_MUSL 0
|
||||
+#endif
|
||||
+
|
||||
#define SIG_ATOMIC_TYPE "int"
|
||||
|
||||
#define INT8_TYPE "signed char"
|
||||
@@ -43,12 +49,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
|
||||
|
||||
#define INT_FAST8_TYPE "signed char"
|
||||
-#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
|
||||
-#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
|
||||
+#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int")
|
||||
+#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int")
|
||||
#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
|
||||
#define UINT_FAST8_TYPE "unsigned char"
|
||||
-#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
|
||||
-#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
|
||||
+#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int")
|
||||
+#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int")
|
||||
#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
|
||||
|
||||
#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
|
||||
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
|
||||
index a100963..385aefd 100644
|
||||
--- a/gcc/config/i386/linux.h
|
||||
+++ b/gcc/config/i386/linux.h
|
||||
@@ -21,3 +21,6 @@ along with GCC; see the file COPYING3. If not see
|
||||
|
||||
#define GNU_USER_LINK_EMULATION "elf_i386"
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
+
|
||||
+#undef MUSL_DYNAMIC_LINKER
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
|
||||
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
|
||||
index a27d3be..e300480 100644
|
||||
--- a/gcc/config/i386/linux64.h
|
||||
+++ b/gcc/config/i386/linux64.h
|
||||
@@ -30,3 +30,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#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"
|
||||
+
|
||||
+#undef MUSL_DYNAMIC_LINKER32
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
|
||||
+#undef MUSL_DYNAMIC_LINKER64
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
|
||||
+#undef MUSL_DYNAMIC_LINKERX32
|
||||
+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
|
||||
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
|
||||
index 857389a..7bc87ab 100644
|
||||
--- a/gcc/config/linux.h
|
||||
+++ b/gcc/config/linux.h
|
||||
@@ -32,10 +32,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL
|
||||
+#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)
|
||||
+#undef OPTION_MUSL
|
||||
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
||||
#endif
|
||||
|
||||
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
|
||||
@@ -50,21 +54,25 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
} while (0)
|
||||
|
||||
/* Determine which dynamic linker to use depending on whether GLIBC or
|
||||
- uClibc or Bionic is the default C library and whether
|
||||
- -muclibc or -mglibc or -mbionic has been passed to change the default. */
|
||||
+ uClibc or Bionic or musl is the default C library and whether
|
||||
+ -muclibc or -mglibc or -mbionic or -mmusl 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 */
|
||||
@@ -81,24 +89,100 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
|
||||
#define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
|
||||
#define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32"
|
||||
+/* Should be redefined for each target that supports musl. */
|
||||
+#define MUSL_DYNAMIC_LINKER "/dev/null"
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/dev/null"
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/dev/null"
|
||||
+#define MUSL_DYNAMIC_LINKERX32 "/dev/null"
|
||||
|
||||
#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 --git a/gcc/config/linux.opt b/gcc/config/linux.opt
|
||||
index c054338..ef055a7 100644
|
||||
--- a/gcc/config/linux.opt
|
||||
+++ b/gcc/config/linux.opt
|
||||
@@ -28,5 +28,9 @@ Target Report RejectNegative Var(linux_libc,LIBC_GLIBC) Negative(muclibc)
|
||||
Use GNU C library
|
||||
|
||||
muclibc
|
||||
-Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
|
||||
+Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mmusl)
|
||||
Use uClibc C library
|
||||
+
|
||||
+mmusl
|
||||
+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mbionic)
|
||||
+Use musl C library
|
||||
diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h
|
||||
index 655a70f..a8a3f3e 100644
|
||||
--- a/gcc/config/microblaze/linux.h
|
||||
+++ b/gcc/config/microblaze/linux.h
|
||||
@@ -28,10 +28,20 @@
|
||||
#undef TLS_NEEDS_GOT
|
||||
#define TLS_NEEDS_GOT 1
|
||||
|
||||
-#define DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
+
|
||||
+#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:;:el}"
|
||||
+#else
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:el}"
|
||||
+#endif
|
||||
+
|
||||
+#undef MUSL_DYNAMIC_LINKER
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1"
|
||||
+
|
||||
#undef SUBTARGET_EXTRA_SPECS
|
||||
#define SUBTARGET_EXTRA_SPECS \
|
||||
- { "dynamic_linker", DYNAMIC_LINKER }
|
||||
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "%{shared:-shared} \
|
||||
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
|
||||
index 91df261..fb358e2 100644
|
||||
--- a/gcc/config/mips/linux.h
|
||||
+++ b/gcc/config/mips/linux.h
|
||||
@@ -37,7 +37,13 @@ along with GCC; see the file COPYING3. If not see
|
||||
#define UCLIBC_DYNAMIC_LINKERN32 \
|
||||
"%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
|
||||
|
||||
+#undef MUSL_DYNAMIC_LINKER32
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips%{EL:el}%{msoft-float:-sf}.so.1"
|
||||
+#undef MUSL_DYNAMIC_LINKER64
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips64%{EL:el}%{msoft-float:-sf}.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mipsn32%{EL:el}%{msoft-float:-sf}.so.1"
|
||||
+
|
||||
#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
|
||||
#define GNU_USER_DYNAMIC_LINKERN32 \
|
||||
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
|
||||
- BIONIC_DYNAMIC_LINKERN32)
|
||||
+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
|
||||
diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
|
||||
index fe0ebd6..a68ff69 100644
|
||||
--- a/gcc/config/rs6000/linux.h
|
||||
+++ b/gcc/config/rs6000/linux.h
|
||||
@@ -30,10 +30,14 @@
|
||||
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL
|
||||
+#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)
|
||||
+#undef OPTION_MUSL
|
||||
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
||||
#endif
|
||||
|
||||
/* Determine what functions are present at the runtime;
|
||||
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
|
||||
index 0879e7e..6a7d435 100644
|
||||
--- a/gcc/config/rs6000/linux64.h
|
||||
+++ b/gcc/config/rs6000/linux64.h
|
||||
@@ -299,10 +299,14 @@ extern int dot_symbols;
|
||||
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
|
||||
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
|
||||
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
|
||||
+#undef OPTION_MUSL
|
||||
+#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)
|
||||
+#undef OPTION_MUSL
|
||||
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
|
||||
#endif
|
||||
|
||||
/* Determine what functions are present at the runtime;
|
||||
@@ -365,17 +369,23 @@ extern int dot_symbols;
|
||||
#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" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKER64 \
|
||||
+ "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.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 --git a/gcc/config/rs6000/secureplt.h b/gcc/config/rs6000/secureplt.h
|
||||
index b463463..77edf2a 100644
|
||||
--- a/gcc/config/rs6000/secureplt.h
|
||||
+++ b/gcc/config/rs6000/secureplt.h
|
||||
@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
|
||||
+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
|
||||
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
|
||||
index 9917c2f..68365de 100644
|
||||
--- a/gcc/config/rs6000/sysv4.h
|
||||
+++ b/gcc/config/rs6000/sysv4.h
|
||||
@@ -537,6 +537,9 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
|
||||
#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. */
|
||||
#undef CC1_SPEC
|
||||
@@ -586,7 +589,8 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
|
||||
|
||||
/* 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 "\
|
||||
@@ -762,17 +766,23 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
|
||||
|
||||
#define LINK_START_LINUX_SPEC ""
|
||||
|
||||
+#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","")
|
||||
+
|
||||
#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" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.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} \
|
||||
@@ -895,6 +905,7 @@ ncrtn.o%s"
|
||||
{ "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 }, \
|
||||
@@ -949,3 +960,72 @@ ncrtn.o%s"
|
||||
/* This target uses the sysv4.opt file. */
|
||||
#define TARGET_USES_SYSV4_OPT 1
|
||||
|
||||
+/* Include order changes for musl, same as in generic linux.h. */
|
||||
+#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
|
||||
diff --git a/gcc/config/rs6000/sysv4le.h b/gcc/config/rs6000/sysv4le.h
|
||||
index 7b1d6a1..064323c 100644
|
||||
--- a/gcc/config/rs6000/sysv4le.h
|
||||
+++ b/gcc/config/rs6000/sysv4le.h
|
||||
@@ -35,3 +35,5 @@
|
||||
/* Little-endian PowerPC64 Linux uses the ELF v2 ABI by default. */
|
||||
#define LINUX64_DEFAULT_ABI_ELFv2
|
||||
|
||||
+#undef MUSL_DYNAMIC_LINKER_E
|
||||
+#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","le")
|
||||
diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
|
||||
index 0f5d614..4c167c6 100644
|
||||
--- a/gcc/config/sh/linux.h
|
||||
+++ b/gcc/config/sh/linux.h
|
||||
@@ -43,6 +43,29 @@ along with GCC; see the file COPYING3. If not see
|
||||
|
||||
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
|
||||
|
||||
+#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{mb:eb}"
|
||||
+#else
|
||||
+#define MUSL_DYNAMIC_LINKER_E "%{!ml:eb}"
|
||||
+#endif
|
||||
+
|
||||
+#if TARGET_CPU_DEFAULT & ( MASK_HARD_SH2A_DOUBLE | MASK_SH4 )
|
||||
+/* "-nofpu" if any nofpu option is specified */
|
||||
+#define MUSL_DYNAMIC_LINKER_FP \
|
||||
+ "%{m1|m2|m2a-nofpu|m3|m4-nofpu|m4-100-nofpu|m4-200-nofpu|m4-300-nofpu|" \
|
||||
+ "m4-340|m4-400|m4-500|m4al|m5-32media-nofpu|m5-64media-nofpu|" \
|
||||
+ "m5-compact-nofpu:-nofpu}"
|
||||
+#else
|
||||
+/* "-nofpu" if none of the hard fpu options are specified */
|
||||
+#define MUSL_DYNAMIC_LINKER_FP \
|
||||
+ "%{m2a|m4|m4-100|m4-200|m4-300|m4a|m5-32media|m5-64media|m5-compact:;:-nofpu}"
|
||||
+#endif
|
||||
+
|
||||
+#undef MUSL_DYNAMIC_LINKER
|
||||
+#define MUSL_DYNAMIC_LINKER \
|
||||
+ "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP \
|
||||
+ "%{mfdpic:-fdpic}.so.1"
|
||||
+
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
|
||||
#undef SUBTARGET_LINK_EMUL_SUFFIX
|
||||
diff --git a/gcc/configure b/gcc/configure
|
||||
index 0037240..66aab9f 100755
|
||||
--- a/gcc/configure
|
||||
+++ b/gcc/configure
|
||||
@@ -27742,6 +27742,9 @@ if test "${gcc_cv_libc_provides_ssp+set}" = set; then :
|
||||
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.
|
||||
@@ -27774,6 +27777,7 @@ fi
|
||||
# <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"
|
||||
@@ -27870,6 +27874,9 @@ case "$target" in
|
||||
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 --git a/gcc/configure.ac b/gcc/configure.ac
|
||||
index 6f38ba1..b81960c 100644
|
||||
--- a/gcc/configure.ac
|
||||
+++ b/gcc/configure.ac
|
||||
@@ -5229,6 +5229,9 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
|
||||
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.
|
||||
@@ -5255,6 +5258,7 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
|
||||
# <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],
|
||||
@@ -5328,6 +5332,9 @@ case "$target" in
|
||||
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
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index f84a199..ee9765b 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -667,7 +667,7 @@ Objective-C and Objective-C++ Dialects}.
|
||||
-mcpu=@var{cpu}}
|
||||
|
||||
@emph{GNU/Linux Options}
|
||||
-@gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
|
||||
+@gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol
|
||||
-tno-android-cc -tno-android-ld}
|
||||
|
||||
@emph{H8/300 Options}
|
||||
@@ -15324,13 +15324,19 @@ These @samp{-m} options are defined for GNU/Linux targets:
|
||||
@item -mglibc
|
||||
@opindex mglibc
|
||||
Use the GNU C library. This is the default except
|
||||
-on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
|
||||
+on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
|
||||
+@samp{*-*-linux-*android*} targets.
|
||||
|
||||
@item -muclibc
|
||||
@opindex muclibc
|
||||
Use uClibc C library. This is the default on
|
||||
@samp{*-*-linux-*uclibc*} targets.
|
||||
|
||||
+@item -mmusl
|
||||
+@opindex mmusl
|
||||
+Use the musl C library. This is the default on
|
||||
+@samp{*-*-linux-*musl*} targets.
|
||||
+
|
||||
@item -mbionic
|
||||
@opindex mbionic
|
||||
Use Bionic C library. This is the default on
|
||||
diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
|
||||
index cb582dd..e43d7d5 100644
|
||||
--- a/libcilkrts/runtime/os-unix.c
|
||||
+++ b/libcilkrts/runtime/os-unix.c
|
||||
@@ -51,6 +51,7 @@
|
||||
#if defined __linux__
|
||||
# include <sys/sysinfo.h>
|
||||
# include <sys/syscall.h>
|
||||
+# include <sched.h>
|
||||
#elif defined __APPLE__
|
||||
# include <sys/sysctl.h>
|
||||
// Uses sysconf(_SC_NPROCESSORS_ONLN) in verbose output
|
||||
@@ -400,28 +401,19 @@ COMMON_SYSDEP void __cilkrts_sleep(void)
|
||||
|
||||
COMMON_SYSDEP void __cilkrts_yield(void)
|
||||
{
|
||||
-#if __APPLE__ || __FreeBSD__ || __VXWORKS__
|
||||
- // On MacOS, call sched_yield to yield quantum. I'm not sure why we
|
||||
- // don't do this on Linux also.
|
||||
- sched_yield();
|
||||
-#elif defined(__DragonFly__)
|
||||
- // On DragonFly BSD, call sched_yield to yield quantum.
|
||||
- sched_yield();
|
||||
-#elif defined(__MIC__)
|
||||
+#if defined(__MIC__)
|
||||
// On MIC, pthread_yield() really trashes things. Arch's measurements
|
||||
// showed that calling _mm_delay_32() (or doing nothing) was a better
|
||||
// option. Delaying 1024 clock cycles is a reasonable compromise between
|
||||
// giving up the processor and latency starting up when work becomes
|
||||
// available
|
||||
_mm_delay_32(1024);
|
||||
-#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
|
||||
- // On Android and Solaris, call sched_yield to yield quantum. I'm not
|
||||
- // sure why we don't do this on Linux also.
|
||||
- sched_yield();
|
||||
-#else
|
||||
- // On Linux, call pthread_yield (which in turn will call sched_yield)
|
||||
- // to yield quantum.
|
||||
+#elif defined(__sun__) && !defined(__svr4__)
|
||||
+ // On old SunOS call pthread_yield to yield a quantum.
|
||||
pthread_yield();
|
||||
+#else
|
||||
+ // On other platforms call sched_yield to yield a quantum.
|
||||
+ sched_yield();
|
||||
#endif
|
||||
}
|
||||
|
||||
diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
|
||||
index e1e566b..137dced 100644
|
||||
--- a/libgcc/unwind-dw2-fde-dip.c
|
||||
+++ b/libgcc/unwind-dw2-fde-dip.c
|
||||
@@ -59,6 +59,12 @@
|
||||
|
||||
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
&& defined(TARGET_DL_ITERATE_PHDR) \
|
||||
+ && defined(__linux__)
|
||||
+# define USE_PT_GNU_EH_FRAME
|
||||
+#endif
|
||||
+
|
||||
+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
|
||||
+ && defined(TARGET_DL_ITERATE_PHDR) \
|
||||
&& (defined(__DragonFly__) || defined(__FreeBSD__))
|
||||
# define ElfW __ElfN
|
||||
# define USE_PT_GNU_EH_FRAME
|
||||
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
|
||||
index ba890f9..30b8b1a6 100644
|
||||
--- a/libgfortran/acinclude.m4
|
||||
+++ b/libgfortran/acinclude.m4
|
||||
@@ -100,7 +100,7 @@ void foo (void);
|
||||
[Define to 1 if the target supports #pragma weak])
|
||||
fi
|
||||
case "$host" in
|
||||
- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
|
||||
+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
|
||||
AC_DEFINE(GTHREAD_USE_WEAK, 0,
|
||||
[Define to 0 if the target shouldn't use #pragma weak])
|
||||
;;
|
||||
diff --git a/libgfortran/configure b/libgfortran/configure
|
||||
index e1592f7..07542e1 100755
|
||||
--- a/libgfortran/configure
|
||||
+++ b/libgfortran/configure
|
||||
@@ -26447,7 +26447,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
case "$host" in
|
||||
- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
|
||||
+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
|
||||
|
||||
$as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
|
||||
|
||||
diff --git a/libitm/config/arm/hwcap.cc b/libitm/config/arm/hwcap.cc
|
||||
index a1c2cfd..ea8f023 100644
|
||||
--- a/libitm/config/arm/hwcap.cc
|
||||
+++ b/libitm/config/arm/hwcap.cc
|
||||
@@ -40,7 +40,7 @@ int GTM_hwcap HIDDEN = 0
|
||||
|
||||
#ifdef __linux__
|
||||
#include <unistd.h>
|
||||
-#include <sys/fcntl.h>
|
||||
+#include <fcntl.h>
|
||||
#include <elf.h>
|
||||
|
||||
static void __attribute__((constructor))
|
||||
diff --git a/libitm/config/linux/x86/tls.h b/libitm/config/linux/x86/tls.h
|
||||
index e731ab7..54ad8b6 100644
|
||||
--- a/libitm/config/linux/x86/tls.h
|
||||
+++ b/libitm/config/linux/x86/tls.h
|
||||
@@ -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 @@ static inline void set_abi_disp(struct abi_dispatch *x)
|
||||
|
||||
} // namespace GTM
|
||||
#endif /* >= GLIBC 2.10 */
|
||||
+#endif
|
||||
|
||||
#endif // LIBITM_X86_TLS_H
|
||||
diff --git a/libstdc++-v3/config/os/generic/os_defines.h b/libstdc++-v3/config/os/generic/os_defines.h
|
||||
index 45bf52a..103ec0e 100644
|
||||
--- a/libstdc++-v3/config/os/generic/os_defines.h
|
||||
+++ b/libstdc++-v3/config/os/generic/os_defines.h
|
||||
@@ -33,4 +33,9 @@
|
||||
// System-specific #define, typedefs, corrections, etc, go here. This
|
||||
// file will come before all others.
|
||||
|
||||
+// Disable the weak reference logic in gthr.h for os/generic because it
|
||||
+// is broken on every platform unless there is implementation specific
|
||||
+// workaround in gthr-posix.h and at link-time for static linking.
|
||||
+#define _GLIBCXX_GTHREAD_USE_WEAK 0
|
||||
+
|
||||
#endif
|
||||
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
|
||||
index 640199c..106134e 100644
|
||||
--- a/libstdc++-v3/configure.host
|
||||
+++ b/libstdc++-v3/configure.host
|
||||
@@ -273,6 +273,9 @@ case "${host_os}" in
|
||||
freebsd*)
|
||||
os_include_dir="os/bsd/freebsd"
|
||||
;;
|
||||
+ linux-musl*)
|
||||
+ os_include_dir="os/generic"
|
||||
+ ;;
|
||||
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
|
||||
if [ "$uclibc" = "yes" ]; then
|
||||
os_include_dir="os/uclibc"
|
|
@ -1,138 +0,0 @@
|
|||
--- a/gcc/config/sh/sh-protos.h
|
||||
+++ a/gcc/config/sh/sh-protos.h
|
||||
@@ -159,6 +159,7 @@ extern int sh_eval_treg_value (rtx op);
|
||||
extern HOST_WIDE_INT sh_disp_addr_displacement (rtx mem_op);
|
||||
extern int sh_max_mov_insn_displacement (machine_mode mode, bool consider_sh2a);
|
||||
extern bool sh_movsf_ie_ra_split_p (rtx, rtx, rtx);
|
||||
+extern void sh_expand_sym_label2reg (rtx, rtx, rtx, bool);
|
||||
|
||||
/* Result value of sh_find_set_of_reg. */
|
||||
struct set_of_reg
|
||||
--- a/gcc/config/sh/sh.c
|
||||
+++ a/gcc/config/sh/sh.c
|
||||
@@ -1604,6 +1604,10 @@ sh_asm_output_addr_const_extra (FILE *file, rtx x)
|
||||
output_addr_const (file, XVECEXP (x, 0, 0));
|
||||
fputs ("@GOTPLT", file);
|
||||
break;
|
||||
+ case UNSPEC_PCREL:
|
||||
+ output_addr_const (file, XVECEXP (x, 0, 0));
|
||||
+ fputs ("@PCREL", file);
|
||||
+ break;
|
||||
case UNSPEC_DTPOFF:
|
||||
output_addr_const (file, XVECEXP (x, 0, 0));
|
||||
fputs ("@DTPOFF", file);
|
||||
@@ -10441,6 +10445,7 @@ nonpic_symbol_mentioned_p (rtx x)
|
||||
|| XINT (x, 1) == UNSPEC_DTPOFF
|
||||
|| XINT (x, 1) == UNSPEC_TPOFF
|
||||
|| XINT (x, 1) == UNSPEC_PLT
|
||||
+ || XINT (x, 1) == UNSPEC_PCREL
|
||||
|| XINT (x, 1) == UNSPEC_SYMOFF
|
||||
|| XINT (x, 1) == UNSPEC_PCREL_SYMOFF))
|
||||
return false;
|
||||
@@ -10714,7 +10719,8 @@ sh_delegitimize_address (rtx orig_x)
|
||||
rtx symplt = XEXP (XVECEXP (y, 0, 0), 0);
|
||||
|
||||
if (GET_CODE (symplt) == UNSPEC
|
||||
- && XINT (symplt, 1) == UNSPEC_PLT)
|
||||
+ && (XINT (symplt, 1) == UNSPEC_PLT
|
||||
+ || XINT (symplt, 1) == UNSPEC_PCREL))
|
||||
return XVECEXP (symplt, 0, 0);
|
||||
}
|
||||
}
|
||||
@@ -11702,9 +11708,24 @@ sh_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
|
||||
|| crtl->args.info.stack_regs == 0)
|
||||
&& ! sh_cfun_interrupt_handler_p ()
|
||||
&& (! flag_pic
|
||||
- || (decl && ! TREE_PUBLIC (decl))
|
||||
+ || (decl && ! (TREE_PUBLIC (decl) || DECL_WEAK (decl)))
|
||||
|| (decl && DECL_VISIBILITY (decl) != VISIBILITY_DEFAULT)));
|
||||
}
|
||||
+
|
||||
+/* Expand to appropriate sym*_label2reg for SYM and SIBCALL_P. */
|
||||
+void
|
||||
+sh_expand_sym_label2reg (rtx reg, rtx sym, rtx lab, bool sibcall_p)
|
||||
+{
|
||||
+ const_tree decl = SYMBOL_REF_DECL (sym);
|
||||
+ bool is_weak = (decl && DECL_P (decl) && DECL_WEAK (decl));
|
||||
+
|
||||
+ if (!is_weak && SYMBOL_REF_LOCAL_P (sym))
|
||||
+ emit_insn (gen_sym_label2reg (reg, sym, lab));
|
||||
+ else if (sibcall_p)
|
||||
+ emit_insn (gen_symPCREL_label2reg (reg, sym, lab));
|
||||
+ else
|
||||
+ emit_insn (gen_symPLT_label2reg (reg, sym, lab));
|
||||
+}
|
||||
|
||||
/* Machine specific built-in functions. */
|
||||
|
||||
--- a/gcc/config/sh/sh.md
|
||||
+++ a/gcc/config/sh/sh.md
|
||||
@@ -135,6 +135,7 @@
|
||||
UNSPEC_PLT
|
||||
UNSPEC_CALLER
|
||||
UNSPEC_GOTPLT
|
||||
+ UNSPEC_PCREL
|
||||
UNSPEC_ICACHE
|
||||
UNSPEC_INIT_TRAMP
|
||||
UNSPEC_FCOSA
|
||||
@@ -9470,11 +9471,8 @@ label:
|
||||
[(const_int 0)]
|
||||
{
|
||||
rtx lab = PATTERN (gen_call_site ());
|
||||
-
|
||||
- if (SYMBOL_REF_LOCAL_P (operands[0]))
|
||||
- emit_insn (gen_sym_label2reg (operands[2], operands[0], lab));
|
||||
- else
|
||||
- emit_insn (gen_symPLT_label2reg (operands[2], operands[0], lab));
|
||||
+
|
||||
+ sh_expand_sym_label2reg (operands[2], operands[0], lab, false);
|
||||
emit_call_insn (gen_calli_pcrel (operands[2], operands[1], copy_rtx (lab)));
|
||||
DONE;
|
||||
}
|
||||
@@ -9605,10 +9603,7 @@ label:
|
||||
{
|
||||
rtx lab = PATTERN (gen_call_site ());
|
||||
|
||||
- if (SYMBOL_REF_LOCAL_P (operands[1]))
|
||||
- emit_insn (gen_sym_label2reg (operands[3], operands[1], lab));
|
||||
- else
|
||||
- emit_insn (gen_symPLT_label2reg (operands[3], operands[1], lab));
|
||||
+ sh_expand_sym_label2reg (operands[3], operands[1], lab, false);
|
||||
emit_call_insn (gen_call_valuei_pcrel (operands[0], operands[3],
|
||||
operands[2], copy_rtx (lab)));
|
||||
DONE;
|
||||
@@ -10008,7 +10003,7 @@ label:
|
||||
rtx lab = PATTERN (gen_call_site ());
|
||||
rtx call_insn;
|
||||
|
||||
- emit_insn (gen_sym_label2reg (operands[2], operands[0], lab));
|
||||
+ sh_expand_sym_label2reg (operands[2], operands[0], lab, true);
|
||||
call_insn = emit_call_insn (gen_sibcalli_pcrel (operands[2], operands[1],
|
||||
copy_rtx (lab)));
|
||||
SIBLING_CALL_P (call_insn) = 1;
|
||||
@@ -10200,7 +10195,7 @@ label:
|
||||
rtx lab = PATTERN (gen_call_site ());
|
||||
rtx call_insn;
|
||||
|
||||
- emit_insn (gen_sym_label2reg (operands[3], operands[1], lab));
|
||||
+ sh_expand_sym_label2reg (operands[3], operands[1], lab, true);
|
||||
call_insn = emit_call_insn (gen_sibcall_valuei_pcrel (operands[0],
|
||||
operands[3],
|
||||
operands[2],
|
||||
@@ -10748,6 +10743,16 @@ label:
|
||||
UNSPEC_SYMOFF)))]
|
||||
"TARGET_SH1" "")
|
||||
|
||||
+(define_expand "symPCREL_label2reg"
|
||||
+ [(set (match_operand:SI 0 "" "")
|
||||
+ (const:SI
|
||||
+ (unspec:SI
|
||||
+ [(const:SI (unspec:SI [(match_operand:SI 1 "" "")] UNSPEC_PCREL))
|
||||
+ (const:SI (plus:SI (match_operand:SI 2 "" "")
|
||||
+ (const_int 2)))] UNSPEC_PCREL_SYMOFF)))]
|
||||
+ "TARGET_SH1"
|
||||
+ "")
|
||||
+
|
||||
(define_expand "symGOT_load"
|
||||
[(set (match_dup 2) (match_operand 1 "" ""))
|
||||
(set (match_dup 3) (plus (match_dup 2) (reg PIC_REG)))
|
|
@ -1,33 +0,0 @@
|
|||
--- gcc-5.2.0.orig/gcc/config.gcc
|
||||
+++ gcc-5.2.0/gcc/config.gcc
|
||||
@@ -4096,7 +4099,7 @@
|
||||
esac
|
||||
;;
|
||||
|
||||
- sh[123456ble]-*-* | sh-*-*)
|
||||
+ sh[123456ble]*-*-* | sh-*-*)
|
||||
supported_defaults="cpu"
|
||||
case "`echo $with_cpu | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz- | sed s/sh/m/`" in
|
||||
"" | m1 | m2 | m2e | m3 | m3e | m4 | m4-single | m4-single-only | m4-nofpu )
|
||||
--- gcc-5.2.0.base/gcc/configure.ac 2015-08-11 16:23:36.000000000 +0000
|
||||
+++ gcc-5.2.0/gcc/configure.ac 2015-09-13 08:17:31.714972082 +0000
|
||||
@@ -3300,7 +3300,7 @@
|
||||
tls_first_minor=14
|
||||
tls_as_opt="-m64 -Aesame --fatal-warnings"
|
||||
;;
|
||||
- sh-*-* | sh[34]-*-*)
|
||||
+ sh-*-* | sh[123456789lbe]*-*-*)
|
||||
conftest_s='
|
||||
.section ".tdata","awT",@progbits
|
||||
foo: .long 25
|
||||
--- gcc-5.2.0.base/gcc/configure 2015-08-11 16:23:35.000000000 +0000
|
||||
+++ gcc-5.2.0/gcc/configure 2015-09-13 08:17:42.608304751 +0000
|
||||
@@ -23754,7 +23754,7 @@
|
||||
tls_first_minor=14
|
||||
tls_as_opt="-m64 -Aesame --fatal-warnings"
|
||||
;;
|
||||
- sh-*-* | sh[34]-*-*)
|
||||
+ sh-*-* | sh[123456789lbe]*-*-*)
|
||||
conftest_s='
|
||||
.section ".tdata","awT",@progbits
|
||||
foo: .long 25
|
|
@ -1,349 +0,0 @@
|
|||
diff --git a/gcc/config.gcc b/gcc/config.gcc
|
||||
index 0f2dc32..a3d0d45 100644
|
||||
--- a/gcc/config.gcc
|
||||
+++ b/gcc/config.gcc
|
||||
@@ -467,7 +467,7 @@ s390*-*-*)
|
||||
extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
|
||||
;;
|
||||
# Note the 'l'; we need to be able to match e.g. "shle" or "shl".
|
||||
-sh[123456789lbe]*-*-* | sh-*-*)
|
||||
+sh[123456789lbej]*-*-* | sh-*-*)
|
||||
cpu_type=sh
|
||||
extra_options="${extra_options} fused-madd.opt"
|
||||
extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
|
||||
@@ -2601,19 +2601,19 @@ s390x-ibm-tpf*)
|
||||
extra_options="${extra_options} s390/tpf.opt"
|
||||
tmake_file="${tmake_file} s390/t-s390"
|
||||
;;
|
||||
-sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
- sh-*-linux* | sh[2346lbe]*-*-linux* | \
|
||||
+sh-*-elf* | sh[12346lj]*-*-elf* | \
|
||||
+ sh-*-linux* | sh[2346lbej]*-*-linux* | \
|
||||
sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
|
||||
sh64-*-netbsd* | sh64l*-*-netbsd*)
|
||||
tmake_file="${tmake_file} sh/t-sh sh/t-elf"
|
||||
if test x${with_endian} = x; then
|
||||
case ${target} in
|
||||
- sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;;
|
||||
+ sh[j1234]*be-*-* | sh[j1234]*eb-*-*) with_endian=big ;;
|
||||
shbe-*-* | sheb-*-*) with_endian=big,little ;;
|
||||
sh[1234]l* | sh[34]*-*-linux*) with_endian=little ;;
|
||||
shl* | sh64l* | sh*-*-linux* | \
|
||||
sh5l* | sh-superh-elf) with_endian=little,big ;;
|
||||
- sh[1234]*-*-*) with_endian=big ;;
|
||||
+ sh[j1234]*-*-*) with_endian=big ;;
|
||||
*) with_endian=big,little ;;
|
||||
esac
|
||||
fi
|
||||
@@ -2703,6 +2703,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
sh2a_nofpu*) sh_cpu_target=sh2a-nofpu ;;
|
||||
sh2a*) sh_cpu_target=sh2a ;;
|
||||
sh2e*) sh_cpu_target=sh2e ;;
|
||||
+ shj2*) sh_cpu_target=shj2;;
|
||||
sh2*) sh_cpu_target=sh2 ;;
|
||||
*) sh_cpu_target=sh1 ;;
|
||||
esac
|
||||
@@ -2727,7 +2728,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \
|
||||
sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \
|
||||
sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \
|
||||
- sh3e | sh3 | sh2e | sh2 | sh1) ;;
|
||||
+ sh3e | sh3 | sh2e | sh2 | sh1 | shj2) ;;
|
||||
"") sh_cpu_default=${sh_cpu_target} ;;
|
||||
*) echo "with_cpu=$with_cpu not supported"; exit 1 ;;
|
||||
esac
|
||||
@@ -2738,9 +2739,9 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
|
||||
sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
|
||||
sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
|
||||
- sh*-*-linux*) sh_multilibs=m1,m2,m2a,m3e,m4 ;;
|
||||
+ sh*-*-linux*) sh_multilibs=m1,m2,m2a,m3e,m4,mj2 ;;
|
||||
sh*-*-netbsd*) sh_multilibs=m3,m3e,m4 ;;
|
||||
- *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
|
||||
+ *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single,mj2 ;;
|
||||
esac
|
||||
if test x$with_fp = xno; then
|
||||
sh_multilibs="`echo $sh_multilibs|sed -e s/m4/sh4-nofpu/ -e s/,m4-[^,]*//g -e s/,m[23]e// -e s/m2a,m2a-single/m2a-nofpu/ -e s/m5-..m....,//g`"
|
||||
@@ -2758,7 +2759,8 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
m2a | m2a-single | m2a-single-only | m2a-nofpu | \
|
||||
m5-64media | m5-64media-nofpu | \
|
||||
m5-32media | m5-32media-nofpu | \
|
||||
- m5-compact | m5-compact-nofpu)
|
||||
+ m5-compact | m5-compact-nofpu | \
|
||||
+ mj2)
|
||||
# TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
|
||||
# It is passed to MULTIILIB_OPTIONS verbatim.
|
||||
TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
|
||||
@@ -2775,7 +2777,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
done
|
||||
TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
|
||||
if test x${enable_incomplete_targets} = xyes ; then
|
||||
- tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1"
|
||||
+ tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1 SUPPORT_SHJ2=1"
|
||||
fi
|
||||
tm_file="$tm_file ./sysroot-suffix.h"
|
||||
tmake_file="$tmake_file t-sysroot-suffix"
|
||||
@@ -4106,6 +4109,8 @@
|
||||
;;
|
||||
m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al)
|
||||
;;
|
||||
+ mj2)
|
||||
+ ;;
|
||||
*)
|
||||
echo "Unknown CPU used in --with-cpu=$with_cpu, known values:" 1>&2
|
||||
echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2
|
||||
@@ -4456,7 +4458,7 @@ case ${target} in
|
||||
tmake_file="rs6000/t-rs6000 ${tmake_file}"
|
||||
;;
|
||||
|
||||
- sh[123456ble]*-*-* | sh-*-*)
|
||||
+ sh[123456blej]*-*-* | sh-*-*)
|
||||
c_target_objs="${c_target_objs} sh-c.o"
|
||||
cxx_target_objs="${cxx_target_objs} sh-c.o"
|
||||
;;
|
||||
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
|
||||
index b08120d..63b77fa 100644
|
||||
--- a/gcc/config/sh/sh-protos.h
|
||||
+++ b/gcc/config/sh/sh-protos.h
|
||||
@@ -45,6 +45,7 @@ struct sh_atomic_model
|
||||
hard_llcs,
|
||||
soft_tcb,
|
||||
soft_imask,
|
||||
+ hard_cas,
|
||||
|
||||
num_models
|
||||
};
|
||||
@@ -88,6 +89,9 @@ extern const sh_atomic_model& selected_atomic_model (void);
|
||||
#define TARGET_ATOMIC_SOFT_IMASK \
|
||||
(selected_atomic_model ().type == sh_atomic_model::soft_imask)
|
||||
|
||||
+#define TARGET_ATOMIC_HARD_CAS \
|
||||
+ (selected_atomic_model ().type == sh_atomic_model::hard_cas)
|
||||
+
|
||||
#ifdef RTX_CODE
|
||||
extern rtx sh_fsca_sf2int (void);
|
||||
extern rtx sh_fsca_int2sf (void);
|
||||
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
|
||||
index 0b18ce5..bdf96e2 100644
|
||||
--- a/gcc/config/sh/sh.c
|
||||
+++ b/gcc/config/sh/sh.c
|
||||
@@ -692,6 +692,7 @@ parse_validate_atomic_model_option (const char* str)
|
||||
model_names[sh_atomic_model::hard_llcs] = "hard-llcs";
|
||||
model_names[sh_atomic_model::soft_tcb] = "soft-tcb";
|
||||
model_names[sh_atomic_model::soft_imask] = "soft-imask";
|
||||
+ model_names[sh_atomic_model::hard_cas] = "hard-cas";
|
||||
|
||||
const char* model_cdef_names[sh_atomic_model::num_models];
|
||||
model_cdef_names[sh_atomic_model::none] = "NONE";
|
||||
@@ -699,6 +700,7 @@ parse_validate_atomic_model_option (const char* str)
|
||||
model_cdef_names[sh_atomic_model::hard_llcs] = "HARD_LLCS";
|
||||
model_cdef_names[sh_atomic_model::soft_tcb] = "SOFT_TCB";
|
||||
model_cdef_names[sh_atomic_model::soft_imask] = "SOFT_IMASK";
|
||||
+ model_cdef_names[sh_atomic_model::hard_cas] = "HARD_CAS";
|
||||
|
||||
sh_atomic_model ret;
|
||||
ret.type = sh_atomic_model::none;
|
||||
@@ -780,6 +782,9 @@ got_mode_name:;
|
||||
if (ret.type == sh_atomic_model::soft_imask && TARGET_USERMODE)
|
||||
err_ret ("cannot use atomic model %s in user mode", ret.name);
|
||||
|
||||
+ if (ret.type == sh_atomic_model::hard_cas && !TARGET_SHJ2)
|
||||
+ err_ret ("atomic model %s is only available J2 targets", ret.name);
|
||||
+
|
||||
return ret;
|
||||
|
||||
#undef err_ret
|
||||
@@ -845,6 +850,8 @@ sh_option_override (void)
|
||||
sh_cpu = PROCESSOR_SH2E;
|
||||
if (TARGET_SH2A)
|
||||
sh_cpu = PROCESSOR_SH2A;
|
||||
+ if (TARGET_SHJ2)
|
||||
+ sh_cpu = PROCESSOR_SHJ2;
|
||||
if (TARGET_SH3)
|
||||
sh_cpu = PROCESSOR_SH3;
|
||||
if (TARGET_SH3E)
|
||||
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
|
||||
index 7187c23..9d0d1d0 100644
|
||||
--- a/gcc/config/sh/sh.h
|
||||
+++ b/gcc/config/sh/sh.h
|
||||
@@ -106,6 +106,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#define SUPPORT_SH4_SINGLE 1
|
||||
#define SUPPORT_SH2A 1
|
||||
#define SUPPORT_SH2A_SINGLE 1
|
||||
+#define SUPPORT_SHJ2 1
|
||||
#endif
|
||||
|
||||
#define TARGET_DIVIDE_INV \
|
||||
@@ -157,6 +158,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#define SELECT_SH5_32MEDIA_NOFPU (MASK_SH5 | MASK_SH_E)
|
||||
#define SELECT_SH5_COMPACT (MASK_SH5 | MASK_SH4 | SELECT_SH3E)
|
||||
#define SELECT_SH5_COMPACT_NOFPU (MASK_SH5 | SELECT_SH3)
|
||||
+#define SELECT_SHJ2 (MASK_SHJ2 | SELECT_SH2)
|
||||
|
||||
#if SUPPORT_SH1
|
||||
#define SUPPORT_SH2 1
|
||||
@@ -164,6 +166,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#if SUPPORT_SH2
|
||||
#define SUPPORT_SH3 1
|
||||
#define SUPPORT_SH2A_NOFPU 1
|
||||
+#define SUPPORT_SHJ2 1
|
||||
#endif
|
||||
#if SUPPORT_SH3
|
||||
#define SUPPORT_SH4_NOFPU 1
|
||||
@@ -211,7 +214,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#define MASK_ARCH (MASK_SH1 | MASK_SH2 | MASK_SH3 | MASK_SH_E | MASK_SH4 \
|
||||
| MASK_HARD_SH2A | MASK_HARD_SH2A_DOUBLE | MASK_SH4A \
|
||||
| MASK_HARD_SH4 | MASK_FPU_SINGLE | MASK_SH5 \
|
||||
- | MASK_FPU_SINGLE_ONLY)
|
||||
+ | MASK_FPU_SINGLE_ONLY | MASK_SHJ2)
|
||||
|
||||
/* This defaults us to big-endian. */
|
||||
#ifndef TARGET_ENDIAN_DEFAULT
|
||||
@@ -289,8 +292,8 @@ extern int code_for_indirect_jump_scratch;
|
||||
%{m5-compact*:--isa=SHcompact} \
|
||||
%{m5-32media*:--isa=SHmedia --abi=32} \
|
||||
%{m5-64media*:--isa=SHmedia --abi=64} \
|
||||
-%{m4al:-dsp} %{mcut2-workaround:-cut2-workaround}"
|
||||
-
|
||||
+%{m4al:-dsp} %{mcut2-workaround:-cut2-workaround} \
|
||||
+%{mj2:-isa=j2}"
|
||||
#define ASM_SPEC SH_ASM_SPEC
|
||||
|
||||
#ifndef SUBTARGET_ASM_ENDIAN_SPEC
|
||||
@@ -1853,7 +1856,7 @@ struct sh_args {
|
||||
|
||||
/* Nonzero if the target supports dynamic shift instructions
|
||||
like shad and shld. */
|
||||
-#define TARGET_DYNSHIFT (TARGET_SH3 || TARGET_SH2A)
|
||||
+#define TARGET_DYNSHIFT (TARGET_SH3 || TARGET_SH2A || TARGET_SHJ2)
|
||||
|
||||
/* The cost of using the dynamic shift insns (shad, shld) are the same
|
||||
if they are available. If they are not available a library function will
|
||||
@@ -2185,6 +2188,7 @@ enum processor_type {
|
||||
PROCESSOR_SH2,
|
||||
PROCESSOR_SH2E,
|
||||
PROCESSOR_SH2A,
|
||||
+ PROCESSOR_SHJ2,
|
||||
PROCESSOR_SH3,
|
||||
PROCESSOR_SH3E,
|
||||
PROCESSOR_SH4,
|
||||
diff --git a/gcc/config/sh/sh.opt b/gcc/config/sh/sh.opt
|
||||
index 1026c73..bac47ed 100644
|
||||
--- a/gcc/config/sh/sh.opt
|
||||
+++ b/gcc/config/sh/sh.opt
|
||||
@@ -71,6 +71,10 @@ m2e
|
||||
Target RejectNegative Condition(SUPPORT_SH2E)
|
||||
Generate SH2e code.
|
||||
|
||||
+mj2
|
||||
+Target RejectNegative Mask(SHJ2) Condition(SUPPORT_SHJ2)
|
||||
+Generate J2 code.
|
||||
+
|
||||
m3
|
||||
Target RejectNegative Mask(SH3) Condition(SUPPORT_SH3)
|
||||
Generate SH3 code.
|
||||
diff --git a/gcc/config/sh/sync.md b/gcc/config/sh/sync.md
|
||||
index 6f1337b..cff57b8 100644
|
||||
--- a/gcc/config/sh/sync.md
|
||||
+++ b/gcc/config/sh/sync.md
|
||||
@@ -240,6 +240,9 @@
|
||||
|| (TARGET_SH4A && <MODE>mode == SImode && !TARGET_ATOMIC_STRICT))
|
||||
atomic_insn = gen_atomic_compare_and_swap<mode>_hard (old_val, mem,
|
||||
exp_val, new_val);
|
||||
+ else if (TARGET_ATOMIC_HARD_CAS && <MODE>mode == SImode)
|
||||
+ atomic_insn = gen_atomic_compare_and_swap<mode>_cas (old_val, mem,
|
||||
+ exp_val, new_val);
|
||||
else if (TARGET_ATOMIC_SOFT_GUSA)
|
||||
atomic_insn = gen_atomic_compare_and_swap<mode>_soft_gusa (old_val, mem,
|
||||
exp_val, new_val);
|
||||
@@ -306,6 +309,57 @@
|
||||
}
|
||||
[(set_attr "length" "14")])
|
||||
|
||||
+(define_expand "atomic_compare_and_swapsi_cas"
|
||||
+ [(set (match_operand:SI 0 "register_operand" "=r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
|
||||
+ (match_operand:SI 2 "register_operand" "r")
|
||||
+ (match_operand:SI 3 "register_operand" "r")]
|
||||
+ UNSPECV_CMPXCHG_1))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+{
|
||||
+ rtx mem = gen_rtx_REG (SImode, 0);
|
||||
+ emit_move_insn (mem, force_reg (SImode, XEXP (operands[1], 0)));
|
||||
+ emit_insn (gen_shj2_cas (operands[0], mem, operands[2], operands[3]));
|
||||
+ DONE;
|
||||
+})
|
||||
+
|
||||
+(define_insn "shj2_cas"
|
||||
+ [(set (match_operand:SI 0 "register_operand" "=&r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "register_operand" "=r")
|
||||
+ (match_operand:SI 2 "register_operand" "r")
|
||||
+ (match_operand:SI 3 "register_operand" "0")]
|
||||
+ UNSPECV_CMPXCHG_1))
|
||||
+ (set (reg:SI T_REG)
|
||||
+ (unspec_volatile:SI [(const_int 0)] UNSPECV_CMPXCHG_3))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+ "cas.l %2,%0,@%1"
|
||||
+ [(set_attr "length" "2")]
|
||||
+)
|
||||
+
|
||||
+(define_expand "atomic_compare_and_swapqi_cas"
|
||||
+ [(set (match_operand:SI 0 "arith_reg_dest" "=&r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
|
||||
+ (match_operand:SI 2 "arith_operand" "rI08")
|
||||
+ (match_operand:SI 3 "arith_operand" "rI08")]
|
||||
+ UNSPECV_CMPXCHG_1))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+{FAIL;}
|
||||
+)
|
||||
+
|
||||
+(define_expand "atomic_compare_and_swaphi_cas"
|
||||
+ [(set (match_operand:SI 0 "arith_reg_dest" "=&r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
|
||||
+ (match_operand:SI 2 "arith_operand" "rI08")
|
||||
+ (match_operand:SI 3 "arith_operand" "rI08")]
|
||||
+ UNSPECV_CMPXCHG_1))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+{FAIL;}
|
||||
+)
|
||||
+
|
||||
;; The QIHImode llcs patterns modify the address register of the memory
|
||||
;; operand. In order to express that, we have to open code the memory
|
||||
;; operand. Initially the insn is expanded like every other atomic insn
|
||||
diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh
|
||||
index 348cc0b..8e6bdaf 100644
|
||||
--- a/gcc/config/sh/t-sh
|
||||
+++ b/gcc/config/sh/t-sh
|
||||
@@ -52,7 +52,7 @@ MULTILIB_MATCHES = $(shell \
|
||||
m4-single,m4-100-single,m4-200-single,m4-300-single,m4a-single \
|
||||
m4,m4-100,m4-200,m4-300,m4a \
|
||||
m5-32media,m5-compact,m5-32media \
|
||||
- m5-32media-nofpu,m5-compact-nofpu,m5-32media-nofpu; do \
|
||||
+ m5-32media-nofpu,m5-compact-nofpu,m5-32media-nofpu,mj2; do \
|
||||
subst= ; \
|
||||
for lib in `echo $$abi|tr , ' '` ; do \
|
||||
if test "`echo $$multilibs|sed s/$$lib//`" != "$$multilibs"; then \
|
||||
@@ -65,9 +65,9 @@ MULTILIB_MATCHES = $(shell \
|
||||
|
||||
# SH1 and SH2A support big endian only.
|
||||
ifeq ($(DEFAULT_ENDIAN),ml)
|
||||
-MULTILIB_EXCEPTIONS = m1 ml/m1 m2a* ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
+MULTILIB_EXCEPTIONS = m1 ml/m1 m2a* ml/m2a* ml/mj2 $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
else
|
||||
-MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
+MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* ml/mj2 $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
endif
|
||||
|
||||
MULTILIB_OSDIRNAMES = \
|
||||
@@ -96,6 +96,7 @@ MULTILIB_OSDIRNAMES = \
|
||||
m5-compact-nofpu=!m5-compact-nofpu $(OTHER_ENDIAN)/m5-compact-nofpu=!$(OTHER_ENDIAN)/m5-compact-nofpu \
|
||||
m5-64media=!m5-64media $(OTHER_ENDIAN)/m5-64media=!$(OTHER_ENDIAN)/m5-64media \
|
||||
m5-64media-nofpu=!m5-64media-nofpu $(OTHER_ENDIAN)/m5-64media-nofpu=!$(OTHER_ENDIAN)/m5-64media-nofpu
|
||||
+ mj2=!j2
|
||||
|
||||
$(out_object_file): gt-sh.h
|
||||
gt-sh.h : s-gtype ; @true
|
|
@ -1,24 +0,0 @@
|
|||
--- gcc-5.2.0.orig/gcc/config/gnu-user.h 2015-01-05 12:33:28.000000000 +0000
|
||||
+++ gcc-5.2.0/gcc/config/gnu-user.h 2015-08-25 08:15:18.354957759 +0000
|
||||
@@ -42,8 +42,8 @@
|
||||
|
||||
#if defined HAVE_LD_PIE
|
||||
#define GNU_USER_TARGET_STARTFILE_SPEC \
|
||||
- "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
||||
- crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
|
||||
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:%{static:rcrt1.o%s;:Scrt1.o%s};:crt1.o%s}} \
|
||||
+ crti.o%s %{shared|pie:crtbeginS.o%s;static:crtbeginT.o%s;:crtbegin.o%s} \
|
||||
%{fvtable-verify=none:%s; \
|
||||
fvtable-verify=preinit:vtv_start_preinit.o%s; \
|
||||
fvtable-verify=std:vtv_start.o%s}"
|
||||
--- gcc-5.2.0.orig/gcc/gcc.c 2015-03-10 09:37:41.000000000 +0000
|
||||
+++ gcc-5.2.0/gcc/gcc.c 2015-09-30 00:25:33.225927941 +0000
|
||||
@@ -739,7 +739,7 @@
|
||||
|
||||
#ifndef LINK_PIE_SPEC
|
||||
#ifdef HAVE_LD_PIE
|
||||
-#define LINK_PIE_SPEC "%{pie:-pie} "
|
||||
+#define LINK_PIE_SPEC "%{pie:-pie %{static:--no-dynamic-linker}} "
|
||||
#else
|
||||
#define LINK_PIE_SPEC "%{pie:} "
|
||||
#endif
|
|
@ -1,40 +0,0 @@
|
|||
diff --git a/gcc/config.gcc b/gcc/config.gcc
|
||||
index 3779369..a6d95ca 100644
|
||||
--- a/gcc/config.gcc
|
||||
+++ b/gcc/config.gcc
|
||||
@@ -3101,6 +3101,12 @@ case ${target} in
|
||||
;;
|
||||
esac
|
||||
|
||||
+case "x${enable_default_pie}" in
|
||||
+xyes)
|
||||
+ tm_defines="${tm_defines} ENABLE_DEFAULT_PIE=1"
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
t=
|
||||
all_defaults="abi cpu arch tune schedule float mode fpu divide"
|
||||
for option in $all_defaults
|
||||
--- gcc-5.2.0.orig/gcc/gcc.c 2015-03-10 09:37:41.000000000 +0000
|
||||
+++ gcc-5.2.0/gcc/gcc.c 2015-08-25 07:47:12.895060530 +0000
|
||||
@@ -1012,10 +1012,19 @@
|
||||
#define CILK_SELF_SPECS "%{fcilkplus: -pthread}"
|
||||
#endif
|
||||
|
||||
+/* Default to PIE */
|
||||
+#ifndef PIE_SELF_SPECS
|
||||
+#ifdef ENABLE_DEFAULT_PIE
|
||||
+#define PIE_SELF_SPECS "%{shared|pie|r|nostdlib|nopie|no-pie:;:-pie} %{fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE|D__KERNEL__:;:-fPIE}"
|
||||
+#else
|
||||
+#define PIE_SELF_SPECS ""
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
static const char *const driver_self_specs[] = {
|
||||
"%{fdump-final-insns:-fdump-final-insns=.} %<fdump-final-insns",
|
||||
DRIVER_SELF_SPECS, CONFIGURE_SPECS, GOMP_SELF_SPECS, GTM_SELF_SPECS,
|
||||
- CILK_SELF_SPECS
|
||||
+ CILK_SELF_SPECS, PIE_SELF_SPECS
|
||||
};
|
||||
|
||||
#ifndef OPTION_DEFAULT_SPECS
|
File diff suppressed because it is too large
Load Diff
|
@ -1,39 +0,0 @@
|
|||
--- a/gcc/config/sh/sh.md (revision 233324)
|
||||
+++ b/gcc/config/sh/sh.md (working copy)
|
||||
@@ -10476,7 +10476,7 @@
|
||||
(call (mem:SI (match_operand:SI 1 "symbol_ref_operand" ""))
|
||||
(match_operand 2 "" "")))
|
||||
(use (reg:SI FPSCR_MODES_REG))
|
||||
- (clobber (match_scratch:SI 3 "=k"))
|
||||
+ (clobber (reg:SI R1_REG))
|
||||
(return)]
|
||||
"TARGET_SH2 && !TARGET_FDPIC"
|
||||
"#"
|
||||
@@ -10491,6 +10495,8 @@
|
||||
rtx lab = PATTERN (gen_call_site ());
|
||||
rtx call_insn;
|
||||
|
||||
+ operands[3] = gen_rtx_REG (SImode, R1_REG);
|
||||
+
|
||||
sh_expand_sym_label2reg (operands[3], operands[1], lab, true);
|
||||
call_insn = emit_call_insn (gen_sibcall_valuei_pcrel (operands[0],
|
||||
operands[3],
|
||||
@@ -10511,7 +10519,7 @@
|
||||
(match_operand 2)))
|
||||
(use (reg:SI FPSCR_MODES_REG))
|
||||
(use (reg:SI PIC_REG))
|
||||
- (clobber (match_scratch:SI 3 "=k"))
|
||||
+ (clobber (reg:SI R1_REG))
|
||||
(return)]
|
||||
"TARGET_SH2 && TARGET_FDPIC"
|
||||
"#"
|
||||
@@ -10520,6 +10528,8 @@
|
||||
{
|
||||
rtx lab = PATTERN (gen_call_site ());
|
||||
|
||||
+ operands[3] = gen_rtx_REG (SImode, R1_REG);
|
||||
+
|
||||
sh_expand_sym_label2reg (operands[3], operands[1], lab, true);
|
||||
rtx i = emit_call_insn (gen_sibcall_valuei_pcrel_fdpic (operands[0],
|
||||
operands[3],
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/libgcc/config/mips/linux-unwind.h 2016-04-07 23:08:58.088577977 +0000
|
||||
+++ b/libgcc/config/mips/linux-unwind.h 2016-04-07 23:04:34.016523639 +0000
|
||||
@@ -27,7 +27,7 @@
|
||||
state data appropriately. See unwind-dw2.c for the structs. */
|
||||
|
||||
#include <signal.h>
|
||||
-#include <asm/unistd.h>
|
||||
+#include <sys/syscall.h>
|
||||
|
||||
/* The third parameter to the signal handler points to something with
|
||||
* this structure defined in asm/ucontext.h, but the name clashes with
|
|
@ -1,24 +0,0 @@
|
|||
diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
|
||||
index 1c6665d..69699c4 100644
|
||||
--- a/gcc/cp/cfns.h
|
||||
+++ b/gcc/cp/cfns.h
|
||||
@@ -54,6 +54,7 @@ static unsigned int hash (const char *, unsigned int);
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#endif
|
||||
+static
|
||||
const char * libc_name_p (const char *, unsigned int);
|
||||
/* maximum key range = 391, duplicates = 0 */
|
||||
|
||||
@@ -124,10 +125,8 @@ hash (register const char *str, register unsigned int len)
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
-#ifdef __GNUC_STDC_INLINE__
|
||||
-__attribute__ ((__gnu_inline__))
|
||||
-#endif
|
||||
#endif
|
||||
+static
|
||||
const char *
|
||||
libc_name_p (register const char *str, register unsigned int len)
|
||||
{
|
|
@ -1,36 +0,0 @@
|
|||
diff -ur gcc-6.4.0/gcc/config/m68k/linux.h gcc-6.4.0.new/gcc/config/m68k/linux.h
|
||||
--- gcc-6.4.0/gcc/config/m68k/linux.h 2016-01-04 09:30:50.000000000 -0500
|
||||
+++ gcc-6.4.0.new/gcc/config/m68k/linux.h 2018-06-12 20:03:47.047502695 -0400
|
||||
@@ -73,6 +73,9 @@
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
|
||||
+#undef MUSL_DYNAMIC_LINKER
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1"
|
||||
+
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-m m68kelf %{shared} \
|
||||
%{!shared: \
|
||||
diff -ur gcc-6.4.0/libgcc/config/m68k/linux-atomic.c gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c
|
||||
--- gcc-6.4.0/libgcc/config/m68k/linux-atomic.c 2016-01-04 09:30:50.000000000 -0500
|
||||
+++ gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c 2018-06-07 16:15:11.610163418 -0400
|
||||
@@ -33,7 +33,6 @@
|
||||
using the kernel helper defined below. There is no support for
|
||||
64-bit operations yet. */
|
||||
|
||||
-#include <asm/unistd.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef __NR_atomic_cmpxchg_32
|
||||
diff -ur gcc-6.4.0/libgcc/config/m68k/linux-unwind.h gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h
|
||||
--- gcc-6.4.0/libgcc/config/m68k/linux-unwind.h 2016-01-04 09:30:50.000000000 -0500
|
||||
+++ gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h 2018-06-07 16:17:16.964591108 -0400
|
||||
@@ -37,7 +37,7 @@
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
unsigned long uc_filler[80];
|
||||
- __sigset_t uc_sigmask;
|
||||
+ sigset_t uc_sigmask;
|
||||
};
|
||||
|
||||
#define MD_FALLBACK_FRAME_STATE_FOR m68k_fallback_frame_state
|
|
@ -1,42 +0,0 @@
|
|||
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
|
||||
index c1bdcc7..ef69c96 100644
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -40325,10 +40325,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
|
||||
{
|
||||
case IX86_BUILTIN_CPU_INIT:
|
||||
{
|
||||
- /* Make it call __cpu_indicator_init in libgcc. */
|
||||
+ /* Make it call __cpu_indicator_init_local in libgcc.a. */
|
||||
tree call_expr, fndecl, type;
|
||||
type = build_function_type_list (integer_type_node, NULL_TREE);
|
||||
- fndecl = build_fn_decl ("__cpu_indicator_init", type);
|
||||
+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
|
||||
call_expr = build_call_expr (fndecl, 0);
|
||||
return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
|
||||
}
|
||||
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
|
||||
index 8c2248d..6c82f15 100644
|
||||
--- a/libgcc/config/i386/cpuinfo.c
|
||||
+++ b/libgcc/config/i386/cpuinfo.c
|
||||
@@ -485,7 +485,7 @@ __cpu_indicator_init (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-#if defined SHARED && defined USE_ELF_SYMVER
|
||||
-__asm__ (".symver __cpu_indicator_init, __cpu_indicator_init@GCC_4.8.0");
|
||||
-__asm__ (".symver __cpu_model, __cpu_model@GCC_4.8.0");
|
||||
+#ifndef SHARED
|
||||
+int __cpu_indicator_init_local (void)
|
||||
+ __attribute__ ((weak, alias ("__cpu_indicator_init")));
|
||||
#endif
|
||||
diff --git a/libgcc/config/i386/t-linux b/libgcc/config/i386/t-linux
|
||||
index 11bb46e..4f47f7b 100644
|
||||
--- a/libgcc/config/i386/t-linux
|
||||
+++ b/libgcc/config/i386/t-linux
|
||||
@@ -3,4 +3,4 @@
|
||||
# t-slibgcc-elf-ver and t-linux
|
||||
SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver
|
||||
|
||||
-HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER
|
||||
+HOST_LIBGCC2_CFLAGS += -mlong-double-80
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/gcc/config/linux.c b/gcc/config/linux.c
|
||||
index 250296b..16c3768 100644
|
||||
--- a/gcc/config/linux.c
|
||||
+++ b/gcc/config/linux.c
|
||||
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
bool
|
||||
linux_libc_has_function (enum function_class fn_class)
|
||||
{
|
||||
- if (OPTION_GLIBC)
|
||||
+ if (OPTION_GLIBC || OPTION_MUSL)
|
||||
return true;
|
||||
if (OPTION_BIONIC)
|
||||
if (fn_class == function_c94
|
|
@ -1,14 +0,0 @@
|
|||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index 0f042b0..0576ea7 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -860,7 +860,8 @@ proper position among the other output files. */
|
||||
#ifndef LINK_SSP_SPEC
|
||||
#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
- "|fstack-protector-strong|fstack-protector-explicit:}"
|
||||
+ "|fstack-protector-strong|fstack-protector-explicit" \
|
||||
+ ":-lssp_nonshared}"
|
||||
#else
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
"|fstack-protector-strong|fstack-protector-explicit" \
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/libgcc/config/mips/linux-unwind.h b/libgcc/config/mips/linux-unwind.h
|
||||
index bf12de5..4035c121 100644
|
||||
--- a/libgcc/config/mips/linux-unwind.h
|
||||
+++ b/libgcc/config/mips/linux-unwind.h
|
||||
@@ -27,7 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
state data appropriately. See unwind-dw2.c for the structs. */
|
||||
|
||||
#include <signal.h>
|
||||
-#include <asm/unistd.h>
|
||||
+#include <sys/syscall.h>
|
||||
|
||||
/* The third parameter to the signal handler points to something with
|
||||
* this structure defined in asm/ucontext.h, but the name clashes with
|
|
@ -1,30 +0,0 @@
|
|||
diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
|
||||
index a1f98d3..4f6b2dc 100644
|
||||
--- a/gcc/config/i386/pmm_malloc.h
|
||||
+++ b/gcc/config/i386/pmm_malloc.h
|
||||
@@ -27,12 +27,13 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
/* We can't depend on <stdlib.h> since the prototype of posix_memalign
|
||||
- may not be visible. */
|
||||
+ may not be visible and we can't pollute the namespace either. */
|
||||
#ifndef __cplusplus
|
||||
-extern int posix_memalign (void **, size_t, size_t);
|
||||
+extern int _mm_posix_memalign (void **, size_t, size_t)
|
||||
#else
|
||||
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
|
||||
+extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
|
||||
#endif
|
||||
+__asm__("posix_memalign");
|
||||
|
||||
static __inline void *
|
||||
_mm_malloc (size_t size, size_t alignment)
|
||||
@@ -42,7 +43,7 @@ _mm_malloc (size_t size, size_t alignment)
|
||||
return malloc (size);
|
||||
if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
|
||||
alignment = sizeof (void *);
|
||||
- if (posix_memalign (&ptr, alignment, size) == 0)
|
||||
+ if (_mm_posix_memalign (&ptr, alignment, size) == 0)
|
||||
return ptr;
|
||||
else
|
||||
return NULL;
|
|
@ -1,47 +0,0 @@
|
|||
diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
|
||||
index cb582dd..e43d7d5 100644
|
||||
--- a/libcilkrts/runtime/os-unix.c
|
||||
+++ b/libcilkrts/runtime/os-unix.c
|
||||
@@ -51,6 +51,7 @@
|
||||
#if defined __linux__
|
||||
# include <sys/sysinfo.h>
|
||||
# include <sys/syscall.h>
|
||||
+# include <sched.h>
|
||||
#elif defined __APPLE__
|
||||
# include <sys/sysctl.h>
|
||||
// Uses sysconf(_SC_NPROCESSORS_ONLN) in verbose output
|
||||
@@ -400,28 +401,19 @@ COMMON_SYSDEP void __cilkrts_sleep(void)
|
||||
|
||||
COMMON_SYSDEP void __cilkrts_yield(void)
|
||||
{
|
||||
-#if __APPLE__ || __FreeBSD__ || __VXWORKS__
|
||||
- // On MacOS, call sched_yield to yield quantum. I'm not sure why we
|
||||
- // don't do this on Linux also.
|
||||
- sched_yield();
|
||||
-#elif defined(__DragonFly__)
|
||||
- // On DragonFly BSD, call sched_yield to yield quantum.
|
||||
- sched_yield();
|
||||
-#elif defined(__MIC__)
|
||||
+#if defined(__MIC__)
|
||||
// On MIC, pthread_yield() really trashes things. Arch's measurements
|
||||
// showed that calling _mm_delay_32() (or doing nothing) was a better
|
||||
// option. Delaying 1024 clock cycles is a reasonable compromise between
|
||||
// giving up the processor and latency starting up when work becomes
|
||||
// available
|
||||
_mm_delay_32(1024);
|
||||
-#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
|
||||
- // On Android and Solaris, call sched_yield to yield quantum. I'm not
|
||||
- // sure why we don't do this on Linux also.
|
||||
- sched_yield();
|
||||
-#else
|
||||
- // On Linux, call pthread_yield (which in turn will call sched_yield)
|
||||
- // to yield quantum.
|
||||
+#elif defined(__sun__) && !defined(__svr4__)
|
||||
+ // On old SunOS call pthread_yield to yield a quantum.
|
||||
pthread_yield();
|
||||
+#else
|
||||
+ // On other platforms call sched_yield to yield a quantum.
|
||||
+ sched_yield();
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
diff --git a/libatomic/testsuite/Makefile.am b/libatomic/testsuite/Makefile.am
|
||||
index 561b7e2..2548a1b 100644
|
||||
--- a/libatomic/testsuite/Makefile.am
|
||||
+++ b/libatomic/testsuite/Makefile.am
|
||||
@@ -11,3 +11,9 @@ EXPECT = $(shell if test -f $(top_builddir)/../expect/expect; then \
|
||||
_RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
+
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefile.in
|
||||
index 34f83e0..4af67ad 100644
|
||||
--- a/libatomic/testsuite/Makefile.in
|
||||
+++ b/libatomic/testsuite/Makefile.in
|
||||
@@ -222,6 +222,7 @@ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -428,6 +429,10 @@ uninstall-am:
|
||||
uninstall uninstall-am
|
||||
|
||||
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
+
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp
|
||||
index cafab54..dd2e1a4 100644
|
||||
--- a/libatomic/testsuite/lib/libatomic.exp
|
||||
+++ b/libatomic/testsuite/lib/libatomic.exp
|
||||
@@ -74,6 +74,7 @@ proc libatomic_init { args } {
|
||||
global ALWAYS_CFLAGS
|
||||
global CFLAGS
|
||||
global TOOL_EXECUTABLE TOOL_OPTIONS
|
||||
+ global BUILD_CC
|
||||
global GCC_UNDER_TEST
|
||||
global TESTING_IN_BUILD_TREE
|
||||
global target_triplet
|
||||
@@ -89,6 +90,8 @@ proc libatomic_init { args } {
|
||||
if ![info exists GCC_UNDER_TEST] then {
|
||||
if [info exists TOOL_EXECUTABLE] {
|
||||
set GCC_UNDER_TEST $TOOL_EXECUTABLE
|
||||
+ } elseif [info exists BUILD_CC] {
|
||||
+ set GCC_UNDER_TEST $BUILD_CC
|
||||
} else {
|
||||
set GCC_UNDER_TEST "[find_gcc]"
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
diff --git a/libgomp/testsuite/Makefile.am b/libgomp/testsuite/Makefile.am
|
||||
index 66a9d94..83d3f67 100644
|
||||
--- a/libgomp/testsuite/Makefile.am
|
||||
+++ b/libgomp/testsuite/Makefile.am
|
||||
@@ -12,6 +12,11 @@ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
+
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
|
||||
# Instead of directly in ../testsuite/libgomp-test-support.exp.in, the
|
||||
# following variables have to be "routed through" this Makefile, for expansion
|
||||
diff --git a/libgomp/testsuite/Makefile.in b/libgomp/testsuite/Makefile.in
|
||||
index 4dbb406..001a163 100644
|
||||
--- a/libgomp/testsuite/Makefile.in
|
||||
+++ b/libgomp/testsuite/Makefile.in
|
||||
@@ -254,6 +254,7 @@ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -462,6 +463,10 @@ uninstall-am:
|
||||
ps ps-am uninstall uninstall-am
|
||||
|
||||
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
+
|
||||
# Instead of directly in ../testsuite/libgomp-test-support.exp.in, the
|
||||
# following variables have to be "routed through" this Makefile, for expansion
|
||||
# of the several (Makefile) variables used therein.
|
||||
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
|
||||
index 1cb4991..398ba1f 100644
|
||||
--- a/libgomp/testsuite/lib/libgomp.exp
|
||||
+++ b/libgomp/testsuite/lib/libgomp.exp
|
||||
@@ -85,6 +85,7 @@ proc libgomp_init { args } {
|
||||
global ALWAYS_CFLAGS
|
||||
global CFLAGS
|
||||
global TOOL_EXECUTABLE TOOL_OPTIONS
|
||||
+ global BUILD_CC
|
||||
global GCC_UNDER_TEST
|
||||
global TESTING_IN_BUILD_TREE
|
||||
global target_triplet
|
||||
@@ -107,6 +108,8 @@ proc libgomp_init { args } {
|
||||
if ![info exists GCC_UNDER_TEST] then {
|
||||
if [info exists TOOL_EXECUTABLE] {
|
||||
set GCC_UNDER_TEST $TOOL_EXECUTABLE
|
||||
+ } elseif [info exists BUILD_CC] {
|
||||
+ set GCC_UNDER_TEST $BUILD_CC
|
||||
} else {
|
||||
set GCC_UNDER_TEST "[find_gcc]"
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
diff --git a/libitm/testsuite/Makefile.am b/libitm/testsuite/Makefile.am
|
||||
index 561b7e2..2548a1b 100644
|
||||
--- a/libitm/testsuite/Makefile.am
|
||||
+++ b/libitm/testsuite/Makefile.am
|
||||
@@ -11,3 +11,9 @@ EXPECT = $(shell if test -f $(top_builddir)/../expect/expect; then \
|
||||
_RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
+
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
diff --git a/libitm/testsuite/Makefile.in b/libitm/testsuite/Makefile.in
|
||||
index 4d79781..46cdc8b 100644
|
||||
--- a/libitm/testsuite/Makefile.in
|
||||
+++ b/libitm/testsuite/Makefile.in
|
||||
@@ -232,6 +232,7 @@ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -438,6 +439,10 @@ uninstall-am:
|
||||
uninstall uninstall-am
|
||||
|
||||
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
+
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
diff --git a/libitm/testsuite/lib/libitm.exp b/libitm/testsuite/lib/libitm.exp
|
||||
index 0416296..748f492 100644
|
||||
--- a/libitm/testsuite/lib/libitm.exp
|
||||
+++ b/libitm/testsuite/lib/libitm.exp
|
||||
@@ -74,6 +74,7 @@ proc libitm_init { args } {
|
||||
global ALWAYS_CFLAGS
|
||||
global CFLAGS
|
||||
global TOOL_EXECUTABLE TOOL_OPTIONS
|
||||
+ global BUILD_CC
|
||||
global GCC_UNDER_TEST
|
||||
global TESTING_IN_BUILD_TREE
|
||||
global target_triplet
|
||||
@@ -89,6 +90,8 @@ proc libitm_init { args } {
|
||||
if ![info exists GCC_UNDER_TEST] then {
|
||||
if [info exists TOOL_EXECUTABLE] {
|
||||
set GCC_UNDER_TEST $TOOL_EXECUTABLE
|
||||
+ } elseif [info exists BUILD_CC] {
|
||||
+ set GCC_UNDER_TEST $BUILD_CC
|
||||
} else {
|
||||
set GCC_UNDER_TEST "[find_gcc]"
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
diff --git a/libvtv/testsuite/Makefile.am b/libvtv/testsuite/Makefile.am
|
||||
index 561b7e2..2548a1b 100644
|
||||
--- a/libvtv/testsuite/Makefile.am
|
||||
+++ b/libvtv/testsuite/Makefile.am
|
||||
@@ -11,3 +11,9 @@ EXPECT = $(shell if test -f $(top_builddir)/../expect/expect; then \
|
||||
_RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
+
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
diff --git a/libvtv/testsuite/Makefile.in b/libvtv/testsuite/Makefile.in
|
||||
index e19e13e..6528f38 100644
|
||||
--- a/libvtv/testsuite/Makefile.in
|
||||
+++ b/libvtv/testsuite/Makefile.in
|
||||
@@ -227,6 +227,7 @@ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -433,6 +434,10 @@ uninstall-am:
|
||||
uninstall uninstall-am
|
||||
|
||||
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
+
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
diff --git a/libvtv/testsuite/lib/libvtv.exp b/libvtv/testsuite/lib/libvtv.exp
|
||||
index edf5fdd..a596091 100644
|
||||
--- a/libvtv/testsuite/lib/libvtv.exp
|
||||
+++ b/libvtv/testsuite/lib/libvtv.exp
|
||||
@@ -74,6 +74,7 @@ proc libvtv_init { args } {
|
||||
global ALWAYS_CFLAGS
|
||||
global CFLAGS
|
||||
global TOOL_EXECUTABLE TOOL_OPTIONS
|
||||
+ global BUILD_CC
|
||||
global GCC_UNDER_TEST
|
||||
global TESTING_IN_BUILD_TREE
|
||||
global target_triplet
|
||||
@@ -89,6 +90,8 @@ proc libvtv_init { args } {
|
||||
if ![info exists GCC_UNDER_TEST] then {
|
||||
if [info exists TOOL_EXECUTABLE] {
|
||||
set GCC_UNDER_TEST $TOOL_EXECUTABLE
|
||||
+ } elseif [info exists BUILD_CC] {
|
||||
+ set GCC_UNDER_TEST $BUILD_CC
|
||||
} else {
|
||||
set GCC_UNDER_TEST "[find_gcc]"
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
|
||||
index b0bf40a..d4b56fe 100644
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -51,10 +51,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#if defined HAVE_LD_PIE
|
||||
#define GNU_USER_TARGET_STARTFILE_SPEC \
|
||||
"%{!shared: %{pg|p|profile:gcrt1.o%s;: \
|
||||
- %{" PIE_SPEC ":Scrt1.o%s} %{" NO_PIE_SPEC ":crt1.o%s}}} \
|
||||
- crti.o%s %{static:crtbeginT.o%s;: %{shared:crtbeginS.o%s} \
|
||||
+ %{" PIE_SPEC ":%{static:rcrt1.o%s;:Scrt1.o%s}} %{" NO_PIE_SPEC ":crt1.o%s}}} \
|
||||
+ crti.o%s %{shared:crtbeginS.o%s;: \
|
||||
%{" PIE_SPEC ":crtbeginS.o%s} \
|
||||
- %{" NO_PIE_SPEC ":crtbegin.o%s}} \
|
||||
+ %{" NO_PIE_SPEC ":%{static:crtbeginT.o%s;:crtbegin.o%s}}} \
|
||||
%{fvtable-verify=none:%s; \
|
||||
fvtable-verify=preinit:vtv_start_preinit.o%s; \
|
||||
fvtable-verify=std:vtv_start.o%s} \
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index 0576ea7..0a280e0 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -870,7 +870,7 @@ proper position among the other output files. */
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DEFAULT_PIE
|
||||
-#define NO_PIE_SPEC "no-pie|static"
|
||||
+#define NO_PIE_SPEC "no-pie"
|
||||
#define PIE_SPEC NO_PIE_SPEC "|r|shared:;"
|
||||
#define NO_FPIE1_SPEC "fno-pie"
|
||||
#define FPIE1_SPEC NO_FPIE1_SPEC ":;"
|
||||
@@ -916,7 +916,7 @@ proper position among the other output files. */
|
||||
#ifndef LINK_PIE_SPEC
|
||||
#ifdef HAVE_LD_PIE
|
||||
#ifndef LD_PIE_SPEC
|
||||
-#define LD_PIE_SPEC "-pie"
|
||||
+#define LD_PIE_SPEC "-pie %{static:--no-dynamic-linker -Bsymbolic}"
|
||||
#endif
|
||||
#else
|
||||
#define LD_PIE_SPEC ""
|
|
@ -1,349 +0,0 @@
|
|||
diff --git a/gcc/config.gcc b/gcc/config.gcc
|
||||
index 82cc9a9..bf2cb2c 100644
|
||||
--- a/gcc/config.gcc
|
||||
+++ b/gcc/config.gcc
|
||||
@@ -471,7 +471,7 @@ s390*-*-*)
|
||||
extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
|
||||
;;
|
||||
# Note the 'l'; we need to be able to match e.g. "shle" or "shl".
|
||||
-sh[123456789lbe]*-*-* | sh-*-*)
|
||||
+sh[123456789lbej]*-*-* | sh-*-*)
|
||||
cpu_type=sh
|
||||
extra_options="${extra_options} fused-madd.opt"
|
||||
extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
|
||||
@@ -2613,19 +2613,19 @@ s390x-ibm-tpf*)
|
||||
extra_options="${extra_options} s390/tpf.opt"
|
||||
tmake_file="${tmake_file} s390/t-s390"
|
||||
;;
|
||||
-sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
- sh-*-linux* | sh[2346lbe]*-*-linux* | \
|
||||
+sh-*-elf* | sh[12346lj]*-*-elf* | \
|
||||
+ sh-*-linux* | sh[2346lbej]*-*-linux* | \
|
||||
sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
|
||||
sh64-*-netbsd* | sh64l*-*-netbsd*)
|
||||
tmake_file="${tmake_file} sh/t-sh sh/t-elf"
|
||||
if test x${with_endian} = x; then
|
||||
case ${target} in
|
||||
- sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;;
|
||||
+ sh[j1234]*be-*-* | sh[j1234]*eb-*-*) with_endian=big ;;
|
||||
shbe-*-* | sheb-*-*) with_endian=big,little ;;
|
||||
sh[1234]l* | sh[34]*-*-linux*) with_endian=little ;;
|
||||
shl* | sh64l* | sh*-*-linux* | \
|
||||
sh5l* | sh-superh-elf) with_endian=little,big ;;
|
||||
- sh[1234]*-*-*) with_endian=big ;;
|
||||
+ sh[j1234]*-*-*) with_endian=big ;;
|
||||
*) with_endian=big,little ;;
|
||||
esac
|
||||
fi
|
||||
@@ -2715,6 +2715,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
sh2a_nofpu*) sh_cpu_target=sh2a-nofpu ;;
|
||||
sh2a*) sh_cpu_target=sh2a ;;
|
||||
sh2e*) sh_cpu_target=sh2e ;;
|
||||
+ shj2*) sh_cpu_target=shj2;;
|
||||
sh2*) sh_cpu_target=sh2 ;;
|
||||
*) sh_cpu_target=sh1 ;;
|
||||
esac
|
||||
@@ -2739,7 +2740,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \
|
||||
sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \
|
||||
sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \
|
||||
- sh3e | sh3 | sh2e | sh2 | sh1) ;;
|
||||
+ sh3e | sh3 | sh2e | sh2 | sh1 | shj2) ;;
|
||||
"") sh_cpu_default=${sh_cpu_target} ;;
|
||||
*) echo "with_cpu=$with_cpu not supported"; exit 1 ;;
|
||||
esac
|
||||
@@ -2750,9 +2751,9 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
|
||||
sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
|
||||
sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
|
||||
- sh*-*-linux*) sh_multilibs=m1,m2,m2a,m3e,m4 ;;
|
||||
+ sh*-*-linux*) sh_multilibs=m1,m2,m2a,m3e,m4,mj2 ;;
|
||||
sh*-*-netbsd*) sh_multilibs=m3,m3e,m4 ;;
|
||||
- *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
|
||||
+ *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single,mj2 ;;
|
||||
esac
|
||||
if test x$with_fp = xno; then
|
||||
sh_multilibs="`echo $sh_multilibs|sed -e s/m4/sh4-nofpu/ -e s/,m4-[^,]*//g -e s/,m[23]e// -e s/m2a,m2a-single/m2a-nofpu/ -e s/m5-..m....,//g`"
|
||||
@@ -2770,7 +2771,8 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
m2a | m2a-single | m2a-single-only | m2a-nofpu | \
|
||||
m5-64media | m5-64media-nofpu | \
|
||||
m5-32media | m5-32media-nofpu | \
|
||||
- m5-compact | m5-compact-nofpu)
|
||||
+ m5-compact | m5-compact-nofpu | \
|
||||
+ mj2)
|
||||
# TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
|
||||
# It is passed to MULTIILIB_OPTIONS verbatim.
|
||||
TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
|
||||
@@ -2787,7 +2789,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
done
|
||||
TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
|
||||
if test x${enable_incomplete_targets} = xyes ; then
|
||||
- tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1"
|
||||
+ tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1 SUPPORT_SHJ2=1"
|
||||
fi
|
||||
tm_file="$tm_file ./sysroot-suffix.h"
|
||||
tmake_file="$tmake_file t-sysroot-suffix"
|
||||
@@ -4268,6 +4270,8 @@ case "${target}" in
|
||||
;;
|
||||
m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al)
|
||||
;;
|
||||
+ mj2)
|
||||
+ ;;
|
||||
*)
|
||||
echo "Unknown CPU used in --with-cpu=$with_cpu, known values:" 1>&2
|
||||
echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2
|
||||
@@ -4477,7 +4481,7 @@ case ${target} in
|
||||
tmake_file="rs6000/t-rs6000 ${tmake_file}"
|
||||
;;
|
||||
|
||||
- sh[123456ble]*-*-* | sh-*-*)
|
||||
+ sh[123456blej]*-*-* | sh-*-*)
|
||||
c_target_objs="${c_target_objs} sh-c.o"
|
||||
cxx_target_objs="${cxx_target_objs} sh-c.o"
|
||||
;;
|
||||
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
|
||||
index b08120d..63b77fa 100644
|
||||
--- a/gcc/config/sh/sh-protos.h
|
||||
+++ b/gcc/config/sh/sh-protos.h
|
||||
@@ -45,6 +45,7 @@ struct sh_atomic_model
|
||||
hard_llcs,
|
||||
soft_tcb,
|
||||
soft_imask,
|
||||
+ hard_cas,
|
||||
|
||||
num_models
|
||||
};
|
||||
@@ -88,6 +89,9 @@ extern const sh_atomic_model& selected_atomic_model (void);
|
||||
#define TARGET_ATOMIC_SOFT_IMASK \
|
||||
(selected_atomic_model ().type == sh_atomic_model::soft_imask)
|
||||
|
||||
+#define TARGET_ATOMIC_HARD_CAS \
|
||||
+ (selected_atomic_model ().type == sh_atomic_model::hard_cas)
|
||||
+
|
||||
#ifdef RTX_CODE
|
||||
extern rtx sh_fsca_sf2int (void);
|
||||
extern rtx sh_fsca_int2sf (void);
|
||||
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
|
||||
index b18e59b..88520e8 100644
|
||||
--- a/gcc/config/sh/sh.c
|
||||
+++ b/gcc/config/sh/sh.c
|
||||
@@ -692,6 +692,7 @@ parse_validate_atomic_model_option (const char* str)
|
||||
model_names[sh_atomic_model::hard_llcs] = "hard-llcs";
|
||||
model_names[sh_atomic_model::soft_tcb] = "soft-tcb";
|
||||
model_names[sh_atomic_model::soft_imask] = "soft-imask";
|
||||
+ model_names[sh_atomic_model::hard_cas] = "hard-cas";
|
||||
|
||||
const char* model_cdef_names[sh_atomic_model::num_models];
|
||||
model_cdef_names[sh_atomic_model::none] = "NONE";
|
||||
@@ -699,6 +700,7 @@ parse_validate_atomic_model_option (const char* str)
|
||||
model_cdef_names[sh_atomic_model::hard_llcs] = "HARD_LLCS";
|
||||
model_cdef_names[sh_atomic_model::soft_tcb] = "SOFT_TCB";
|
||||
model_cdef_names[sh_atomic_model::soft_imask] = "SOFT_IMASK";
|
||||
+ model_cdef_names[sh_atomic_model::hard_cas] = "HARD_CAS";
|
||||
|
||||
sh_atomic_model ret;
|
||||
ret.type = sh_atomic_model::none;
|
||||
@@ -780,6 +782,9 @@ got_mode_name:;
|
||||
if (ret.type == sh_atomic_model::soft_imask && TARGET_USERMODE)
|
||||
err_ret ("cannot use atomic model %s in user mode", ret.name);
|
||||
|
||||
+ if (ret.type == sh_atomic_model::hard_cas && !TARGET_SHJ2)
|
||||
+ err_ret ("atomic model %s is only available J2 targets", ret.name);
|
||||
+
|
||||
return ret;
|
||||
|
||||
#undef err_ret
|
||||
@@ -845,6 +850,8 @@ sh_option_override (void)
|
||||
sh_cpu = PROCESSOR_SH2E;
|
||||
if (TARGET_SH2A)
|
||||
sh_cpu = PROCESSOR_SH2A;
|
||||
+ if (TARGET_SHJ2)
|
||||
+ sh_cpu = PROCESSOR_SHJ2;
|
||||
if (TARGET_SH3)
|
||||
sh_cpu = PROCESSOR_SH3;
|
||||
if (TARGET_SH3E)
|
||||
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
|
||||
index 7187c23..3bc2817 100644
|
||||
--- a/gcc/config/sh/sh.h
|
||||
+++ b/gcc/config/sh/sh.h
|
||||
@@ -106,6 +106,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#define SUPPORT_SH4_SINGLE 1
|
||||
#define SUPPORT_SH2A 1
|
||||
#define SUPPORT_SH2A_SINGLE 1
|
||||
+#define SUPPORT_SHJ2 1
|
||||
#endif
|
||||
|
||||
#define TARGET_DIVIDE_INV \
|
||||
@@ -157,6 +158,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#define SELECT_SH5_32MEDIA_NOFPU (MASK_SH5 | MASK_SH_E)
|
||||
#define SELECT_SH5_COMPACT (MASK_SH5 | MASK_SH4 | SELECT_SH3E)
|
||||
#define SELECT_SH5_COMPACT_NOFPU (MASK_SH5 | SELECT_SH3)
|
||||
+#define SELECT_SHJ2 (MASK_SHJ2 | SELECT_SH2)
|
||||
|
||||
#if SUPPORT_SH1
|
||||
#define SUPPORT_SH2 1
|
||||
@@ -164,6 +166,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#if SUPPORT_SH2
|
||||
#define SUPPORT_SH3 1
|
||||
#define SUPPORT_SH2A_NOFPU 1
|
||||
+#define SUPPORT_SHJ2 1
|
||||
#endif
|
||||
#if SUPPORT_SH3
|
||||
#define SUPPORT_SH4_NOFPU 1
|
||||
@@ -211,7 +214,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#define MASK_ARCH (MASK_SH1 | MASK_SH2 | MASK_SH3 | MASK_SH_E | MASK_SH4 \
|
||||
| MASK_HARD_SH2A | MASK_HARD_SH2A_DOUBLE | MASK_SH4A \
|
||||
| MASK_HARD_SH4 | MASK_FPU_SINGLE | MASK_SH5 \
|
||||
- | MASK_FPU_SINGLE_ONLY)
|
||||
+ | MASK_FPU_SINGLE_ONLY | MASK_SHJ2)
|
||||
|
||||
/* This defaults us to big-endian. */
|
||||
#ifndef TARGET_ENDIAN_DEFAULT
|
||||
@@ -289,8 +292,8 @@ extern int code_for_indirect_jump_scratch;
|
||||
%{m5-compact*:--isa=SHcompact} \
|
||||
%{m5-32media*:--isa=SHmedia --abi=32} \
|
||||
%{m5-64media*:--isa=SHmedia --abi=64} \
|
||||
-%{m4al:-dsp} %{mcut2-workaround:-cut2-workaround}"
|
||||
-
|
||||
+%{m4al:-dsp} %{mcut2-workaround:-cut2-workaround} \
|
||||
+%{mj2:-isa=j2}"
|
||||
#define ASM_SPEC SH_ASM_SPEC
|
||||
|
||||
#ifndef SUBTARGET_ASM_ENDIAN_SPEC
|
||||
@@ -1853,7 +1856,7 @@ struct sh_args {
|
||||
|
||||
/* Nonzero if the target supports dynamic shift instructions
|
||||
like shad and shld. */
|
||||
-#define TARGET_DYNSHIFT (TARGET_SH3 || TARGET_SH2A)
|
||||
+#define TARGET_DYNSHIFT (TARGET_SH3 || TARGET_SH2A || TARGET_SHJ2)
|
||||
|
||||
/* The cost of using the dynamic shift insns (shad, shld) are the same
|
||||
if they are available. If they are not available a library function will
|
||||
@@ -2185,6 +2188,7 @@ enum processor_type {
|
||||
PROCESSOR_SH2,
|
||||
PROCESSOR_SH2E,
|
||||
PROCESSOR_SH2A,
|
||||
+ PROCESSOR_SHJ2,
|
||||
PROCESSOR_SH3,
|
||||
PROCESSOR_SH3E,
|
||||
PROCESSOR_SH4,
|
||||
diff --git a/gcc/config/sh/sh.opt b/gcc/config/sh/sh.opt
|
||||
index 1026c73..bac47ed 100644
|
||||
--- a/gcc/config/sh/sh.opt
|
||||
+++ b/gcc/config/sh/sh.opt
|
||||
@@ -71,6 +71,10 @@ m2e
|
||||
Target RejectNegative Condition(SUPPORT_SH2E)
|
||||
Generate SH2e code.
|
||||
|
||||
+mj2
|
||||
+Target RejectNegative Mask(SHJ2) Condition(SUPPORT_SHJ2)
|
||||
+Generate J2 code.
|
||||
+
|
||||
m3
|
||||
Target RejectNegative Mask(SH3) Condition(SUPPORT_SH3)
|
||||
Generate SH3 code.
|
||||
diff --git a/gcc/config/sh/sync.md b/gcc/config/sh/sync.md
|
||||
index 6f1337b..7cfd9ef 100644
|
||||
--- a/gcc/config/sh/sync.md
|
||||
+++ b/gcc/config/sh/sync.md
|
||||
@@ -240,6 +240,9 @@
|
||||
|| (TARGET_SH4A && <MODE>mode == SImode && !TARGET_ATOMIC_STRICT))
|
||||
atomic_insn = gen_atomic_compare_and_swap<mode>_hard (old_val, mem,
|
||||
exp_val, new_val);
|
||||
+ else if (TARGET_ATOMIC_HARD_CAS && <MODE>mode == SImode)
|
||||
+ atomic_insn = gen_atomic_compare_and_swap<mode>_cas (old_val, mem,
|
||||
+ exp_val, new_val);
|
||||
else if (TARGET_ATOMIC_SOFT_GUSA)
|
||||
atomic_insn = gen_atomic_compare_and_swap<mode>_soft_gusa (old_val, mem,
|
||||
exp_val, new_val);
|
||||
@@ -306,6 +309,57 @@
|
||||
}
|
||||
[(set_attr "length" "14")])
|
||||
|
||||
+(define_expand "atomic_compare_and_swapsi_cas"
|
||||
+ [(set (match_operand:SI 0 "register_operand" "=r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
|
||||
+ (match_operand:SI 2 "register_operand" "r")
|
||||
+ (match_operand:SI 3 "register_operand" "r")]
|
||||
+ UNSPECV_CMPXCHG_1))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+{
|
||||
+ rtx mem = gen_rtx_REG (SImode, 0);
|
||||
+ emit_move_insn (mem, force_reg (SImode, XEXP (operands[1], 0)));
|
||||
+ emit_insn (gen_shj2_cas (operands[0], mem, operands[2], operands[3]));
|
||||
+ DONE;
|
||||
+})
|
||||
+
|
||||
+(define_insn "shj2_cas"
|
||||
+ [(set (match_operand:SI 0 "register_operand" "=&r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "register_operand" "=r")
|
||||
+ (match_operand:SI 2 "register_operand" "r")
|
||||
+ (match_operand:SI 3 "register_operand" "0")]
|
||||
+ UNSPECV_CMPXCHG_1))
|
||||
+ (set (reg:SI T_REG)
|
||||
+ (unspec_volatile:SI [(const_int 0)] UNSPECV_CMPXCHG_3))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+ "cas.l %2,%0,@%1"
|
||||
+ [(set_attr "length" "2")]
|
||||
+)
|
||||
+
|
||||
+(define_expand "atomic_compare_and_swapqi_cas"
|
||||
+ [(set (match_operand:SI 0 "arith_reg_dest" "=&r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
|
||||
+ (match_operand:SI 2 "arith_operand" "rI08")
|
||||
+ (match_operand:SI 3 "arith_operand" "rI08")]
|
||||
+ UNSPECV_CMPXCHG_1))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+{FAIL;}
|
||||
+)
|
||||
+
|
||||
+(define_expand "atomic_compare_and_swaphi_cas"
|
||||
+ [(set (match_operand:SI 0 "arith_reg_dest" "=&r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
|
||||
+ (match_operand:SI 2 "arith_operand" "rI08")
|
||||
+ (match_operand:SI 3 "arith_operand" "rI08")]
|
||||
+ UNSPECV_CMPXCHG_1))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+{FAIL;}
|
||||
+)
|
||||
+
|
||||
;; The QIHImode llcs patterns modify the address register of the memory
|
||||
;; operand. In order to express that, we have to open code the memory
|
||||
;; operand. Initially the insn is expanded like every other atomic insn
|
||||
diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh
|
||||
index 348cc0b..8e6bdaf 100644
|
||||
--- a/gcc/config/sh/t-sh
|
||||
+++ b/gcc/config/sh/t-sh
|
||||
@@ -52,7 +52,7 @@ MULTILIB_MATCHES = $(shell \
|
||||
m4-single,m4-100-single,m4-200-single,m4-300-single,m4a-single \
|
||||
m4,m4-100,m4-200,m4-300,m4a \
|
||||
m5-32media,m5-compact,m5-32media \
|
||||
- m5-32media-nofpu,m5-compact-nofpu,m5-32media-nofpu; do \
|
||||
+ m5-32media-nofpu,m5-compact-nofpu,m5-32media-nofpu,mj2; do \
|
||||
subst= ; \
|
||||
for lib in `echo $$abi|tr , ' '` ; do \
|
||||
if test "`echo $$multilibs|sed s/$$lib//`" != "$$multilibs"; then \
|
||||
@@ -65,9 +65,9 @@ MULTILIB_MATCHES = $(shell \
|
||||
|
||||
# SH1 and SH2A support big endian only.
|
||||
ifeq ($(DEFAULT_ENDIAN),ml)
|
||||
-MULTILIB_EXCEPTIONS = m1 ml/m1 m2a* ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
+MULTILIB_EXCEPTIONS = m1 ml/m1 m2a* ml/m2a* ml/mj2 $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
else
|
||||
-MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
+MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* ml/mj2 $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
endif
|
||||
|
||||
MULTILIB_OSDIRNAMES = \
|
||||
@@ -96,6 +96,7 @@ MULTILIB_OSDIRNAMES = \
|
||||
m5-compact-nofpu=!m5-compact-nofpu $(OTHER_ENDIAN)/m5-compact-nofpu=!$(OTHER_ENDIAN)/m5-compact-nofpu \
|
||||
m5-64media=!m5-64media $(OTHER_ENDIAN)/m5-64media=!$(OTHER_ENDIAN)/m5-64media \
|
||||
m5-64media-nofpu=!m5-64media-nofpu $(OTHER_ENDIAN)/m5-64media-nofpu=!$(OTHER_ENDIAN)/m5-64media-nofpu
|
||||
+ mj2=!j2
|
||||
|
||||
$(out_object_file): gt-sh.h
|
||||
gt-sh.h : s-gtype ; @true
|
|
@ -1,12 +0,0 @@
|
|||
--- gcc-6.2.0/gcc/config/s390/linux.h.orig 2016-11-11 23:15:14.289495938 -0500
|
||||
+++ gcc-6.2.0/gcc/config/s390/linux.h 2016-11-11 23:20:25.854648405 -0500
|
||||
@@ -63,6 +63,9 @@
|
||||
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
|
||||
#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
|
||||
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-s390.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-s390x.so.1"
|
||||
+
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
"%{m31:-m elf_s390}%{m64:-m elf64_s390} \
|
|
@ -1,36 +0,0 @@
|
|||
diff -ur gcc-6.4.0/gcc/config/m68k/linux.h gcc-6.4.0.new/gcc/config/m68k/linux.h
|
||||
--- gcc-6.4.0/gcc/config/m68k/linux.h 2016-01-04 09:30:50.000000000 -0500
|
||||
+++ gcc-6.4.0.new/gcc/config/m68k/linux.h 2018-06-12 20:03:47.047502695 -0400
|
||||
@@ -73,6 +73,9 @@
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
|
||||
+#undef MUSL_DYNAMIC_LINKER
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1"
|
||||
+
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-m m68kelf %{shared} \
|
||||
%{!shared: \
|
||||
diff -ur gcc-6.4.0/libgcc/config/m68k/linux-atomic.c gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c
|
||||
--- gcc-6.4.0/libgcc/config/m68k/linux-atomic.c 2016-01-04 09:30:50.000000000 -0500
|
||||
+++ gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c 2018-06-07 16:15:11.610163418 -0400
|
||||
@@ -33,7 +33,6 @@
|
||||
using the kernel helper defined below. There is no support for
|
||||
64-bit operations yet. */
|
||||
|
||||
-#include <asm/unistd.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef __NR_atomic_cmpxchg_32
|
||||
diff -ur gcc-6.4.0/libgcc/config/m68k/linux-unwind.h gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h
|
||||
--- gcc-6.4.0/libgcc/config/m68k/linux-unwind.h 2016-01-04 09:30:50.000000000 -0500
|
||||
+++ gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h 2018-06-07 16:17:16.964591108 -0400
|
||||
@@ -37,7 +37,7 @@
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
unsigned long uc_filler[80];
|
||||
- __sigset_t uc_sigmask;
|
||||
+ sigset_t uc_sigmask;
|
||||
};
|
||||
|
||||
#define MD_FALLBACK_FRAME_STATE_FOR m68k_fallback_frame_state
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/gcc/config/linux.c b/gcc/config/linux.c
|
||||
index 250296b..16c3768 100644
|
||||
--- a/gcc/config/linux.c
|
||||
+++ b/gcc/config/linux.c
|
||||
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
bool
|
||||
linux_libc_has_function (enum function_class fn_class)
|
||||
{
|
||||
- if (OPTION_GLIBC)
|
||||
+ if (OPTION_GLIBC || OPTION_MUSL)
|
||||
return true;
|
||||
if (OPTION_BIONIC)
|
||||
if (fn_class == function_c94
|
|
@ -1,14 +0,0 @@
|
|||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index 0f042b0..0576ea7 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -860,7 +860,8 @@ proper position among the other output files. */
|
||||
#ifndef LINK_SSP_SPEC
|
||||
#ifdef TARGET_LIBC_PROVIDES_SSP
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
- "|fstack-protector-strong|fstack-protector-explicit:}"
|
||||
+ "|fstack-protector-strong|fstack-protector-explicit" \
|
||||
+ ":-lssp_nonshared}"
|
||||
#else
|
||||
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
|
||||
"|fstack-protector-strong|fstack-protector-explicit" \
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/libgcc/config/mips/linux-unwind.h b/libgcc/config/mips/linux-unwind.h
|
||||
index bf12de5..4035c121 100644
|
||||
--- a/libgcc/config/mips/linux-unwind.h
|
||||
+++ b/libgcc/config/mips/linux-unwind.h
|
||||
@@ -27,7 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
state data appropriately. See unwind-dw2.c for the structs. */
|
||||
|
||||
#include <signal.h>
|
||||
-#include <asm/unistd.h>
|
||||
+#include <sys/syscall.h>
|
||||
|
||||
/* The third parameter to the signal handler points to something with
|
||||
* this structure defined in asm/ucontext.h, but the name clashes with
|
|
@ -1,30 +0,0 @@
|
|||
diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
|
||||
index a1f98d3..4f6b2dc 100644
|
||||
--- a/gcc/config/i386/pmm_malloc.h
|
||||
+++ b/gcc/config/i386/pmm_malloc.h
|
||||
@@ -27,12 +27,13 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
/* We can't depend on <stdlib.h> since the prototype of posix_memalign
|
||||
- may not be visible. */
|
||||
+ may not be visible and we can't pollute the namespace either. */
|
||||
#ifndef __cplusplus
|
||||
-extern int posix_memalign (void **, size_t, size_t);
|
||||
+extern int _mm_posix_memalign (void **, size_t, size_t)
|
||||
#else
|
||||
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
|
||||
+extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
|
||||
#endif
|
||||
+__asm__("posix_memalign");
|
||||
|
||||
static __inline void *
|
||||
_mm_malloc (size_t size, size_t alignment)
|
||||
@@ -42,7 +43,7 @@ _mm_malloc (size_t size, size_t alignment)
|
||||
return malloc (size);
|
||||
if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
|
||||
alignment = sizeof (void *);
|
||||
- if (posix_memalign (&ptr, alignment, size) == 0)
|
||||
+ if (_mm_posix_memalign (&ptr, alignment, size) == 0)
|
||||
return ptr;
|
||||
else
|
||||
return NULL;
|
|
@ -1,47 +0,0 @@
|
|||
diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
|
||||
index cb582dd..e43d7d5 100644
|
||||
--- a/libcilkrts/runtime/os-unix.c
|
||||
+++ b/libcilkrts/runtime/os-unix.c
|
||||
@@ -51,6 +51,7 @@
|
||||
#if defined __linux__
|
||||
# include <sys/sysinfo.h>
|
||||
# include <sys/syscall.h>
|
||||
+# include <sched.h>
|
||||
#elif defined __APPLE__
|
||||
# include <sys/sysctl.h>
|
||||
// Uses sysconf(_SC_NPROCESSORS_ONLN) in verbose output
|
||||
@@ -400,28 +401,19 @@ COMMON_SYSDEP void __cilkrts_sleep(void)
|
||||
|
||||
COMMON_SYSDEP void __cilkrts_yield(void)
|
||||
{
|
||||
-#if __APPLE__ || __FreeBSD__ || __VXWORKS__
|
||||
- // On MacOS, call sched_yield to yield quantum. I'm not sure why we
|
||||
- // don't do this on Linux also.
|
||||
- sched_yield();
|
||||
-#elif defined(__DragonFly__)
|
||||
- // On DragonFly BSD, call sched_yield to yield quantum.
|
||||
- sched_yield();
|
||||
-#elif defined(__MIC__)
|
||||
+#if defined(__MIC__)
|
||||
// On MIC, pthread_yield() really trashes things. Arch's measurements
|
||||
// showed that calling _mm_delay_32() (or doing nothing) was a better
|
||||
// option. Delaying 1024 clock cycles is a reasonable compromise between
|
||||
// giving up the processor and latency starting up when work becomes
|
||||
// available
|
||||
_mm_delay_32(1024);
|
||||
-#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
|
||||
- // On Android and Solaris, call sched_yield to yield quantum. I'm not
|
||||
- // sure why we don't do this on Linux also.
|
||||
- sched_yield();
|
||||
-#else
|
||||
- // On Linux, call pthread_yield (which in turn will call sched_yield)
|
||||
- // to yield quantum.
|
||||
+#elif defined(__sun__) && !defined(__svr4__)
|
||||
+ // On old SunOS call pthread_yield to yield a quantum.
|
||||
pthread_yield();
|
||||
+#else
|
||||
+ // On other platforms call sched_yield to yield a quantum.
|
||||
+ sched_yield();
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
diff --git a/libatomic/testsuite/Makefile.am b/libatomic/testsuite/Makefile.am
|
||||
index 561b7e2..2548a1b 100644
|
||||
--- a/libatomic/testsuite/Makefile.am
|
||||
+++ b/libatomic/testsuite/Makefile.am
|
||||
@@ -11,3 +11,9 @@ EXPECT = $(shell if test -f $(top_builddir)/../expect/expect; then \
|
||||
_RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
+
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefile.in
|
||||
index 34f83e0..4af67ad 100644
|
||||
--- a/libatomic/testsuite/Makefile.in
|
||||
+++ b/libatomic/testsuite/Makefile.in
|
||||
@@ -222,6 +222,7 @@ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -428,6 +429,10 @@ uninstall-am:
|
||||
uninstall uninstall-am
|
||||
|
||||
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
+
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp
|
||||
index cafab54..dd2e1a4 100644
|
||||
--- a/libatomic/testsuite/lib/libatomic.exp
|
||||
+++ b/libatomic/testsuite/lib/libatomic.exp
|
||||
@@ -74,6 +74,7 @@ proc libatomic_init { args } {
|
||||
global ALWAYS_CFLAGS
|
||||
global CFLAGS
|
||||
global TOOL_EXECUTABLE TOOL_OPTIONS
|
||||
+ global BUILD_CC
|
||||
global GCC_UNDER_TEST
|
||||
global TESTING_IN_BUILD_TREE
|
||||
global target_triplet
|
||||
@@ -89,6 +90,8 @@ proc libatomic_init { args } {
|
||||
if ![info exists GCC_UNDER_TEST] then {
|
||||
if [info exists TOOL_EXECUTABLE] {
|
||||
set GCC_UNDER_TEST $TOOL_EXECUTABLE
|
||||
+ } elseif [info exists BUILD_CC] {
|
||||
+ set GCC_UNDER_TEST $BUILD_CC
|
||||
} else {
|
||||
set GCC_UNDER_TEST "[find_gcc]"
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
diff --git a/libgomp/testsuite/Makefile.am b/libgomp/testsuite/Makefile.am
|
||||
index 66a9d94..83d3f67 100644
|
||||
--- a/libgomp/testsuite/Makefile.am
|
||||
+++ b/libgomp/testsuite/Makefile.am
|
||||
@@ -12,6 +12,11 @@ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
+
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
|
||||
# Instead of directly in ../testsuite/libgomp-test-support.exp.in, the
|
||||
# following variables have to be "routed through" this Makefile, for expansion
|
||||
diff --git a/libgomp/testsuite/Makefile.in b/libgomp/testsuite/Makefile.in
|
||||
index 4dbb406..001a163 100644
|
||||
--- a/libgomp/testsuite/Makefile.in
|
||||
+++ b/libgomp/testsuite/Makefile.in
|
||||
@@ -254,6 +254,7 @@ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -462,6 +463,10 @@ uninstall-am:
|
||||
ps ps-am uninstall uninstall-am
|
||||
|
||||
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
+
|
||||
# Instead of directly in ../testsuite/libgomp-test-support.exp.in, the
|
||||
# following variables have to be "routed through" this Makefile, for expansion
|
||||
# of the several (Makefile) variables used therein.
|
||||
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
|
||||
index 1cb4991..398ba1f 100644
|
||||
--- a/libgomp/testsuite/lib/libgomp.exp
|
||||
+++ b/libgomp/testsuite/lib/libgomp.exp
|
||||
@@ -85,6 +85,7 @@ proc libgomp_init { args } {
|
||||
global ALWAYS_CFLAGS
|
||||
global CFLAGS
|
||||
global TOOL_EXECUTABLE TOOL_OPTIONS
|
||||
+ global BUILD_CC
|
||||
global GCC_UNDER_TEST
|
||||
global TESTING_IN_BUILD_TREE
|
||||
global target_triplet
|
||||
@@ -107,6 +108,8 @@ proc libgomp_init { args } {
|
||||
if ![info exists GCC_UNDER_TEST] then {
|
||||
if [info exists TOOL_EXECUTABLE] {
|
||||
set GCC_UNDER_TEST $TOOL_EXECUTABLE
|
||||
+ } elseif [info exists BUILD_CC] {
|
||||
+ set GCC_UNDER_TEST $BUILD_CC
|
||||
} else {
|
||||
set GCC_UNDER_TEST "[find_gcc]"
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
diff --git a/libitm/testsuite/Makefile.am b/libitm/testsuite/Makefile.am
|
||||
index 561b7e2..2548a1b 100644
|
||||
--- a/libitm/testsuite/Makefile.am
|
||||
+++ b/libitm/testsuite/Makefile.am
|
||||
@@ -11,3 +11,9 @@ EXPECT = $(shell if test -f $(top_builddir)/../expect/expect; then \
|
||||
_RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
+
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
diff --git a/libitm/testsuite/Makefile.in b/libitm/testsuite/Makefile.in
|
||||
index 4d79781..46cdc8b 100644
|
||||
--- a/libitm/testsuite/Makefile.in
|
||||
+++ b/libitm/testsuite/Makefile.in
|
||||
@@ -232,6 +232,7 @@ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -438,6 +439,10 @@ uninstall-am:
|
||||
uninstall uninstall-am
|
||||
|
||||
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
+
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
diff --git a/libitm/testsuite/lib/libitm.exp b/libitm/testsuite/lib/libitm.exp
|
||||
index 0416296..748f492 100644
|
||||
--- a/libitm/testsuite/lib/libitm.exp
|
||||
+++ b/libitm/testsuite/lib/libitm.exp
|
||||
@@ -74,6 +74,7 @@ proc libitm_init { args } {
|
||||
global ALWAYS_CFLAGS
|
||||
global CFLAGS
|
||||
global TOOL_EXECUTABLE TOOL_OPTIONS
|
||||
+ global BUILD_CC
|
||||
global GCC_UNDER_TEST
|
||||
global TESTING_IN_BUILD_TREE
|
||||
global target_triplet
|
||||
@@ -89,6 +90,8 @@ proc libitm_init { args } {
|
||||
if ![info exists GCC_UNDER_TEST] then {
|
||||
if [info exists TOOL_EXECUTABLE] {
|
||||
set GCC_UNDER_TEST $TOOL_EXECUTABLE
|
||||
+ } elseif [info exists BUILD_CC] {
|
||||
+ set GCC_UNDER_TEST $BUILD_CC
|
||||
} else {
|
||||
set GCC_UNDER_TEST "[find_gcc]"
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
diff --git a/libvtv/testsuite/Makefile.am b/libvtv/testsuite/Makefile.am
|
||||
index 561b7e2..2548a1b 100644
|
||||
--- a/libvtv/testsuite/Makefile.am
|
||||
+++ b/libvtv/testsuite/Makefile.am
|
||||
@@ -11,3 +11,9 @@ EXPECT = $(shell if test -f $(top_builddir)/../expect/expect; then \
|
||||
_RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
+
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
diff --git a/libvtv/testsuite/Makefile.in b/libvtv/testsuite/Makefile.in
|
||||
index e19e13e..6528f38 100644
|
||||
--- a/libvtv/testsuite/Makefile.in
|
||||
+++ b/libvtv/testsuite/Makefile.in
|
||||
@@ -227,6 +227,7 @@ _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \
|
||||
echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
|
||||
|
||||
RUNTEST = "$(_RUNTEST) $(AM_RUNTESTFLAGS)"
|
||||
+EXTRA_DEJAGNU_SITE_CONFIG = extra.exp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -433,6 +434,10 @@ uninstall-am:
|
||||
uninstall uninstall-am
|
||||
|
||||
|
||||
+extra.exp:
|
||||
+ echo 'set BUILD_CC "$(CC)"' > $@.tmp
|
||||
+ mv $@.tmp $@
|
||||
+
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
diff --git a/libvtv/testsuite/lib/libvtv.exp b/libvtv/testsuite/lib/libvtv.exp
|
||||
index edf5fdd..a596091 100644
|
||||
--- a/libvtv/testsuite/lib/libvtv.exp
|
||||
+++ b/libvtv/testsuite/lib/libvtv.exp
|
||||
@@ -74,6 +74,7 @@ proc libvtv_init { args } {
|
||||
global ALWAYS_CFLAGS
|
||||
global CFLAGS
|
||||
global TOOL_EXECUTABLE TOOL_OPTIONS
|
||||
+ global BUILD_CC
|
||||
global GCC_UNDER_TEST
|
||||
global TESTING_IN_BUILD_TREE
|
||||
global target_triplet
|
||||
@@ -89,6 +90,8 @@ proc libvtv_init { args } {
|
||||
if ![info exists GCC_UNDER_TEST] then {
|
||||
if [info exists TOOL_EXECUTABLE] {
|
||||
set GCC_UNDER_TEST $TOOL_EXECUTABLE
|
||||
+ } elseif [info exists BUILD_CC] {
|
||||
+ set GCC_UNDER_TEST $BUILD_CC
|
||||
} else {
|
||||
set GCC_UNDER_TEST "[find_gcc]"
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
|
||||
index b0bf40a..d4b56fe 100644
|
||||
--- a/gcc/config/gnu-user.h
|
||||
+++ b/gcc/config/gnu-user.h
|
||||
@@ -51,10 +51,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#if defined HAVE_LD_PIE
|
||||
#define GNU_USER_TARGET_STARTFILE_SPEC \
|
||||
"%{!shared: %{pg|p|profile:gcrt1.o%s;: \
|
||||
- %{" PIE_SPEC ":Scrt1.o%s} %{" NO_PIE_SPEC ":crt1.o%s}}} \
|
||||
- crti.o%s %{static:crtbeginT.o%s;: %{shared:crtbeginS.o%s} \
|
||||
+ %{" PIE_SPEC ":%{static:rcrt1.o%s;:Scrt1.o%s}} %{" NO_PIE_SPEC ":crt1.o%s}}} \
|
||||
+ crti.o%s %{shared:crtbeginS.o%s;: \
|
||||
%{" PIE_SPEC ":crtbeginS.o%s} \
|
||||
- %{" NO_PIE_SPEC ":crtbegin.o%s}} \
|
||||
+ %{" NO_PIE_SPEC ":%{static:crtbeginT.o%s;:crtbegin.o%s}}} \
|
||||
%{fvtable-verify=none:%s; \
|
||||
fvtable-verify=preinit:vtv_start_preinit.o%s; \
|
||||
fvtable-verify=std:vtv_start.o%s} \
|
||||
diff --git a/gcc/gcc.c b/gcc/gcc.c
|
||||
index 0576ea7..0a280e0 100644
|
||||
--- a/gcc/gcc.c
|
||||
+++ b/gcc/gcc.c
|
||||
@@ -870,7 +870,7 @@ proper position among the other output files. */
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DEFAULT_PIE
|
||||
-#define NO_PIE_SPEC "no-pie|static"
|
||||
+#define NO_PIE_SPEC "no-pie"
|
||||
#define PIE_SPEC NO_PIE_SPEC "|r|shared:;"
|
||||
#define NO_FPIE1_SPEC "fno-pie"
|
||||
#define FPIE1_SPEC NO_FPIE1_SPEC ":;"
|
||||
@@ -916,7 +916,7 @@ proper position among the other output files. */
|
||||
#ifndef LINK_PIE_SPEC
|
||||
#ifdef HAVE_LD_PIE
|
||||
#ifndef LD_PIE_SPEC
|
||||
-#define LD_PIE_SPEC "-pie"
|
||||
+#define LD_PIE_SPEC "-pie %{static:--no-dynamic-linker -Bsymbolic}"
|
||||
#endif
|
||||
#else
|
||||
#define LD_PIE_SPEC ""
|
|
@ -1,349 +0,0 @@
|
|||
diff --git a/gcc/config.gcc b/gcc/config.gcc
|
||||
index 1d5b23f..ef0a6ab 100644
|
||||
--- a/gcc/config.gcc
|
||||
+++ b/gcc/config.gcc
|
||||
@@ -471,7 +471,7 @@ s390*-*-*)
|
||||
extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
|
||||
;;
|
||||
# Note the 'l'; we need to be able to match e.g. "shle" or "shl".
|
||||
-sh[123456789lbe]*-*-* | sh-*-*)
|
||||
+sh[123456789lbej]*-*-* | sh-*-*)
|
||||
cpu_type=sh
|
||||
extra_options="${extra_options} fused-madd.opt"
|
||||
extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
|
||||
@@ -2624,19 +2624,19 @@ s390x-ibm-tpf*)
|
||||
extra_options="${extra_options} s390/tpf.opt"
|
||||
tmake_file="${tmake_file} s390/t-s390"
|
||||
;;
|
||||
-sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
- sh-*-linux* | sh[2346lbe]*-*-linux* | \
|
||||
+sh-*-elf* | sh[12346lj]*-*-elf* | \
|
||||
+ sh-*-linux* | sh[2346lbej]*-*-linux* | \
|
||||
sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
|
||||
sh64-*-netbsd* | sh64l*-*-netbsd*)
|
||||
tmake_file="${tmake_file} sh/t-sh sh/t-elf"
|
||||
if test x${with_endian} = x; then
|
||||
case ${target} in
|
||||
- sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;;
|
||||
+ sh[j1234]*be-*-* | sh[j1234]*eb-*-*) with_endian=big ;;
|
||||
shbe-*-* | sheb-*-*) with_endian=big,little ;;
|
||||
sh[1234]l* | sh[34]*-*-linux*) with_endian=little ;;
|
||||
shl* | sh64l* | sh*-*-linux* | \
|
||||
sh5l* | sh-superh-elf) with_endian=little,big ;;
|
||||
- sh[1234]*-*-*) with_endian=big ;;
|
||||
+ sh[j1234]*-*-*) with_endian=big ;;
|
||||
*) with_endian=big,little ;;
|
||||
esac
|
||||
fi
|
||||
@@ -2726,6 +2726,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
sh2a_nofpu*) sh_cpu_target=sh2a-nofpu ;;
|
||||
sh2a*) sh_cpu_target=sh2a ;;
|
||||
sh2e*) sh_cpu_target=sh2e ;;
|
||||
+ shj2*) sh_cpu_target=shj2;;
|
||||
sh2*) sh_cpu_target=sh2 ;;
|
||||
*) sh_cpu_target=sh1 ;;
|
||||
esac
|
||||
@@ -2750,7 +2751,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \
|
||||
sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \
|
||||
sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \
|
||||
- sh3e | sh3 | sh2e | sh2 | sh1) ;;
|
||||
+ sh3e | sh3 | sh2e | sh2 | sh1 | shj2) ;;
|
||||
"") sh_cpu_default=${sh_cpu_target} ;;
|
||||
*) echo "with_cpu=$with_cpu not supported"; exit 1 ;;
|
||||
esac
|
||||
@@ -2761,9 +2762,9 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
|
||||
sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
|
||||
sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
|
||||
- sh*-*-linux*) sh_multilibs=m1,m2,m2a,m3e,m4 ;;
|
||||
+ sh*-*-linux*) sh_multilibs=m1,m2,m2a,m3e,m4,mj2 ;;
|
||||
sh*-*-netbsd*) sh_multilibs=m3,m3e,m4 ;;
|
||||
- *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
|
||||
+ *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single,mj2 ;;
|
||||
esac
|
||||
if test x$with_fp = xno; then
|
||||
sh_multilibs="`echo $sh_multilibs|sed -e s/m4/sh4-nofpu/ -e s/,m4-[^,]*//g -e s/,m[23]e// -e s/m2a,m2a-single/m2a-nofpu/ -e s/m5-..m....,//g`"
|
||||
@@ -2781,7 +2782,8 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
m2a | m2a-single | m2a-single-only | m2a-nofpu | \
|
||||
m5-64media | m5-64media-nofpu | \
|
||||
m5-32media | m5-32media-nofpu | \
|
||||
- m5-compact | m5-compact-nofpu)
|
||||
+ m5-compact | m5-compact-nofpu | \
|
||||
+ mj2)
|
||||
# TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
|
||||
# It is passed to MULTIILIB_OPTIONS verbatim.
|
||||
TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
|
||||
@@ -2798,7 +2800,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
|
||||
done
|
||||
TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
|
||||
if test x${enable_incomplete_targets} = xyes ; then
|
||||
- tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1"
|
||||
+ tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1 SUPPORT_SHJ2=1"
|
||||
fi
|
||||
tm_file="$tm_file ./sysroot-suffix.h"
|
||||
tmake_file="$tmake_file t-sysroot-suffix"
|
||||
@@ -4269,6 +4271,8 @@ case "${target}" in
|
||||
;;
|
||||
m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al)
|
||||
;;
|
||||
+ mj2)
|
||||
+ ;;
|
||||
*)
|
||||
echo "Unknown CPU used in --with-cpu=$with_cpu, known values:" 1>&2
|
||||
echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2
|
||||
@@ -4478,7 +4482,7 @@ case ${target} in
|
||||
tmake_file="rs6000/t-rs6000 ${tmake_file}"
|
||||
;;
|
||||
|
||||
- sh[123456ble]*-*-* | sh-*-*)
|
||||
+ sh[123456blej]*-*-* | sh-*-*)
|
||||
c_target_objs="${c_target_objs} sh-c.o"
|
||||
cxx_target_objs="${cxx_target_objs} sh-c.o"
|
||||
;;
|
||||
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
|
||||
index b08120d..63b77fa 100644
|
||||
--- a/gcc/config/sh/sh-protos.h
|
||||
+++ b/gcc/config/sh/sh-protos.h
|
||||
@@ -45,6 +45,7 @@ struct sh_atomic_model
|
||||
hard_llcs,
|
||||
soft_tcb,
|
||||
soft_imask,
|
||||
+ hard_cas,
|
||||
|
||||
num_models
|
||||
};
|
||||
@@ -88,6 +89,9 @@ extern const sh_atomic_model& selected_atomic_model (void);
|
||||
#define TARGET_ATOMIC_SOFT_IMASK \
|
||||
(selected_atomic_model ().type == sh_atomic_model::soft_imask)
|
||||
|
||||
+#define TARGET_ATOMIC_HARD_CAS \
|
||||
+ (selected_atomic_model ().type == sh_atomic_model::hard_cas)
|
||||
+
|
||||
#ifdef RTX_CODE
|
||||
extern rtx sh_fsca_sf2int (void);
|
||||
extern rtx sh_fsca_int2sf (void);
|
||||
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
|
||||
index b18e59b..88520e8 100644
|
||||
--- a/gcc/config/sh/sh.c
|
||||
+++ b/gcc/config/sh/sh.c
|
||||
@@ -692,6 +692,7 @@ parse_validate_atomic_model_option (const char* str)
|
||||
model_names[sh_atomic_model::hard_llcs] = "hard-llcs";
|
||||
model_names[sh_atomic_model::soft_tcb] = "soft-tcb";
|
||||
model_names[sh_atomic_model::soft_imask] = "soft-imask";
|
||||
+ model_names[sh_atomic_model::hard_cas] = "hard-cas";
|
||||
|
||||
const char* model_cdef_names[sh_atomic_model::num_models];
|
||||
model_cdef_names[sh_atomic_model::none] = "NONE";
|
||||
@@ -699,6 +700,7 @@ parse_validate_atomic_model_option (const char* str)
|
||||
model_cdef_names[sh_atomic_model::hard_llcs] = "HARD_LLCS";
|
||||
model_cdef_names[sh_atomic_model::soft_tcb] = "SOFT_TCB";
|
||||
model_cdef_names[sh_atomic_model::soft_imask] = "SOFT_IMASK";
|
||||
+ model_cdef_names[sh_atomic_model::hard_cas] = "HARD_CAS";
|
||||
|
||||
sh_atomic_model ret;
|
||||
ret.type = sh_atomic_model::none;
|
||||
@@ -780,6 +782,9 @@ got_mode_name:;
|
||||
if (ret.type == sh_atomic_model::soft_imask && TARGET_USERMODE)
|
||||
err_ret ("cannot use atomic model %s in user mode", ret.name);
|
||||
|
||||
+ if (ret.type == sh_atomic_model::hard_cas && !TARGET_SHJ2)
|
||||
+ err_ret ("atomic model %s is only available J2 targets", ret.name);
|
||||
+
|
||||
return ret;
|
||||
|
||||
#undef err_ret
|
||||
@@ -845,6 +850,8 @@ sh_option_override (void)
|
||||
sh_cpu = PROCESSOR_SH2E;
|
||||
if (TARGET_SH2A)
|
||||
sh_cpu = PROCESSOR_SH2A;
|
||||
+ if (TARGET_SHJ2)
|
||||
+ sh_cpu = PROCESSOR_SHJ2;
|
||||
if (TARGET_SH3)
|
||||
sh_cpu = PROCESSOR_SH3;
|
||||
if (TARGET_SH3E)
|
||||
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
|
||||
index 7187c23..3bc2817 100644
|
||||
--- a/gcc/config/sh/sh.h
|
||||
+++ b/gcc/config/sh/sh.h
|
||||
@@ -106,6 +106,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#define SUPPORT_SH4_SINGLE 1
|
||||
#define SUPPORT_SH2A 1
|
||||
#define SUPPORT_SH2A_SINGLE 1
|
||||
+#define SUPPORT_SHJ2 1
|
||||
#endif
|
||||
|
||||
#define TARGET_DIVIDE_INV \
|
||||
@@ -157,6 +158,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#define SELECT_SH5_32MEDIA_NOFPU (MASK_SH5 | MASK_SH_E)
|
||||
#define SELECT_SH5_COMPACT (MASK_SH5 | MASK_SH4 | SELECT_SH3E)
|
||||
#define SELECT_SH5_COMPACT_NOFPU (MASK_SH5 | SELECT_SH3)
|
||||
+#define SELECT_SHJ2 (MASK_SHJ2 | SELECT_SH2)
|
||||
|
||||
#if SUPPORT_SH1
|
||||
#define SUPPORT_SH2 1
|
||||
@@ -164,6 +166,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#if SUPPORT_SH2
|
||||
#define SUPPORT_SH3 1
|
||||
#define SUPPORT_SH2A_NOFPU 1
|
||||
+#define SUPPORT_SHJ2 1
|
||||
#endif
|
||||
#if SUPPORT_SH3
|
||||
#define SUPPORT_SH4_NOFPU 1
|
||||
@@ -211,7 +214,7 @@ extern int code_for_indirect_jump_scratch;
|
||||
#define MASK_ARCH (MASK_SH1 | MASK_SH2 | MASK_SH3 | MASK_SH_E | MASK_SH4 \
|
||||
| MASK_HARD_SH2A | MASK_HARD_SH2A_DOUBLE | MASK_SH4A \
|
||||
| MASK_HARD_SH4 | MASK_FPU_SINGLE | MASK_SH5 \
|
||||
- | MASK_FPU_SINGLE_ONLY)
|
||||
+ | MASK_FPU_SINGLE_ONLY | MASK_SHJ2)
|
||||
|
||||
/* This defaults us to big-endian. */
|
||||
#ifndef TARGET_ENDIAN_DEFAULT
|
||||
@@ -289,8 +292,8 @@ extern int code_for_indirect_jump_scratch;
|
||||
%{m5-compact*:--isa=SHcompact} \
|
||||
%{m5-32media*:--isa=SHmedia --abi=32} \
|
||||
%{m5-64media*:--isa=SHmedia --abi=64} \
|
||||
-%{m4al:-dsp} %{mcut2-workaround:-cut2-workaround}"
|
||||
-
|
||||
+%{m4al:-dsp} %{mcut2-workaround:-cut2-workaround} \
|
||||
+%{mj2:-isa=j2}"
|
||||
#define ASM_SPEC SH_ASM_SPEC
|
||||
|
||||
#ifndef SUBTARGET_ASM_ENDIAN_SPEC
|
||||
@@ -1853,7 +1856,7 @@ struct sh_args {
|
||||
|
||||
/* Nonzero if the target supports dynamic shift instructions
|
||||
like shad and shld. */
|
||||
-#define TARGET_DYNSHIFT (TARGET_SH3 || TARGET_SH2A)
|
||||
+#define TARGET_DYNSHIFT (TARGET_SH3 || TARGET_SH2A || TARGET_SHJ2)
|
||||
|
||||
/* The cost of using the dynamic shift insns (shad, shld) are the same
|
||||
if they are available. If they are not available a library function will
|
||||
@@ -2185,6 +2188,7 @@ enum processor_type {
|
||||
PROCESSOR_SH2,
|
||||
PROCESSOR_SH2E,
|
||||
PROCESSOR_SH2A,
|
||||
+ PROCESSOR_SHJ2,
|
||||
PROCESSOR_SH3,
|
||||
PROCESSOR_SH3E,
|
||||
PROCESSOR_SH4,
|
||||
diff --git a/gcc/config/sh/sh.opt b/gcc/config/sh/sh.opt
|
||||
index 1026c73..bac47ed 100644
|
||||
--- a/gcc/config/sh/sh.opt
|
||||
+++ b/gcc/config/sh/sh.opt
|
||||
@@ -71,6 +71,10 @@ m2e
|
||||
Target RejectNegative Condition(SUPPORT_SH2E)
|
||||
Generate SH2e code.
|
||||
|
||||
+mj2
|
||||
+Target RejectNegative Mask(SHJ2) Condition(SUPPORT_SHJ2)
|
||||
+Generate J2 code.
|
||||
+
|
||||
m3
|
||||
Target RejectNegative Mask(SH3) Condition(SUPPORT_SH3)
|
||||
Generate SH3 code.
|
||||
diff --git a/gcc/config/sh/sync.md b/gcc/config/sh/sync.md
|
||||
index 6f1337b..7cfd9ef 100644
|
||||
--- a/gcc/config/sh/sync.md
|
||||
+++ b/gcc/config/sh/sync.md
|
||||
@@ -240,6 +240,9 @@
|
||||
|| (TARGET_SH4A && <MODE>mode == SImode && !TARGET_ATOMIC_STRICT))
|
||||
atomic_insn = gen_atomic_compare_and_swap<mode>_hard (old_val, mem,
|
||||
exp_val, new_val);
|
||||
+ else if (TARGET_ATOMIC_HARD_CAS && <MODE>mode == SImode)
|
||||
+ atomic_insn = gen_atomic_compare_and_swap<mode>_cas (old_val, mem,
|
||||
+ exp_val, new_val);
|
||||
else if (TARGET_ATOMIC_SOFT_GUSA)
|
||||
atomic_insn = gen_atomic_compare_and_swap<mode>_soft_gusa (old_val, mem,
|
||||
exp_val, new_val);
|
||||
@@ -306,6 +309,57 @@
|
||||
}
|
||||
[(set_attr "length" "14")])
|
||||
|
||||
+(define_expand "atomic_compare_and_swapsi_cas"
|
||||
+ [(set (match_operand:SI 0 "register_operand" "=r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
|
||||
+ (match_operand:SI 2 "register_operand" "r")
|
||||
+ (match_operand:SI 3 "register_operand" "r")]
|
||||
+ UNSPECV_CMPXCHG_1))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+{
|
||||
+ rtx mem = gen_rtx_REG (SImode, 0);
|
||||
+ emit_move_insn (mem, force_reg (SImode, XEXP (operands[1], 0)));
|
||||
+ emit_insn (gen_shj2_cas (operands[0], mem, operands[2], operands[3]));
|
||||
+ DONE;
|
||||
+})
|
||||
+
|
||||
+(define_insn "shj2_cas"
|
||||
+ [(set (match_operand:SI 0 "register_operand" "=&r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "register_operand" "=r")
|
||||
+ (match_operand:SI 2 "register_operand" "r")
|
||||
+ (match_operand:SI 3 "register_operand" "0")]
|
||||
+ UNSPECV_CMPXCHG_1))
|
||||
+ (set (reg:SI T_REG)
|
||||
+ (unspec_volatile:SI [(const_int 0)] UNSPECV_CMPXCHG_3))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+ "cas.l %2,%0,@%1"
|
||||
+ [(set_attr "length" "2")]
|
||||
+)
|
||||
+
|
||||
+(define_expand "atomic_compare_and_swapqi_cas"
|
||||
+ [(set (match_operand:SI 0 "arith_reg_dest" "=&r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
|
||||
+ (match_operand:SI 2 "arith_operand" "rI08")
|
||||
+ (match_operand:SI 3 "arith_operand" "rI08")]
|
||||
+ UNSPECV_CMPXCHG_1))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+{FAIL;}
|
||||
+)
|
||||
+
|
||||
+(define_expand "atomic_compare_and_swaphi_cas"
|
||||
+ [(set (match_operand:SI 0 "arith_reg_dest" "=&r")
|
||||
+ (unspec_volatile:SI
|
||||
+ [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
|
||||
+ (match_operand:SI 2 "arith_operand" "rI08")
|
||||
+ (match_operand:SI 3 "arith_operand" "rI08")]
|
||||
+ UNSPECV_CMPXCHG_1))]
|
||||
+ "TARGET_ATOMIC_HARD_CAS"
|
||||
+{FAIL;}
|
||||
+)
|
||||
+
|
||||
;; The QIHImode llcs patterns modify the address register of the memory
|
||||
;; operand. In order to express that, we have to open code the memory
|
||||
;; operand. Initially the insn is expanded like every other atomic insn
|
||||
diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh
|
||||
index 348cc0b..8e6bdaf 100644
|
||||
--- a/gcc/config/sh/t-sh
|
||||
+++ b/gcc/config/sh/t-sh
|
||||
@@ -52,7 +52,7 @@ MULTILIB_MATCHES = $(shell \
|
||||
m4-single,m4-100-single,m4-200-single,m4-300-single,m4a-single \
|
||||
m4,m4-100,m4-200,m4-300,m4a \
|
||||
m5-32media,m5-compact,m5-32media \
|
||||
- m5-32media-nofpu,m5-compact-nofpu,m5-32media-nofpu; do \
|
||||
+ m5-32media-nofpu,m5-compact-nofpu,m5-32media-nofpu,mj2; do \
|
||||
subst= ; \
|
||||
for lib in `echo $$abi|tr , ' '` ; do \
|
||||
if test "`echo $$multilibs|sed s/$$lib//`" != "$$multilibs"; then \
|
||||
@@ -65,9 +65,9 @@ MULTILIB_MATCHES = $(shell \
|
||||
|
||||
# SH1 and SH2A support big endian only.
|
||||
ifeq ($(DEFAULT_ENDIAN),ml)
|
||||
-MULTILIB_EXCEPTIONS = m1 ml/m1 m2a* ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
+MULTILIB_EXCEPTIONS = m1 ml/m1 m2a* ml/m2a* ml/mj2 $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
else
|
||||
-MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
+MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* ml/mj2 $(TM_MULTILIB_EXCEPTIONS_CONFIG)
|
||||
endif
|
||||
|
||||
MULTILIB_OSDIRNAMES = \
|
||||
@@ -96,6 +96,7 @@ MULTILIB_OSDIRNAMES = \
|
||||
m5-compact-nofpu=!m5-compact-nofpu $(OTHER_ENDIAN)/m5-compact-nofpu=!$(OTHER_ENDIAN)/m5-compact-nofpu \
|
||||
m5-64media=!m5-64media $(OTHER_ENDIAN)/m5-64media=!$(OTHER_ENDIAN)/m5-64media \
|
||||
m5-64media-nofpu=!m5-64media-nofpu $(OTHER_ENDIAN)/m5-64media-nofpu=!$(OTHER_ENDIAN)/m5-64media-nofpu
|
||||
+ mj2=!j2
|
||||
|
||||
$(out_object_file): gt-sh.h
|
||||
gt-sh.h : s-gtype ; @true
|
|
@ -1,14 +0,0 @@
|
|||
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
|
||||
index 9b00af7..3aacde6 100644
|
||||
--- a/gcc/config/s390/linux.h
|
||||
+++ b/gcc/config/s390/linux.h
|
||||
@@ -63,6 +63,9 @@ along with GCC; see the file COPYING3. If not see
|
||||
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
|
||||
#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
|
||||
|
||||
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-s390.so.1"
|
||||
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-s390x.so.1"
|
||||
+
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
"%{m31:-m elf_s390}%{m64:-m elf64_s390} \
|
|
@ -1,20 +0,0 @@
|
|||
--- gcc-6.3.0/gcc/config/microblaze/microblaze.c.orig 2017-01-02 15:07:18.924082703 -0500
|
||||
+++ gcc-6.3.0/gcc/config/microblaze/microblaze.c 2017-01-02 15:08:06.362438573 -0500
|
||||
@@ -2364,7 +2364,7 @@
|
||||
unsigned long value_long;
|
||||
REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (op),
|
||||
value_long);
|
||||
- fprintf (file, HOST_WIDE_INT_PRINT_HEX, value_long);
|
||||
+ fprintf (file, "0x%lx", value_long);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2423,7 +2423,7 @@
|
||||
print_operand_address (file, XEXP (op, 0));
|
||||
}
|
||||
else if (letter == 'm')
|
||||
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, (1L << INTVAL (op)));
|
||||
+ fprintf (file, "%ld", (1L << INTVAL (op)));
|
||||
else
|
||||
output_addr_const (file, op);
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/gcc/ubsan.c b/gcc/ubsan.c
|
||||
index 56637d8..1093824 100644
|
||||
--- a/gcc/ubsan.c
|
||||
+++ b/gcc/ubsan.c
|
||||
@@ -1471,7 +1471,7 @@ ubsan_use_new_style_p (location_t loc)
|
||||
|
||||
expanded_location xloc = expand_location (loc);
|
||||
if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0
|
||||
- || xloc.file == '\0' || xloc.file[0] == '\xff'
|
||||
+ || xloc.file[0] == '\0' || xloc.file[0] == '\xff'
|
||||
|| xloc.file[1] == '\xff')
|
||||
return false;
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
diff -ur gcc-6.4.0/gcc/config/m68k/linux.h gcc-6.4.0.new/gcc/config/m68k/linux.h
|
||||
--- gcc-6.4.0/gcc/config/m68k/linux.h 2016-01-04 09:30:50.000000000 -0500
|
||||
+++ gcc-6.4.0.new/gcc/config/m68k/linux.h 2018-06-12 20:03:47.047502695 -0400
|
||||
@@ -73,6 +73,9 @@
|
||||
|
||||
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
|
||||
+#undef MUSL_DYNAMIC_LINKER
|
||||
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1"
|
||||
+
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-m m68kelf %{shared} \
|
||||
%{!shared: \
|
||||
diff -ur gcc-6.4.0/libgcc/config/m68k/linux-atomic.c gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c
|
||||
--- gcc-6.4.0/libgcc/config/m68k/linux-atomic.c 2016-01-04 09:30:50.000000000 -0500
|
||||
+++ gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c 2018-06-07 16:15:11.610163418 -0400
|
||||
@@ -33,7 +33,6 @@
|
||||
using the kernel helper defined below. There is no support for
|
||||
64-bit operations yet. */
|
||||
|
||||
-#include <asm/unistd.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef __NR_atomic_cmpxchg_32
|
||||
diff -ur gcc-6.4.0/libgcc/config/m68k/linux-unwind.h gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h
|
||||
--- gcc-6.4.0/libgcc/config/m68k/linux-unwind.h 2016-01-04 09:30:50.000000000 -0500
|
||||
+++ gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h 2018-06-07 16:17:16.964591108 -0400
|
||||
@@ -37,7 +37,7 @@
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
unsigned long uc_filler[80];
|
||||
- __sigset_t uc_sigmask;
|
||||
+ sigset_t uc_sigmask;
|
||||
};
|
||||
|
||||
#define MD_FALLBACK_FRAME_STATE_FOR m68k_fallback_frame_state
|
Loading…
Reference in New Issue