From 817a788f9eb01eff367191401d48f2aaa8d4f428 Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Wed, 10 Feb 2016 14:40:41 -0800 Subject: Unify ChromeOS and Android versions of GCC. This CL updates Android's GCC to match ChromeOS's GCC (with appropriate patches applied in both places to make sure no cherry-picked changes are lost). Change-Id: I390140c449b0e5df9ee78a06268319c8c510302f --- gcc-4.9/libgcc/config.host | 2 +- gcc-4.9/libgcc/config/i386/cpuinfo.c | 16 +++++++++++++++- gcc-4.9/libgcc/config/i386/t-linux | 6 +++++- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'gcc-4.9/libgcc') diff --git a/gcc-4.9/libgcc/config.host b/gcc-4.9/libgcc/config.host index b089fb918..896a31d17 100644 --- a/gcc-4.9/libgcc/config.host +++ b/gcc-4.9/libgcc/config.host @@ -1247,7 +1247,7 @@ i[34567]86-*-linux* | x86_64-*-linux* | \ i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \ i[34567]86-*-knetbsd*-gnu | \ i[34567]86-*-gnu*) - tmake_file="${tmake_file} t-tls i386/t-linux" + tmake_file="${tmake_file} t-tls i386/t-linux t-slibgcc-libgcc" if test "$libgcc_cv_cfi" = "yes"; then tmake_file="${tmake_file} t-stack i386/t-stack-i386" fi diff --git a/gcc-4.9/libgcc/config/i386/cpuinfo.c b/gcc-4.9/libgcc/config/i386/cpuinfo.c index 6ff7502bb..3cfda0270 100644 --- a/gcc-4.9/libgcc/config/i386/cpuinfo.c +++ b/gcc-4.9/libgcc/config/i386/cpuinfo.c @@ -34,6 +34,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #endif int __cpu_indicator_init (void) +#if !defined(SHARED) + __attribute__ ((visibility("hidden"))) +#endif __attribute__ ((constructor CONSTRUCTOR_PRIORITY)); /* Processor Vendor and Models. */ @@ -99,13 +102,16 @@ enum processor_features FEATURE_FMA }; +#if !defined(SHARED) + __attribute__ ((visibility("hidden"))) +#endif struct __processor_model { unsigned int __cpu_vendor; unsigned int __cpu_type; unsigned int __cpu_subtype; unsigned int __cpu_features[1]; -} __cpu_model; +} __cpu_model = { }; /* Get the specific type of AMD CPU. */ @@ -321,6 +327,9 @@ __get_cpuid_output (unsigned int __level, needs to be called explicitly there. */ int __attribute__ ((constructor CONSTRUCTOR_PRIORITY)) +#if !defined(SHARED) + __attribute__ ((visibility("hidden"))) +#endif __cpu_indicator_init (void) { unsigned int eax, ebx, ecx, edx; @@ -403,3 +412,8 @@ __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"); +#endif diff --git a/gcc-4.9/libgcc/config/i386/t-linux b/gcc-4.9/libgcc/config/i386/t-linux index 4f47f7bfa..12aab16b6 100644 --- a/gcc-4.9/libgcc/config/i386/t-linux +++ b/gcc-4.9/libgcc/config/i386/t-linux @@ -3,4 +3,8 @@ # t-slibgcc-elf-ver and t-linux SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/i386/libgcc-glibc.ver -HOST_LIBGCC2_CFLAGS += -mlong-double-80 +# Work around gold bug: +# https://sourceware.org/bugzilla/show_bug.cgi?id=18703 +SHLIB_LDFLAGS += -fuse-ld=bfd + +HOST_LIBGCC2_CFLAGS += -mlong-double-80 -DUSE_ELF_SYMVER -- cgit v1.2.3