config.gcc (arm*-*-eabi*): Include arm/eabi.h and use additional option file arm...
authorDoug Kwan <dougkwan@google.com>
Mon, 14 Jul 2008 21:01:42 +0000 (21:01 +0000)
committerDoug Kwan <dougkwan@gcc.gnu.org>
Mon, 14 Jul 2008 21:01:42 +0000 (21:01 +0000)
2008-07-14  Doug Kwan  <dougkwan@google.com>

* config.gcc (arm*-*-eabi*): Include arm/eabi.h and use
additional option file arm/eabi.opt.
* config/arm/eabi.h (File): New configuration file for EABI targets.
* config/arm/elf.h (SUBTARGET_EXTRA_SPECS): Add
SUBSUBTARGET_EXTRA_SPECS.
(SUBSUBTARGET_EXTRA_SPECS): Provide empty default.
* config/arm/unknown-elf.h (UNKNOWN_ELF_STARTFILE_SPEC): Renamed
from STARTFILE_SPEC so that it can be referenced in an override.
(STARTFILE_SPEC): Use UNKNOWN_ELF_STARTFILE_SPEC.
(UNKNOWN_ELF_ENDFILE_SPEC): Renamed from ENDFILE_SPEC so that it
can be referenced in an override.
(ENDFILE_SPEC): Use UNKNOWN_ELF_ENDFILE_SPEC.
* config/arm/bpabi.h (BPABI_LINK_SPEC): Renamed from LINK_SPEC
so that it can be referenced in an override.
(LINK_SPEC): Use BPABI_LINK_SPEC.
* config/arm/eabi.opt (File): New.

From-SVN: r137798

gcc/ChangeLog
gcc/config.gcc
gcc/config/arm/bpabi.h
gcc/config/arm/eabi.h [new file with mode: 0644]
gcc/config/arm/eabi.opt [new file with mode: 0644]
gcc/config/arm/elf.h
gcc/config/arm/unknown-elf.h

index f66677f849bf4e1ee021cbf53cbe01e10ba5c817..1918d36563b58002c8855ace994972368ee9a93c 100644 (file)
@@ -1,3 +1,22 @@
+2008-07-14  Doug Kwan  <dougkwan@google.com>
+
+       * config.gcc (arm*-*-eabi*): Include arm/eabi.h and use
+       additional option file arm/eabi.opt.
+       * config/arm/eabi.h (File): New configuration file for EABI targets.
+       * config/arm/elf.h (SUBTARGET_EXTRA_SPECS): Add
+       SUBSUBTARGET_EXTRA_SPECS.
+       (SUBSUBTARGET_EXTRA_SPECS): Provide empty default.
+       * config/arm/unknown-elf.h (UNKNOWN_ELF_STARTFILE_SPEC): Renamed
+       from STARTFILE_SPEC so that it can be referenced in an override.
+       (STARTFILE_SPEC): Use UNKNOWN_ELF_STARTFILE_SPEC.
+       (UNKNOWN_ELF_ENDFILE_SPEC): Renamed from ENDFILE_SPEC so that it
+       can be referenced in an override.
+       (ENDFILE_SPEC): Use UNKNOWN_ELF_ENDFILE_SPEC.
+       * config/arm/bpabi.h (BPABI_LINK_SPEC): Renamed from LINK_SPEC
+       so that it can be referenced in an override.
+       (LINK_SPEC): Use BPABI_LINK_SPEC.
+       * config/arm/eabi.opt (File): New.
+
 2008-07-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * Makefile.in (TARGET_DEF_H): Add targhooks.h.
index 1f7f65361f533f97b7dbe2e83afd577f923616a4..5cd1707338048bcc34739b673489e8d1f5944c7b 100644 (file)
@@ -763,7 +763,9 @@ arm*-*-eabi* | arm*-*-symbianelf* )
        tmake_file="arm/t-arm arm/t-arm-elf"
        case ${target} in
        arm*-*-eabi*)
+         tm_file="$tm_file arm/eabi.h"
          tmake_file="${tmake_file} arm/t-bpabi"
+         extra_options="${extra_options} arm/eabi.opt"
          ;;
        arm*-*-symbianelf*)
          tm_file="${tm_file} arm/symbian.h"
index 876e23404abffc14f667a61ce0e81d1b18f0d738..e28d9ead45e77a42ea2f2c88907b6d3452ebad29 100644 (file)
 #endif
 
 /* The generic link spec in elf.h does not support shared libraries.  */
-#undef  LINK_SPEC
-#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} "          \
+#define BPABI_LINK_SPEC \
+  "%{mbig-endian:-EB} %{mlittle-endian:-EL} "          \
   "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} "       \
   "-X" SUBTARGET_EXTRA_LINK_SPEC
 
+#undef  LINK_SPEC
+#define LINK_SPEC BPABI_LINK_SPEC
+
 #if defined (__thumb__)
 #define RENAME_LIBRARY_SET ".thumb_set"
 #else
diff --git a/gcc/config/arm/eabi.h b/gcc/config/arm/eabi.h
new file mode 100644 (file)
index 0000000..c7d1d3e
--- /dev/null
@@ -0,0 +1,125 @@
+/* Configuration file for ARM EABI targets.
+   Copyright (C) 2008
+   Free Software Foundation, Inc.
+   Contributed by Doug Kwan (dougkwan@google.com)
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains macro overrides for EABI targets.  */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()                       \
+  do                                                   \
+    {                                                  \
+      TARGET_BPABI_CPP_BUILTINS ();                    \
+      if (TARGET_ANDROID)                              \
+       builtin_define ("__ANDROID__");                 \
+    }                                                  \
+  while (false)
+
+#undef SUBSUBTARGET_EXTRA_SPECS
+#define SUBSUBTARGET_EXTRA_SPECS \
+  { "link_android",            ANDROID_LINK_SPEC },            \
+  { "link_default",            BPABI_LINK_SPEC },              \
+  { "cc1_android",             ANDROID_CC1_SPEC },             \
+  { "cc1_default",             CC1_DEFAULT_SPEC },             \
+  { "cc1plus_android",         ANDROID_CC1PLUS_SPEC },         \
+  { "cc1plus_default",         CC1PLUS_DEFAULT_SPEC },         \
+  { "lib_android",             ANDROID_LIB_SPEC },             \
+  { "lib_default",             LIB_DEFAULT_SPEC },             \
+  { "startfile_android",       ANDROID_STARTFILE_SPEC },       \
+  { "startfile_default",       UNKNOWN_ELF_STARTFILE_SPEC },   \
+  { "endfile_android",         ANDROID_ENDFILE_SPEC },         \
+  { "endfile_default",         UNKNOWN_ELF_ENDFILE_SPEC },     \
+
+#undef ANDROID_LINK_SPEC
+#define ANDROID_LINK_SPEC \
+"%{mbig-endian:-EB} %{mlittle-endian:-EL} "            \
+"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
+"%{!static:" \
+   "%{shared: -Bsymbolic} " \
+   "%{!shared:" \
+      "%{rdynamic:-export-dynamic} " \
+      "%{!dynamic-linker:-dynamic-linker /system/bin/linker}}} " \
+"-X" SUBTARGET_EXTRA_LINK_SPEC
+
+/* Override LINK_SPEC in bpabi.h. */
+#undef LINK_SPEC
+#define LINK_SPEC \
+"%{mandroid: %(link_android) ;" \
+"          : %(link_default)}"
+
+/* Android uses -fno-exceptions by default. */
+#undef ANDROID_CC1_SPEC
+#define ANDROID_CC1_SPEC "%{!fexceptions:-fno-exceptions}"
+
+/* Default CC1_SPEC as in arm.h. */
+#undef CC1_DEFAULT_SPEC
+#define CC1_DEFAULT_SPEC ""
+
+#undef CC1_SPEC
+#define CC1_SPEC \
+"%{mandroid: %(cc1_android) ;" \
+"          : %(cc1_default)}"
+
+/* Android uses -fno-rtti by default. */
+#undef ANDROID_CC1PLUS_SPEC
+#define ANDROID_CC1PLUS_SPEC "%{!frtti:-fno-rtti}"
+
+/* Default CC1PLUS_SPEC as in gcc.c. */
+#undef CC1PLUS_DEFAULT_SPEC
+#define CC1PLUS_DEFAULT_SPEC ""
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC \
+"%{mandroid: %(cc1plus_android) ;" \
+"          : %(cc1plus_default)}"
+
+#undef ANDROID_LIB_SPEC
+#define ANDROID_LIB_SPEC       "-lc %{!static:-ldl}"
+
+/* Default LIB_SPEC as in gcc.c. */
+#undef LIB_DEFAULT_SPEC
+#define LIB_DEFAULT_SPEC \
+"%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+"%{mandroid: %(lib_android) ;" \
+"          : %(lib_default)}"
+
+#undef ANDROID_STARTFILE_SPEC
+#define ANDROID_STARTFILE_SPEC \
+"%{!shared:" \
+   "%{static: crtbegin_static%O%s ;" \
+   "        : crtbegin_dynamic%O%s}}"
+
+/* Override STARTFILE_SPEC in unknown-elf.h. */
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+"%{mandroid: %(startfile_android) ;" \
+"          : %(startfile_default)}"
+
+#undef ANDROID_ENDFILE_SPEC
+#define ANDROID_ENDFILE_SPEC   "%{!shared:crtend_android%O%s}"
+
+/* Override ENDFILE_SPEC in unknown-elf.h. */
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+"%{mandroid: %(endfile_android) ;" \
+"          : %(endfile_default)}"
+
diff --git a/gcc/config/arm/eabi.opt b/gcc/config/arm/eabi.opt
new file mode 100644 (file)
index 0000000..2cda98d
--- /dev/null
@@ -0,0 +1,23 @@
+; EABI specific options for ARM port of the compiler.
+
+; Copyright (C) 2008 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3.  If not see
+; <http://www.gnu.org/licenses/>.
+
+mandroid
+Target Report RejectNegative Mask(ANDROID)
+Generate code for the Android operating system.
index 37c366d5ac86d3098f8c71ab940e25557e4320de..7c3eddbe05845749832114ee5191f935907c9a88 100644 (file)
@@ -36,7 +36,8 @@
 #ifndef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
   { "subtarget_extra_asm_spec",        SUBTARGET_EXTRA_ASM_SPEC }, \
-  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC },
+  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
+  SUBSUBTARGET_EXTRA_SPECS
 #endif
 
 #ifndef SUBTARGET_EXTRA_ASM_SPEC
@@ -48,6 +49,9 @@
 %{mapcs-float:-mfloat}"
 #endif
 
+#undef SUBSUBTARGET_EXTRA_SPECS
+#define SUBSUBTARGET_EXTRA_SPECS
+
 #ifndef ASM_SPEC
 #define ASM_SPEC "\
 %{mbig-endian:-EB} \
index 38b791d12b1e5b39f38d4c0433bd997b4ea4fcc7..331e40a1eceed2a45f44b09d7811263cedcdaa69 100644 (file)
 #endif
 
 /* Now we define the strings used to build the spec file.  */
+#define UNKNOWN_ELF_STARTFILE_SPEC     " crti%O%s crtbegin%O%s crt0%O%s"
+
 #undef  STARTFILE_SPEC
-#define STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
+#define STARTFILE_SPEC UNKNOWN_ELF_STARTFILE_SPEC
+
+#define UNKNOWN_ELF_ENDFILE_SPEC       "crtend%O%s crtn%O%s"
 
 #undef  ENDFILE_SPEC
-#define ENDFILE_SPEC   "crtend%O%s crtn%O%s"
+#define ENDFILE_SPEC   UNKNOWN_ELF_ENDFILE_SPEC
 
 /* The __USES_INITFINI__ define is tested in newlib/libc/sys/arm/crt0.S
    to see if it needs to invoked _init() and _fini().  */