summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2015-01-03 13:19:01 +0100
committerBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2015-01-03 13:19:01 +0100
commitceb3ec18ee69ad755a4d5d0ec7fa036969166a3f (patch)
tree2a41057d4904a83e9d005a2a7d6c2be440b38477
parent165a27da3b1f66058fbbd838a7cee30b645e62f1 (diff)
downloadgcc-patches-ceb3ec18ee69ad755a4d5d0ec7fa036969166a3f.tar.gz
Rebase patches to current trunk
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r--5.0/0008-Fix-OpenMP-support-on-Android.patch97
-rw-r--r--5.0/0013-Fix-openmp-support-to-use-libgomp-config-linux.patch58
-rw-r--r--5.0/0017-Use-eh_frame_hdr-for-static-linking.patch210
-rw-r--r--5.0/0018-use-android-specs-on-aarch64.patch150
-rw-r--r--5.0/0019-aarch64-bionic-linker-path.patch8
5 files changed, 193 insertions, 330 deletions
diff --git a/5.0/0008-Fix-OpenMP-support-on-Android.patch b/5.0/0008-Fix-OpenMP-support-on-Android.patch
index 6199e3e..1981e11 100644
--- a/5.0/0008-Fix-OpenMP-support-on-Android.patch
+++ b/5.0/0008-Fix-OpenMP-support-on-Android.patch
@@ -1,23 +1,5 @@
-From 44d86ccd03dd8224b82bfd53e4b899aeeb61a0ec Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?=
- <Bernhard.Rosenkranzer@linaro.org>
-Date: Mon, 6 Jan 2014 00:02:23 +0100
-Subject: [PATCH 08/17] Fix OpenMP support on Android
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
----
- gcc/config/linux-android.h | 3 ++-
- libgomp/configure | 52 +++++++++++++++++++++++++++++++++++++++++++++-
- libgomp/configure.ac | 9 +++++++-
- 3 files changed, 61 insertions(+), 3 deletions(-)
-
-diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
-index 26f1a74..24574fa 100644
---- a/gcc/config/linux-android.h
-+++ b/gcc/config/linux-android.h
+--- gcc-5.0/gcc/config/linux-android.h.omv~ 2015-01-03 12:36:08.117468854 +0100
++++ gcc-5.0/gcc/config/linux-android.h 2015-01-03 12:36:38.661015906 +0100
@@ -49,7 +49,8 @@
"%{!frtti:%{!fno-rtti: -fno-rtti}}"
@@ -28,11 +10,34 @@ index 26f1a74..24574fa 100644
#define ANDROID_STARTFILE_SPEC \
"%{shared: crtbegin_so%O%s;:" \
-diff --git a/libgomp/configure b/libgomp/configure
-index 766eb09..17e8445 100755
---- a/libgomp/configure
-+++ b/libgomp/configure
-@@ -15028,7 +15028,54 @@ _ACEOF
+--- gcc-5.0/libgomp/configure.ac.omv~ 2015-01-03 12:40:54.506113200 +0100
++++ gcc-5.0/libgomp/configure.ac 2015-01-03 12:43:03.946990041 +0100
+@@ -184,6 +184,13 @@ AC_LINK_IFELSE(
+ void *g(void *d) { return NULL; }],
+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
+ [XPCFLAGS=" -Wc,-pthread"],
++ [CFLAGS="$save_CFLAGS" LIBS="$LIBS"
++ AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <pthread.h>
++ void *g(void *d) { return NULL; }],
++ [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
++ [],
+ [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+@@ -191,7 +198,7 @@ AC_LINK_IFELSE(
+ void *g(void *d) { return NULL; }],
+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
+ [],
+- [AC_MSG_ERROR([Pthreads are required to build libgomp])])])
++ [AC_MSG_ERROR([Pthreads are required to build libgomp])])])])
+
+ plugin_support=yes
+ AC_CHECK_LIB(dl, dlsym, , [plugin_support=no])
+--- gcc-5.0/libgomp/configure.omv~ 2015-01-03 12:36:49.937761295 +0100
++++ gcc-5.0/libgomp/configure 2015-01-03 12:40:50.789421213 +0100
+@@ -15031,7 +15031,54 @@ _ACEOF
if ac_fn_c_try_link "$LINENO"; then :
XPCFLAGS=" -Wc,-pthread"
else
@@ -88,43 +93,13 @@ index 766eb09..17e8445 100755
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
-@@ -15051,6 +15098,9 @@ rm -f core conftest.err conftest.$ac_objext \
- fi
- rm -f core conftest.err conftest.$ac_objext \
+@@ -15090,6 +15137,9 @@ rm -f core conftest.err conftest.$ac_obj
conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
-
- # Check for functions needed.
- for ac_func in getloadavg clock_gettime strtoull
-diff --git a/libgomp/configure.ac b/libgomp/configure.ac
-index 84d250f..59b9516 100644
---- a/libgomp/configure.ac
-+++ b/libgomp/configure.ac
-@@ -184,6 +184,13 @@ AC_LINK_IFELSE(
- void *g(void *d) { return NULL; }],
- [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
- [XPCFLAGS=" -Wc,-pthread"],
-+ [CFLAGS="$save_CFLAGS" LIBS="$LIBS"
-+ AC_LINK_IFELSE(
-+ [AC_LANG_PROGRAM(
-+ [#include <pthread.h>
-+ void *g(void *d) { return NULL; }],
-+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
-+ [],
- [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
-@@ -191,7 +198,7 @@ AC_LINK_IFELSE(
- void *g(void *d) { return NULL; }],
- [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
- [],
-- [AC_MSG_ERROR([Pthreads are required to build libgomp])])])
-+ [AC_MSG_ERROR([Pthreads are required to build libgomp])])])])
-
- # Check for functions needed.
- AC_CHECK_FUNCS(getloadavg clock_gettime strtoull)
---
-1.8.4.5
-
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5
+ $as_echo "$ac_cv_lib_dl_dlsym" >&6; }
+ if test "x$ac_cv_lib_dl_dlsym" = x""yes; then :
diff --git a/5.0/0013-Fix-openmp-support-to-use-libgomp-config-linux.patch b/5.0/0013-Fix-openmp-support-to-use-libgomp-config-linux.patch
index 1c90596..7887035 100644
--- a/5.0/0013-Fix-openmp-support-to-use-libgomp-config-linux.patch
+++ b/5.0/0013-Fix-openmp-support-to-use-libgomp-config-linux.patch
@@ -1,24 +1,5 @@
-From acb7b01010510a493a6770593448df263d1a876a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?=
- <Bernhard.Rosenkranzer@linaro.org>
-Date: Mon, 6 Jan 2014 00:09:46 +0100
-Subject: [PATCH 13/17] Fix openmp support to use libgomp/config/linux
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
----
- libgomp/config/linux/futex.h | 4 ++++
- libgomp/config/linux/mips/futex.h | 5 +++++
- libgomp/config/linux/proc.c | 10 +++++++---
- libgomp/configure | 12 ++++++++++++
- 4 files changed, 28 insertions(+), 3 deletions(-)
-
-diff --git a/libgomp/config/linux/futex.h b/libgomp/config/linux/futex.h
-index 802abfd..f4eab68 100644
---- a/libgomp/config/linux/futex.h
-+++ b/libgomp/config/linux/futex.h
+--- gcc-5.0/libgomp/config/linux/futex.h.omv~ 2015-01-03 12:45:11.657846480 +0100
++++ gcc-5.0/libgomp/config/linux/futex.h 2015-01-03 12:45:38.064689252 +0100
@@ -38,6 +38,10 @@
#pragma GCC visibility pop
@@ -30,26 +11,8 @@ index 802abfd..f4eab68 100644
static inline void
futex_wait (int *addr, int val)
{
-diff --git a/libgomp/config/linux/mips/futex.h b/libgomp/config/linux/mips/futex.h
-index ae32b80..641308c 100644
---- a/libgomp/config/linux/mips/futex.h
-+++ b/libgomp/config/linux/mips/futex.h
-@@ -25,6 +25,11 @@
- /* Provide target-specific access to the futex system call. */
-
- #include <sys/syscall.h>
-+
-+#if !defined(SYS_futex)
-+#define SYS_futex __NR_futex
-+#endif
-+
- #define FUTEX_WAIT 0
- #define FUTEX_WAKE 1
-
-diff --git a/libgomp/config/linux/proc.c b/libgomp/config/linux/proc.c
-index 15b0b35..a6a5e99 100644
---- a/libgomp/config/linux/proc.c
-+++ b/libgomp/config/linux/proc.c
+--- gcc-5.0/libgomp/config/linux/proc.c.omv~ 2015-01-03 12:45:56.378144531 +0100
++++ gcc-5.0/libgomp/config/linux/proc.c 2015-01-03 12:48:26.195803418 +0100
@@ -244,7 +244,7 @@ sc_nprocessors_actu ()
if (buffer_len < 0) /* should not happen */ {
@@ -83,11 +46,9 @@ index 15b0b35..a6a5e99 100644
#else
return gomp_icv (false)->nthreads_var;
#endif
-diff --git a/libgomp/configure b/libgomp/configure
-index 17e8445..6fbafe3 100755
---- a/libgomp/configure
-+++ b/libgomp/configure
-@@ -15155,6 +15155,12 @@ case "$target" in
+--- gcc-5.0/libgomp/configure.omv~ 2015-01-03 12:48:31.039168677 +0100
++++ gcc-5.0/libgomp/configure 2015-01-03 12:49:50.139688833 +0100
+@@ -15212,6 +15212,12 @@ case "$target" in
/* end confdefs.h. */
#include <sys/syscall.h>
int lk;
@@ -100,7 +61,7 @@ index 17e8445..6fbafe3 100755
int
main ()
{
-@@ -15207,6 +15213,12 @@ rm -f core conftest.err conftest.$ac_objext \
+@@ -15264,6 +15270,12 @@ rm -f core conftest.err conftest.$ac_obj
/* end confdefs.h. */
#include <sys/syscall.h>
int lk;
@@ -113,6 +74,3 @@ index 17e8445..6fbafe3 100755
int
main ()
{
---
-1.8.4.5
-
diff --git a/5.0/0017-Use-eh_frame_hdr-for-static-linking.patch b/5.0/0017-Use-eh_frame_hdr-for-static-linking.patch
index 2547dbd..212f5d5 100644
--- a/5.0/0017-Use-eh_frame_hdr-for-static-linking.patch
+++ b/5.0/0017-Use-eh_frame_hdr-for-static-linking.patch
@@ -1,48 +1,6 @@
-From 855dd6fb76c5628fd2e982456f435932ef20d992 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?=
- <Bernhard.Rosenkranzer@linaro.org>
-Date: Mon, 6 Jan 2014 00:13:28 +0100
-Subject: [PATCH 17/17] Use eh_frame_hdr for static linking
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
----
- gcc/config.in | 6 ++++++
- gcc/config/alpha/elf.h | 4 ++++
- gcc/config/freebsd.h | 4 ++++
- gcc/config/gnu-user.h | 4 ++++
- gcc/config/openbsd.h | 4 ++++
- gcc/config/rs6000/sysv4.h | 6 +++++-
- gcc/config/sol2.h | 4 ++++
- gcc/configure | 36 ++++++++++++++++++++++++++++++++++++
- gcc/configure.ac | 29 +++++++++++++++++++++++++++++
- libgcc/crtstuff.c | 11 +++++++----
- 10 files changed, 103 insertions(+), 5 deletions(-)
-
-diff --git a/gcc/config.in b/gcc/config.in
-index 3aefa06..5b7e6e8 100644
---- a/gcc/config.in
-+++ b/gcc/config.in
-@@ -1860,6 +1860,12 @@
- #endif
-
-
-+/* Define if your system supports PT_GNU_EH_FRAME for static executable. */
-+#ifndef USED_FOR_TARGET
-+#undef USE_EH_FRAME_HDR_FOR_STATIC
-+#endif
-+
-+
- /* Define to 1 if the 'long long' (or '__int64') is wider than 'long' but
- still efficiently supported by the host hardware. */
- #ifndef USED_FOR_TARGET
-diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
-index 5a6803a..6ae4065 100644
---- a/gcc/config/alpha/elf.h
-+++ b/gcc/config/alpha/elf.h
-@@ -164,5 +164,9 @@ extern int alpha_this_gpdisp_sequence_number;
+--- gcc-5.0/gcc/config/alpha/elf.h.omv~ 2015-01-03 12:52:18.403762854 +0100
++++ gcc-5.0/gcc/config/alpha/elf.h 2015-01-03 12:53:05.767258870 +0100
+@@ -168,5 +168,9 @@ extern int alpha_this_gpdisp_sequence_nu
I imagine that other systems will catch up. In the meantime, it
doesn't harm to make sure that the data exists to be used later. */
#if defined(HAVE_LD_EH_FRAME_HDR)
@@ -52,11 +10,9 @@ index 5a6803a..6ae4065 100644
#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
#endif
+#endif
-diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h
-index c872a6d..7c032a5 100644
---- a/gcc/config/freebsd.h
-+++ b/gcc/config/freebsd.h
-@@ -45,8 +45,12 @@ along with GCC; see the file COPYING3. If not see
+--- gcc-5.0/gcc/config/freebsd.h.omv~ 2015-01-03 12:53:12.360615299 +0100
++++ gcc-5.0/gcc/config/freebsd.h 2015-01-03 12:53:45.750733907 +0100
+@@ -45,8 +45,12 @@ along with GCC; see the file COPYING3.
#define LIB_SPEC FBSD_LIB_SPEC
#if defined(HAVE_LD_EH_FRAME_HDR)
@@ -69,11 +25,9 @@ index c872a6d..7c032a5 100644
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared}"
-diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
-index a1955a7..2af0a54 100644
---- a/gcc/config/gnu-user.h
-+++ b/gcc/config/gnu-user.h
-@@ -94,8 +94,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+--- gcc-5.0/gcc/config/gnu-user.h.omv~ 2015-01-03 12:53:50.734085173 +0100
++++ gcc-5.0/gcc/config/gnu-user.h 2015-01-03 12:54:13.590834847 +0100
+@@ -94,8 +94,12 @@ see the files COPYING3 and COPYING.RUNTI
#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
#if defined(HAVE_LD_EH_FRAME_HDR)
@@ -86,10 +40,21 @@ index a1955a7..2af0a54 100644
#undef LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC \
-diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h
-index 7150d49..6004748 100644
---- a/gcc/config/openbsd.h
-+++ b/gcc/config/openbsd.h
+--- gcc-5.0/gcc/config.in.omv~ 2015-01-03 12:51:09.193535754 +0100
++++ gcc-5.0/gcc/config.in 2015-01-03 12:52:08.790397207 +0100
+@@ -1992,6 +1992,10 @@
+ #undef USE_CYGWIN_LIBSTDCXX_WRAPPERS
+ #endif
+
++/* Define if your system supports PT_GNU_EH_FRAME for static executables. */
++#ifndef USED_FOR_TARGET
++#undef USE_EH_FRAME_HDR_FOR_STATIC
++#endif
+
+ /* Define to 1 if the 'long long' type is wider than 'long' but still
+ efficiently supported by the host hardware. */
+--- gcc-5.0/gcc/config/openbsd.h.omv~ 2015-01-03 12:54:17.810850308 +0100
++++ gcc-5.0/gcc/config/openbsd.h 2015-01-03 12:54:47.117625474 +0100
@@ -136,8 +136,12 @@ while (0)
#define LIB_SPEC OBSD_LIB_SPEC
@@ -103,11 +68,9 @@ index 7150d49..6004748 100644
#undef LIB_SPEC
#define LIB_SPEC OBSD_LIB_SPEC
-diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
-index 04d988e..ae8c83c 100644
---- a/gcc/config/rs6000/sysv4.h
-+++ b/gcc/config/rs6000/sysv4.h
-@@ -788,7 +788,11 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+--- gcc-5.0/gcc/config/rs6000/sysv4.h.omv~ 2015-01-03 12:54:56.594327642 +0100
++++ gcc-5.0/gcc/config/rs6000/sysv4.h 2015-01-03 12:55:24.477766592 +0100
+@@ -779,7 +779,11 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
#if defined(HAVE_LD_EH_FRAME_HDR)
@@ -120,11 +83,9 @@ index 04d988e..ae8c83c 100644
#endif
#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
-diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
-index a023cfe..95d179f 100644
---- a/gcc/config/sol2.h
-+++ b/gcc/config/sol2.h
-@@ -193,7 +193,11 @@ along with GCC; see the file COPYING3. If not see
+--- gcc-5.0/gcc/config/sol2.h.omv~ 2015-01-03 12:58:09.745092558 +0100
++++ gcc-5.0/gcc/config/sol2.h 2015-01-03 12:58:35.988535463 +0100
+@@ -296,7 +296,11 @@ along with GCC; see the file COPYING3.
/* Solaris 11 build 135+ implements dl_iterate_phdr. GNU ld needs
--eh-frame-hdr to create the required .eh_frame_hdr sections. */
#if defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
@@ -136,19 +97,55 @@ index a023cfe..95d179f 100644
#endif /* HAVE_LD_EH_FRAME && TARGET_DL_ITERATE_PHDR */
#endif
-diff --git a/gcc/configure b/gcc/configure
-index 5a58b59..1f0df5c 100755
---- a/gcc/configure
-+++ b/gcc/configure
-@@ -921,6 +921,7 @@ enable_initfini_array
- enable_comdat
+--- gcc-5.0/gcc/configure.ac.omv~ 2015-01-03 13:00:55.745805865 +0100
++++ gcc-5.0/gcc/configure.ac 2015-01-03 13:01:52.739394493 +0100
+@@ -4635,6 +4635,35 @@ GCC_TARGET_TEMPLATE([HAVE_LD_EH_FRAME_HD
+ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
+ AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1,
+ [Define if your linker supports .eh_frame_hdr.])
++ AC_ARG_ENABLE(eh-frame-hdr-for-static,
++ [AS_HELP_STRING([--enable-eh-frame-hdr-for-static],
++ [enable linker PT_GNU_EH_FRAME support for static executable])],
++ [case $enable_eh_frame_hdr_for_static in
++ yes | no) ;;
++ *) AC_MSG_ERROR(['$enable_eh_frame_hdr_for_static' is an invalid
++value for --enable-eh-frame-hdr-for-static.
++Valid choices are 'yes' and 'no'.]) ;;
++ esac],
++# Only support for glibc 2.3.0 or higher with AT_PHDR/AT_PHNUM from
++# Linux kernel.
++ [[if test x$host = x$build -a x$host = x$target &&
++ ldd --version 2>&1 >/dev/null &&
++ glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
++ glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
++ glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
++ glibcnum=`expr $glibcmajor \* 1000 + $glibcminor`
++ if test "$glibcnum" -ge 2003 ; then
++ auvx=`LD_SHOW_AUXV=1 ldd 2>/dev/null`
++ if echo "$auvx" | grep AT_PHDR > /dev/null &&
++ echo "$auvx" | grep AT_PHNUM > /dev/null; then
++ enable_eh_frame_hdr_for_static=yes
++ fi
++ fi
++ fi]])
++ if test x$enable_eh_frame_hdr_for_static = xyes; then
++ AC_DEFINE(USE_EH_FRAME_HDR_FOR_STATIC, 1,
++[Define if your system supports PT_GNU_EH_FRAME for static executable.])
++ fi
+ fi
+ AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
+
+--- gcc-5.0/gcc/configure.omv~ 2015-01-03 12:58:40.815222419 +0100
++++ gcc-5.0/gcc/configure 2015-01-03 13:00:53.709130169 +0100
+@@ -925,6 +925,7 @@ enable_comdat
+ enable_fix_cortex_a53_835769
with_glibc_version
enable_gnu_unique_object
+enable_eh_frame_hdr_for_static
enable_linker_build_id
with_long_double_128
with_gc
-@@ -1638,6 +1639,9 @@ Optional Features:
+@@ -1651,6 +1652,9 @@ Optional Features:
--enable-gnu-unique-object
enable the use of the @gnu_unique_object ELF
extension on glibc systems
@@ -158,7 +155,7 @@ index 5a58b59..1f0df5c 100755
--enable-linker-build-id
compiler will always pass --build-id to linker
--enable-maintainer-mode
-@@ -26677,6 +26681,38 @@ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
+@@ -26959,6 +26963,38 @@ if test x"$gcc_cv_ld_eh_frame_hdr" = xye
$as_echo "#define HAVE_LD_EH_FRAME_HDR 1" >>confdefs.h
@@ -197,61 +194,19 @@ index 5a58b59..1f0df5c 100755
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_eh_frame_hdr" >&5
$as_echo "$gcc_cv_ld_eh_frame_hdr" >&6; }
-diff --git a/gcc/configure.ac b/gcc/configure.ac
-index 0023b2a..c16909e 100644
---- a/gcc/configure.ac
-+++ b/gcc/configure.ac
-@@ -4499,6 +4499,35 @@ GCC_TARGET_TEMPLATE([HAVE_LD_EH_FRAME_HDR])
- if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
- AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1,
- [Define if your linker supports .eh_frame_hdr.])
-+ AC_ARG_ENABLE(eh-frame-hdr-for-static,
-+ [AS_HELP_STRING([--enable-eh-frame-hdr-for-static],
-+ [enable linker PT_GNU_EH_FRAME support for static executable])],
-+ [case $enable_eh_frame_hdr_for_static in
-+ yes | no) ;;
-+ *) AC_MSG_ERROR(['$enable_eh_frame_hdr_for_static' is an invalid
-+value for --enable-eh-frame-hdr-for-static.
-+Valid choices are 'yes' and 'no'.]) ;;
-+ esac],
-+# Only support for glibc 2.3.0 or higher with AT_PHDR/AT_PHNUM from
-+# Linux kernel.
-+ [[if test x$host = x$build -a x$host = x$target &&
-+ ldd --version 2>&1 >/dev/null &&
-+ glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
-+ glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
-+ glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
-+ glibcnum=`expr $glibcmajor \* 1000 + $glibcminor`
-+ if test "$glibcnum" -ge 2003 ; then
-+ auvx=`LD_SHOW_AUXV=1 ldd 2>/dev/null`
-+ if echo "$auvx" | grep AT_PHDR > /dev/null &&
-+ echo "$auvx" | grep AT_PHNUM > /dev/null; then
-+ enable_eh_frame_hdr_for_static=yes
-+ fi
-+ fi
-+ fi]])
-+ if test x$enable_eh_frame_hdr_for_static = xyes; then
-+ AC_DEFINE(USE_EH_FRAME_HDR_FOR_STATIC, 1,
-+[Define if your system supports PT_GNU_EH_FRAME for static executable.])
-+ fi
- fi
- AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
-
-diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
-index bc0398d..74f80cd 100644
---- a/libgcc/crtstuff.c
-+++ b/libgcc/crtstuff.c
-@@ -82,7 +82,8 @@ call_ ## FUNC (void) \
+--- gcc-5.0/libgcc/crtstuff.c.omv~ 2015-01-03 13:02:06.309456002 +0100
++++ gcc-5.0/libgcc/crtstuff.c 2015-01-03 13:05:35.547103310 +0100
+@@ -88,7 +88,8 @@ call_ ## FUNC (void) \
#if defined(OBJECT_FORMAT_ELF) \
&& !defined(OBJECT_FORMAT_FLAT) \
&& defined(HAVE_LD_EH_FRAME_HDR) \
- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
+ && !defined(inhibit_libc) \
+ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
- && defined(__FreeBSD__) && __FreeBSD__ >= 7
+ && defined(BSD_DL_ITERATE_PHDR_AVAILABLE)
#include <link.h>
# define USE_PT_GNU_EH_FRAME
-@@ -91,7 +92,8 @@ call_ ## FUNC (void) \
+@@ -97,7 +98,8 @@ call_ ## FUNC (void) \
#if defined(OBJECT_FORMAT_ELF) \
&& !defined(OBJECT_FORMAT_FLAT) \
&& defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR) \
@@ -261,7 +216,7 @@ index bc0398d..74f80cd 100644
&& defined(__sun__) && defined(__svr4__)
#include <link.h>
# define USE_PT_GNU_EH_FRAME
-@@ -100,7 +102,8 @@ call_ ## FUNC (void) \
+@@ -106,7 +108,8 @@ call_ ## FUNC (void) \
#if defined(OBJECT_FORMAT_ELF) \
&& !defined(OBJECT_FORMAT_FLAT) \
&& defined(HAVE_LD_EH_FRAME_HDR) \
@@ -271,7 +226,7 @@ index bc0398d..74f80cd 100644
&& defined(__GLIBC__) && __GLIBC__ >= 2
#include <link.h>
/* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
-@@ -115,7 +118,7 @@ call_ ## FUNC (void) \
+@@ -121,7 +124,7 @@ call_ ## FUNC (void) \
#if defined(OBJECT_FORMAT_ELF) \
&& !defined(OBJECT_FORMAT_FLAT) \
&& defined(HAVE_LD_EH_FRAME_HDR) \
@@ -280,6 +235,3 @@ index bc0398d..74f80cd 100644
&& defined(inhibit_libc) \
&& (defined(__GLIBC__) || defined(__gnu_linux__) || defined(__GNU__))
/* On systems using glibc, an inhibit_libc build of libgcc is only
---
-1.8.4.5
-
diff --git a/5.0/0018-use-android-specs-on-aarch64.patch b/5.0/0018-use-android-specs-on-aarch64.patch
index ecd94fc..2a8107d 100644
--- a/5.0/0018-use-android-specs-on-aarch64.patch
+++ b/5.0/0018-use-android-specs-on-aarch64.patch
@@ -1,51 +1,48 @@
-commit 65453211e00f83dee15ba04e3297852d1683160d
-Author: Ben Cheng <bccheng@google.com>
-Date: Wed Apr 2 13:57:00 2014 -0700
-
- [4.9] Apply aarch64 patches for Android toolchain build.
-
- - The changes in gcc/config.gcc and gcc/config/aarch64/aarch64-linux.h
- will be upstreamed.
- - libatomic is disabled for now.
- - md_unwind_header in libgcc/config.host is also disabled for now due to
- lack of sys/ucontext.h.
-
- Change-Id: Idad7c75a9eaf27e6737fe3a217ff2791b4bf8358
-
-diff --git a/gcc/config.gcc b/gcc/config.gcc
-index 3c55c88..7e51940 100644
---- a/gcc/config.gcc
-+++ b/gcc/config.gcc
-@@ -903,8 +903,9 @@ aarch64*-*-elf)
- TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
- ;;
- aarch64*-*-linux*)
-- tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
-+ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h"
- tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"
-+ extra_options="${extra_options} linux-android.opt"
- tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
- case $target in
- aarch64_be-*)
-diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
-index a8f0771..4eacdb2 100644
---- a/gcc/config/aarch64/aarch64-linux.h
-+++ b/gcc/config/aarch64/aarch64-linux.h
-@@ -22,6 +22,7 @@
+--- gcc-5.0/gcc/config/aarch64/aarch64-linux.h.omv~ 2015-01-03 13:09:08.974824478 +0100
++++ gcc-5.0/gcc/config/aarch64/aarch64-linux.h 2015-01-03 13:14:47.643252366 +0100
+@@ -22,12 +22,30 @@
#define GCC_AARCH64_LINUX_H
- #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1"
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+#define BIONIC_DYNAMIC_LINKER "/system/bin/linker64"
+ #undef ASAN_CC1_SPEC
+ #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
+
+ #undef CC1_SPEC
+-#define CC1_SPEC GNU_USER_TARGET_CC1_SPEC ASAN_CC1_SPEC
++#define CC1_SPEC LINUX_OR_ANDROID_CC(GNU_USER_TARGET_CC1_SPEC, \
++ GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fPIC")) ASAN_CC1_SPEC
++
++#define CC1PLUS_SPEC \
++ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
++
++#undef LIB_SPEC
++#define LIB_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
++ GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC " " ANDROID_LIB_SPEC)
++
++#undef STARTFILE_SPEC
++#define STARTFILE_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC)
++
++#undef ENDFILE_SPEC
++#define ENDFILE_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
+
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
-@@ -35,13 +36,38 @@
- %{mbig-endian:-EB} %{mlittle-endian:-EL} \
- -maarch64linux%{mbig-endian:b}"
+@@ -49,7 +67,8 @@
+ " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}"
+ #endif
+
+-#define LINK_SPEC LINUX_TARGET_LINK_SPEC \
++#define LINK_SPEC LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
++ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) \
+ CA53_ERR_835769_SPEC
--#define LINK_SPEC LINUX_TARGET_LINK_SPEC
--
- #define TARGET_OS_CPP_BUILTINS() \
+ #define GNU_USER_TARGET_MATHFILE_SPEC \
+@@ -64,6 +83,7 @@
do \
{ \
GNU_USER_TARGET_OS_CPP_BUILTINS(); \
@@ -53,60 +50,41 @@ index a8f0771..4eacdb2 100644
} \
while (0)
-+#undef LINK_SPEC
-+#define LINK_SPEC \
-+ LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
-+ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
-+
-+#undef CC1_SPEC
-+#define CC1_SPEC \
-+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
-+ GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fPIC"))
-+
-+#define CC1PLUS_SPEC \
-+ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
-+
-+#undef LIB_SPEC
-+#define LIB_SPEC \
-+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
-+ GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC " " ANDROID_LIB_SPEC)
-+
-+#undef STARTFILE_SPEC
-+#define STARTFILE_SPEC \
-+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC)
-+
-+#undef ENDFILE_SPEC
-+#define ENDFILE_SPEC \
-+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
-+
- #endif /* GCC_AARCH64_LINUX_H */
-diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
-index a3757ef..3904e66 100644
---- a/libatomic/configure.tgt
-+++ b/libatomic/configure.tgt
-@@ -95,6 +95,11 @@ fi
+--- gcc-5.0/gcc/config.gcc.omv~ 2015-01-03 13:07:48.517754552 +0100
++++ gcc-5.0/gcc/config.gcc 2015-01-03 13:09:02.768126472 +0100
+@@ -906,8 +906,9 @@ aarch64*-*-elf)
+ TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
+ ;;
+ aarch64*-*-linux*)
+- tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
++ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h"
+ tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"
++ extra_options="${extra_options} linux-android.opt"
+ tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
+ case $target in
+ aarch64_be-*)
+--- gcc-5.0/libatomic/configure.tgt.omv~ 2015-01-03 13:14:54.263287687 +0100
++++ gcc-5.0/libatomic/configure.tgt 2015-01-03 13:15:56.350287068 +0100
+@@ -99,6 +99,10 @@ fi
# Other system configury
case "${target}" in
+ aarch64*)
-+ # ANDROID - This is currently not supported in AArch64.
-+ UNSUPPORTED=1
-+ ;;
-+
++ # ANDROID - This is currently not supported in AArch64.
++ UNSUPPORTED=1
++ ;;
arm*-*-linux*)
# OS support for atomic primitives.
config_path="${config_path} linux/arm posix"
-diff --git a/libgcc/config.host b/libgcc/config.host
-index f8f74cc..91d4962 100644
---- a/libgcc/config.host
-+++ b/libgcc/config.host
-@@ -320,7 +320,8 @@ aarch64*-*-elf)
- tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp"
+--- gcc-5.0/libgcc/config.host.omv~ 2015-01-03 13:16:00.970311928 +0100
++++ gcc-5.0/libgcc/config.host 2015-01-03 13:16:55.203938120 +0100
+@@ -325,7 +325,8 @@ aarch64*-*-elf)
;;
aarch64*-*-linux*)
+ extra_parts="$extra_parts crtfastmath.o"
- md_unwind_header=aarch64/linux-unwind.h
-+ # ANDROID - uncomment when sysroot contains sys/ucontext.h
-+ # md_unwind_header=aarch64/linux-unwind.h
++ # ANDROID - uncomment when sysroot contains sys/ucontext.h
++ #md_unwind_header=aarch64/linux-unwind.h
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
- tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp"
+ tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
;;
diff --git a/5.0/0019-aarch64-bionic-linker-path.patch b/5.0/0019-aarch64-bionic-linker-path.patch
index b9ef0e2..1e0ea5a 100644
--- a/5.0/0019-aarch64-bionic-linker-path.patch
+++ b/5.0/0019-aarch64-bionic-linker-path.patch
@@ -1,10 +1,10 @@
---- gcc-gcc-4_9-branch/gcc/config/aarch64/aarch64-linux.h.omv~ 2014-04-15 20:24:53.305564599 +0200
-+++ gcc-gcc-4_9-branch/gcc/config/aarch64/aarch64-linux.h 2014-04-15 20:25:00.657564298 +0200
+--- gcc-5.0/gcc/config/aarch64/aarch64-linux.h.omv~ 2015-01-03 13:17:54.257592402 +0100
++++ gcc-5.0/gcc/config/aarch64/aarch64-linux.h 2015-01-03 13:18:04.830983417 +0100
@@ -22,6 +22,7 @@
#define GCC_AARCH64_LINUX_H
- #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1"
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+#undef BIONIC_DYNAMIC_LINKER
#define BIONIC_DYNAMIC_LINKER "/system/bin/linker64"
- #define CPP_SPEC "%{pthread:-D_REENTRANT}"
+ #undef ASAN_CC1_SPEC