1 /* Configuration file for ARM EABI targets.
3 Free Software Foundation, Inc.
4 Contributed by Doug Kwan (dougkwan@google.com)
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 3, or (at your
11 option) any later version.
13 GCC is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 /* This file contains macro overrides for EABI targets. */
24 #undef TARGET_OS_CPP_BUILTINS
25 #define TARGET_OS_CPP_BUILTINS() \
28 TARGET_BPABI_CPP_BUILTINS (); \
30 builtin_define ("__ANDROID__"); \
34 #undef SUBSUBTARGET_EXTRA_SPECS
35 #define SUBSUBTARGET_EXTRA_SPECS \
36 { "link_android", ANDROID_LINK_SPEC }, \
37 { "link_default", BPABI_LINK_SPEC }, \
38 { "cc1_android", ANDROID_CC1_SPEC }, \
39 { "cc1_default", CC1_DEFAULT_SPEC }, \
40 { "cc1plus_android", ANDROID_CC1PLUS_SPEC }, \
41 { "cc1plus_default", CC1PLUS_DEFAULT_SPEC }, \
42 { "lib_android", ANDROID_LIB_SPEC }, \
43 { "lib_default", LIB_DEFAULT_SPEC }, \
44 { "startfile_android", ANDROID_STARTFILE_SPEC }, \
45 { "startfile_default", UNKNOWN_ELF_STARTFILE_SPEC }, \
46 { "endfile_android", ANDROID_ENDFILE_SPEC }, \
47 { "endfile_default", UNKNOWN_ELF_ENDFILE_SPEC }, \
49 #undef ANDROID_LINK_SPEC
50 #define ANDROID_LINK_SPEC \
51 "%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
52 "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
54 "%{shared: -Bsymbolic} " \
57 "%{rdynamic:-export-dynamic} " \
58 "%{!dynamic-linker:-dynamic-linker /system/bin/linker}}} " \
59 "-X" SUBTARGET_EXTRA_LINK_SPEC
61 /* Override LINK_SPEC in bpabi.h. */
64 "%{mandroid: %(link_android) ;" \
67 /* Android uses "-fno-exceptions -fpic -fno-short-enums -mthumb-interwork" by
68 default. -mthumb-interwork is implied by EABI. */
69 #undef ANDROID_CC1_SPEC
70 #define ANDROID_CC1_SPEC \
71 "%{!fexceptions:-fno-exceptions} " \
72 "%{!fno-pic:%{!fno-PIC:-fpic}} " \
73 "%{!fshort-enums:-fno-short-enums} "
75 /* Default CC1_SPEC as in arm.h. */
76 #undef CC1_DEFAULT_SPEC
77 #define CC1_DEFAULT_SPEC ""
81 "%{mandroid: %(cc1_android) ;" \
84 /* Android uses -fno-rtti by default. */
85 #undef ANDROID_CC1PLUS_SPEC
86 #define ANDROID_CC1PLUS_SPEC "%{!frtti:-fno-rtti}"
88 /* Default CC1PLUS_SPEC as in gcc.c. */
89 #undef CC1PLUS_DEFAULT_SPEC
90 #define CC1PLUS_DEFAULT_SPEC ""
93 #define CC1PLUS_SPEC \
94 "%{mandroid: %(cc1plus_android) ;" \
95 " : %(cc1plus_default)}"
97 #undef ANDROID_LIB_SPEC
98 #define ANDROID_LIB_SPEC "-lc %{!static:-ldl}"
100 /* Default LIB_SPEC as in gcc.c. */
101 #undef LIB_DEFAULT_SPEC
102 #define LIB_DEFAULT_SPEC \
103 "%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
107 "%{mandroid: %(lib_android) ;" \
110 #undef ANDROID_STARTFILE_SPEC
111 #define ANDROID_STARTFILE_SPEC \
113 "%{static: crtbegin_static%O%s ;" \
114 " : crtbegin_dynamic%O%s}}"
116 /* Override STARTFILE_SPEC in unknown-elf.h. */
117 #undef STARTFILE_SPEC
118 #define STARTFILE_SPEC \
119 "%{mandroid: %(startfile_android) ;" \
120 " : %(startfile_default)}"
122 #undef ANDROID_ENDFILE_SPEC
123 #define ANDROID_ENDFILE_SPEC "%{!shared:crtend_android%O%s}"
125 /* Override ENDFILE_SPEC in unknown-elf.h. */
127 #define ENDFILE_SPEC \
128 "%{mandroid: %(endfile_android) ;" \
129 " : %(endfile_default)}"
131 #undef NEED_INDICATE_EXEC_STACK
132 #define NEED_INDICATE_EXEC_STACK 1