diff options
author | Mark D Horn <mark.d.horn@intel.com> | 2011-06-29 16:52:28 -0700 |
---|---|---|
committer | Mark D Horn <mark.d.horn@intel.com> | 2011-07-02 23:51:12 -0700 |
commit | 2d2dd7d31b14cd64d538d7d23e6212ff21512cc0 (patch) | |
tree | 7436155cad75fec33ff03d189bb800e6ec6840df /build/tools/toolchain-patches/gcc | |
parent | 82d350ee9bde22c5fc248cc178750262b81baf26 (diff) | |
download | ndk-2d2dd7d31b14cd64d538d7d23e6212ff21512cc0.tar.gz |
Fix x86 Default Toolchain configuration
Change-Id: I630451a2a7a7aef0cf2f71a97e36120d45635029
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
Diffstat (limited to 'build/tools/toolchain-patches/gcc')
3 files changed, 146 insertions, 77 deletions
diff --git a/build/tools/toolchain-patches/gcc/0001-Enable-x86-gcc-defaults.patch b/build/tools/toolchain-patches/gcc/0001-Enable-x86-gcc-defaults.patch new file mode 100644 index 000000000..3f35e01fc --- /dev/null +++ b/build/tools/toolchain-patches/gcc/0001-Enable-x86-gcc-defaults.patch @@ -0,0 +1,146 @@ +From fc0c72d824b194f5c5e2c16ae5e706eed3a359fc Mon Sep 17 00:00:00 2001 +From: Mark D Horn <mark.d.horn@intel.com> +Date: Tue, 28 Jun 2011 15:35:46 -0700 +Subject: [PATCH] Enable x86 gcc defaults + +Enabling the same built-in defaults for the x86 +toolchain as is currently done for ARM. + +Change-Id: I1118569246c70496ae8e0971036916286321274c +--- + gcc-4.4.3/gcc/config.gcc | 4 +- + gcc-4.4.3/gcc/config/arm/linux-eabi.h | 2 +- + gcc-4.4.3/gcc/config/i386/linux.h | 38 +++++++++++++++++++++++++++----- + gcc-4.4.3/gcc/config/linux-android.h | 4 +- + 4 files changed, 37 insertions(+), 11 deletions(-) + +diff --git a/gcc-4.4.3/gcc/config.gcc b/gcc-4.4.3/gcc/config.gcc +index 321cf55..e758dc4 100644 +--- a/gcc-4.4.3/gcc/config.gcc ++++ b/gcc-4.4.3/gcc/config.gcc +@@ -515,7 +515,7 @@ case ${target} in + tm_defines="$tm_defines OPTION_GLIBC=1";; + esac + case $target in +- *-*-*android*) ++ *-*-*android* | *-android-linux-*) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC" + ;; + *-*-*uclibc*) +@@ -538,7 +538,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.4.3/gcc/config/arm/linux-eabi.h b/gcc-4.4.3/gcc/config/arm/linux-eabi.h +index 2ca8818..b295423 100644 +--- a/gcc-4.4.3/gcc/config/arm/linux-eabi.h ++++ b/gcc-4.4.3/gcc/config/arm/linux-eabi.h +@@ -74,7 +74,7 @@ + #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 " " ANDROID_CC1_SPEC("-fpic")) + + #define CC1PLUS_SPEC \ + LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC) +diff --git a/gcc-4.4.3/gcc/config/i386/linux.h b/gcc-4.4.3/gcc/config/i386/linux.h +index f3a98c2..bc2a5d5 100644 +--- a/gcc-4.4.3/gcc/config/i386/linux.h ++++ b/gcc-4.4.3/gcc/config/i386/linux.h +@@ -72,15 +72,36 @@ along with GCC; see the file COPYING3. If not see + #define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ +- LINUX_TARGET_OS_CPP_BUILTINS(); \ ++ LINUX_TARGET_OS_CPP_BUILTINS(); \ ++ ANDROID_TARGET_OS_CPP_BUILTINS(); \ + } \ + while (0) + + #undef CPP_SPEC + #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" + ++#define OVERRIDE_LINUX_TARGET_CC1_SPEC "%(cc1_cpu) %{profile:-p}" + #undef CC1_SPEC +-#define CC1_SPEC "%(cc1_cpu) %{profile:-p}" ++#define CC1_SPEC \ ++ LINUX_OR_ANDROID_CC (OVERRIDE_LINUX_TARGET_CC1_SPEC, \ ++ OVERRIDE_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) ++ ++#undef LIB_SPEC ++#define LIB_SPEC \ ++ LINUX_OR_ANDROID_LD (LINUX_TARGET_LIB_SPEC, \ ++ LINUX_TARGET_LIB_SPEC " " ANDROID_LIB_SPEC) ++ ++#undef STARTFILE_SPEC ++#define STARTFILE_SPEC \ ++ LINUX_OR_ANDROID_LD (LINUX_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC) + + /* Provide a LINK_SPEC appropriate for Linux. Here we provide support + for the special GCC options -static and -shared, which allow us to +@@ -121,23 +142,28 @@ along with GCC; see the file COPYING3. If not see + { "link_emulation", LINK_EMULATION },\ + { "dynamic_linker", LINUX_DYNAMIC_LINKER } + +-#undef LINK_SPEC +-#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \ ++#define OVERRIDE_LINUX_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \ + %{!shared: \ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker %(dynamic_linker)}} \ + %{static:-static}}}" ++#undef LINK_SPEC ++#define LINK_SPEC \ ++ LINUX_OR_ANDROID_LD (OVERRIDE_LINUX_TARGET_LINK_SPEC, \ ++ OVERRIDE_LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + + /* Similar to standard Linux, but adding -ffast-math support. */ +-#undef ENDFILE_SPEC +-#define ENDFILE_SPEC \ ++#define OVERRIDE_LINUX_TARGET_ENDFILE_SPEC \ + "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ + %{mpc32:crtprec32.o%s} \ + %{mpc64:crtprec64.o%s} \ + %{mpc80:crtprec80.o%s} \ + %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" ++#undef ENDFILE_SPEC ++#define ENDFILE_SPEC \ ++ LINUX_OR_ANDROID_LD (OVERRIDE_LINUX_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) + + /* A C statement (sans semicolon) to output to the stdio stream + FILE the assembler definition of uninitialized global DECL named +diff --git a/gcc-4.4.3/gcc/config/linux-android.h b/gcc-4.4.3/gcc/config/linux-android.h +index 5ca3858..c1f8f7a 100644 +--- a/gcc-4.4.3/gcc/config/linux-android.h ++++ b/gcc-4.4.3/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}} " \ +-- +1.7.1 + diff --git a/build/tools/toolchain-patches/gcc/0001-arm-linux-androideabi-make-fpic-the-default-instead-.patch b/build/tools/toolchain-patches/gcc/0001-arm-linux-androideabi-make-fpic-the-default-instead-.patch deleted file mode 100644 index 1c6dce3d5..000000000 --- a/build/tools/toolchain-patches/gcc/0001-arm-linux-androideabi-make-fpic-the-default-instead-.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 8fb36c2f3114aec33c84a43eb5fd14c845f65bfc Mon Sep 17 00:00:00 2001 -From: David 'Digit' Turner <digit@android.com> -Date: Sat, 8 Jan 2011 14:46:50 +0100 -Subject: [PATCH] arm-linux-androideabi: make -fpic the default, instead of -fPIC - -This patch modifies the arm-linux-androideabi configuration to use --fpic by default, instead of -fPIC. - -This should only affect users the standalone Android NDK toolchain, -since both the Android platform and NDK build scripts will append -the -fpic flag at compile time for all generated object files. - -Note that this doesn't change the arm-eabi configuration to avoid -breaking stuff when building the kernel. - -Change-Id: Ib7f97a05bf1bb83778863f885628c1741896fb0a ---- - gcc-4.4.3/gcc/config/linux-android.h | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/gcc-4.4.3/gcc/config/linux-android.h b/gcc-4.4.3/gcc/config/linux-android.h -index a43bab5..ae4b26f 100644 ---- a/gcc-4.4.3/gcc/config/linux-android.h -+++ b/gcc-4.4.3/gcc/config/linux-android.h -@@ -37,7 +37,7 @@ - - #define ANDROID_CC1_SPEC \ - "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} " \ -- "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}" -+ "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fpic}}}}" - - #define ANDROID_CC1PLUS_SPEC \ - "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} " \ --- -1.7.3.1 - diff --git a/build/tools/toolchain-patches/gcc/0002-xgcc-compiles-need-to-use-the-Android-crt-files-as-s.patch b/build/tools/toolchain-patches/gcc/0002-xgcc-compiles-need-to-use-the-Android-crt-files-as-s.patch deleted file mode 100644 index 6032aae14..000000000 --- a/build/tools/toolchain-patches/gcc/0002-xgcc-compiles-need-to-use-the-Android-crt-files-as-s.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 25d45e0a5671f5bd508ae144004f3cdcf00e511d Mon Sep 17 00:00:00 2001 -From: David 'Digit' Turner <digit@android.com> -Date: Thu, 7 Apr 2011 14:24:35 +0200 -Subject: [PATCH] xgcc compiles need to use the Android crt files as specified in LDFLAGS_FOR_TARGET - -Change-Id: If494615b055cd5c001ffd7a1722bcbdf9b88abd8 -Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> ---- - gcc-4.4.3/Makefile.in | 2 +- - gcc-4.4.3/Makefile.tpl | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gcc-4.4.3/Makefile.in b/gcc-4.4.3/Makefile.in -index 53a5146..c29eab7 100644 ---- a/gcc-4.4.3/Makefile.in -+++ b/gcc-4.4.3/Makefile.in -@@ -466,7 +466,7 @@ CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@ - - LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) - LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates --LDFLAGS_FOR_TARGET = -+LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@ - - FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ - DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@ -diff --git a/gcc-4.4.3/Makefile.tpl b/gcc-4.4.3/Makefile.tpl -index ac36409..c05b935 100644 ---- a/gcc-4.4.3/Makefile.tpl -+++ b/gcc-4.4.3/Makefile.tpl -@@ -436,7 +436,7 @@ CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@ - - LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) - LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates --LDFLAGS_FOR_TARGET = -+LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@ - - FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ - DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@ --- -1.7.3.1 - |