From c779c1ff50bde450eb49b3998353804602c4d963 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Tue, 23 Oct 2012 20:10:45 +0800 Subject: Enable x86/arm gcc defaults Used to be local NDK patch at $NDK/build/tools/toolchain-patches/ gcc/0004-Enable-x86-gcc-defaults.patch Change-Id: I6cb6ba8b29b7ba4f242f788a57bf0460289f0cbd --- gcc-4.6/gcc/config.gcc | 4 ++-- gcc-4.6/gcc/config/arm/linux-eabi.h | 2 +- gcc-4.6/gcc/config/i386/linux.h | 10 +++++++++- gcc-4.6/gcc/config/linux-android.h | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) (limited to 'gcc-4.6') diff --git a/gcc-4.6/gcc/config.gcc b/gcc-4.6/gcc/config.gcc index d9ac0fae9..514b0f35e 100644 --- a/gcc-4.6/gcc/config.gcc +++ b/gcc-4.6/gcc/config.gcc @@ -585,7 +585,7 @@ case ${target} in tm_defines="$tm_defines SINGLE_LIBC";; esac case $target in - *-*-*android*) + *-*-*android* | *-android-linux-*) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC" ;; *-*-*uclibc*) @@ -609,7 +609,7 @@ case ${target} in esac # Enable compilation for Android by default for *android* targets. case $target in - *-*-*android*) + *-*-*android* | *-android-linux-*) tm_defines="$tm_defines ANDROID_DEFAULT=1" ;; *) diff --git a/gcc-4.6/gcc/config/arm/linux-eabi.h b/gcc-4.6/gcc/config/arm/linux-eabi.h index 3a3218853..00809d7f5 100644 --- a/gcc-4.6/gcc/config/arm/linux-eabi.h +++ b/gcc-4.6/gcc/config/arm/linux-eabi.h @@ -74,7 +74,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.6/gcc/config/i386/linux.h b/gcc-4.6/gcc/config/i386/linux.h index 414dc65bf..3477c394e 100644 --- a/gcc-4.6/gcc/config/i386/linux.h +++ b/gcc-4.6/gcc/config/i386/linux.h @@ -85,7 +85,15 @@ along with GCC; see the file COPYING3. If not see #undef CC1_SPEC #define CC1_SPEC \ LINUX_OR_ANDROID_CC (LINUX_TARGET_CC1_SPEC, \ - LINUX_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC) + LINUX_TARGET_CC1_SPEC \ + " -march=i686 -mtune=atom" \ + " -mstackrealign -msse3 -mfpmath=sse" \ + " -m32 -fno-short-enums" \ + " " \ + ANDROID_CC1_SPEC("-fPIC")) + +#define CC1PLUS_SPEC \ + LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC) /* Provide a LINK_SPEC appropriate for Linux. Here we provide support for the special GCC options -static and -shared, which allow us to diff --git a/gcc-4.6/gcc/config/linux-android.h b/gcc-4.6/gcc/config/linux-android.h index acbc6627f..f9ab318d1 100644 --- a/gcc-4.6/gcc/config/linux-android.h +++ b/gcc-4.6/gcc/config/linux-android.h @@ -41,9 +41,9 @@ #define ANDROID_LINK_SPEC \ "%{shared: -Bsymbolic}" -#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