From 8ca3ada77e50f58668ed31fac0d0b929a96ae40a Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Tue, 2 Apr 2013 18:52:48 +0800 Subject: [4.8] Enable x86/arm gcc defaults; Remove march/mtune/mfpmath hardcoded values See c779c1ff50bde450eb49b3998353804602c4d963 Used to be local NDK patch at $NDK/build/tools/toolchain-patches/ gcc/0004-Enable-x86-gcc-defaults.patch Also see 5578813961a205a7c5d3e9da8a1b5ec00d4dac3c They should be passed in configure to work correctly. See https://android-review.googlesource.com/50815 Change-Id: I0be1f1111870070f25d92d390d2738b52315865d --- gcc-4.8/gcc/config/arm/linux-eabi.h | 2 +- gcc-4.8/gcc/config/i386/linux-common.h | 9 ++++++++- gcc-4.8/gcc/config/linux-android.h | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'gcc-4.8') diff --git a/gcc-4.8/gcc/config/arm/linux-eabi.h b/gcc-4.8/gcc/config/arm/linux-eabi.h index a320c36ca..305d7cb34 100644 --- a/gcc-4.8/gcc/config/arm/linux-eabi.h +++ b/gcc-4.8/gcc/config/arm/linux-eabi.h @@ -87,7 +87,7 @@ #undef CC1_SPEC #define CC1_SPEC \ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \ - GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC) + GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fpic")) #define CC1PLUS_SPEC \ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC) diff --git a/gcc-4.8/gcc/config/i386/linux-common.h b/gcc-4.8/gcc/config/i386/linux-common.h index 1e8bf6b2d..731a5bd0f 100644 --- a/gcc-4.8/gcc/config/i386/linux-common.h +++ b/gcc-4.8/gcc/config/i386/linux-common.h @@ -30,7 +30,14 @@ along with GCC; see the file COPYING3. If not see #undef CC1_SPEC #define CC1_SPEC \ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \ - GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC) + GNU_USER_TARGET_CC1_SPEC \ + " -mstackrealign -msse3" \ + " -m32 -fno-short-enums" \ + " " \ + ANDROID_CC1_SPEC("-fPIC")) + +#define CC1PLUS_SPEC \ + LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC) #undef LINK_SPEC #define LINK_SPEC \ diff --git a/gcc-4.8/gcc/config/linux-android.h b/gcc-4.8/gcc/config/linux-android.h index c97b9b765..a82c3f067 100644 --- a/gcc-4.8/gcc/config/linux-android.h +++ b/gcc-4.8/gcc/config/linux-android.h @@ -40,9 +40,9 @@ #define ANDROID_LINK_SPEC \ "%{shared: -Bsymbolic} -z noexecstack -z relro -z now" -#define ANDROID_CC1_SPEC \ +#define ANDROID_CC1_SPEC(ANDROID_PIC_DEFAULT) \ "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} " \ - "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}" + "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: " ANDROID_PIC_DEFAULT "}}}}" #define ANDROID_CC1PLUS_SPEC \ "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} " \ -- cgit v1.2.3