aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2012-10-23 11:06:24 -0700
committerGerrit Code Review <noreply-gerritcodereview@google.com>2012-10-23 11:06:25 -0700
commit9ee4bdfc5dc3972c5b3edb84a301347e1e157c51 (patch)
treed26eacbbc78492d9773e67cbe37180cb06be2d37 /gcc-4.6
parentae948abe78321551be84b54ea2b0230614f00670 (diff)
parentec1a2a51fa75883e4bdf9f4f03e8fd16a261c275 (diff)
downloadtoolchain_gcc-9ee4bdfc5dc3972c5b3edb84a301347e1e157c51.tar.gz
toolchain_gcc-9ee4bdfc5dc3972c5b3edb84a301347e1e157c51.tar.bz2
toolchain_gcc-9ee4bdfc5dc3972c5b3edb84a301347e1e157c51.zip
Merge "Port MIPS Android support to GCC-4.6/4.7"
Diffstat (limited to 'gcc-4.6')
-rw-r--r--gcc-4.6/gcc/config.gcc6
-rw-r--r--gcc-4.6/gcc/config/mips/linux.h52
-rw-r--r--gcc-4.6/gcc/config/mips/t-linux-android3
3 files changed, 50 insertions, 11 deletions
diff --git a/gcc-4.6/gcc/config.gcc b/gcc-4.6/gcc/config.gcc
index 514b0f35e..3f1fab3ba 100644
--- a/gcc-4.6/gcc/config.gcc
+++ b/gcc-4.6/gcc/config.gcc
@@ -1918,6 +1918,12 @@ mips*-*-linux*) # Linux MIPS, either endian.
mipsisa32*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
esac
+ case ${target} in
+ *android*)
+ # Default to little-endian for MIPS Android
+ # tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0"
+ tmake_file="$tmake_file mips/t-linux-android"
+ esac
extra_parts="$extra_parts crtfastmath.o"
test x$with_llsc != x || with_llsc=yes
;;
diff --git a/gcc-4.6/gcc/config/mips/linux.h b/gcc-4.6/gcc/config/mips/linux.h
index a1a8efc25..7a292bfd6 100644
--- a/gcc-4.6/gcc/config/mips/linux.h
+++ b/gcc-4.6/gcc/config/mips/linux.h
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
/* The GNU C++ standard library requires this. */ \
if (c_dialect_cxx ()) \
builtin_define ("_GNU_SOURCE"); \
+ ANDROID_TARGET_OS_CPP_BUILTINS(); \
} while (0)
#undef SUBTARGET_CPP_SPEC
@@ -52,8 +53,8 @@ along with GCC; see the file COPYING3. If not see
/* A standard GNU/Linux mapping. On most targets, it is included in
CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC
and provides this hook instead. */
-#undef SUBTARGET_CC1_SPEC
-#define SUBTARGET_CC1_SPEC "%{profile:-p}"
+#undef LINUX_SUBTARGET_CC1_SPEC
+#define LINUX_SUBTARGET_CC1_SPEC "%{profile:-p}"
/* From iris5.h */
/* -G is incompatible with -KPIC which is the default, so only allow objects
@@ -64,8 +65,8 @@ along with GCC; see the file COPYING3. If not see
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
/* Borrowed from sparc/linux.h */
-#undef LINK_SPEC
-#define LINK_SPEC \
+#undef LINUX_SUBTARGET_LINK_SPEC
+#define LINUX_SUBTARGET_LINK_SPEC \
"%(endian_spec) \
%{shared:-shared} \
%{!shared: \
@@ -100,8 +101,8 @@ along with GCC; see the file COPYING3. If not see
#undef ASM_OUTPUT_REG_PUSH
#undef ASM_OUTPUT_REG_POP
-#undef LIB_SPEC
-#define LIB_SPEC "\
+#undef LINUX_SUBTARGET_LIB_SPEC
+#define LINUX_SUBTARGET_LIB_SPEC "\
%{pthread:-lpthread} \
%{shared:-lc} \
%{!shared: \
@@ -132,7 +133,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#endif
#define LINUX_DRIVER_SELF_SPECS \
- NO_SHARED_SPECS \
+ LINUX_OR_ANDROID_CC(NO_SHARED_SPECS, "") \
MARCH_MTUNE_NATIVE_SPECS, \
/* -mplt has no effect without -mno-shared. Simplify later \
specs handling by removing a redundant option. */ \
@@ -146,7 +147,36 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
LINUX_DRIVER_SELF_SPECS
/* Similar to standard Linux, but adding -ffast-math support. */
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
- %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#undef LINUX_TARGET_MATHFILE_SPEC
+#define LINUX_TARGET_MATHFILE_SPEC \
+ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+ LINUX_OR_ANDROID_LD (LINUX_SUBTARGET_LINK_SPEC, \
+ LINUX_SUBTARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+
+#undef SUBTARGET_CC1_SPEC
+#define SUBTARGET_CC1_SPEC \
+ LINUX_OR_ANDROID_CC (LINUX_SUBTARGET_CC1_SPEC, \
+ LINUX_SUBTARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fpic"))
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC \
+ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+ LINUX_OR_ANDROID_LD (LINUX_SUBTARGET_LIB_SPEC, \
+ LINUX_SUBTARGET_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 (LINUX_TARGET_MATHFILE_SPEC " " \
+ GNU_USER_TARGET_ENDFILE_SPEC, \
+ LINUX_TARGET_MATHFILE_SPEC " " \
+ ANDROID_ENDFILE_SPEC)
diff --git a/gcc-4.6/gcc/config/mips/t-linux-android b/gcc-4.6/gcc/config/mips/t-linux-android
new file mode 100644
index 000000000..298cad9d5
--- /dev/null
+++ b/gcc-4.6/gcc/config/mips/t-linux-android
@@ -0,0 +1,3 @@
+MULTILIB_OPTIONS = mips32r2
+MULTILIB_DIRNAMES = mips-r2
+MULTILIB_EXCLUSIONS :=