2016-07-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / config / arm / symbian.h
blobfc9c350cd081a7390a2bb929f17889232669e1b3
1 /* Configuration file for Symbian OS on ARM processors.
2 Copyright (C) 2004-2016 Free Software Foundation, Inc.
3 Contributed by CodeSourcery, LLC
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published
9 by the Free Software Foundation; either version 3, or (at your
10 option) any later version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 /* Do not expand builtin functions (unless explicitly prefixed with
22 "__builtin"). Symbian OS code relies on properties of the standard
23 library that go beyond those guaranteed by the ANSI/ISO standard.
24 For example, "memcpy" works even with overlapping memory, like
25 "memmove". We cannot simply set flag_no_builtin in arm.c because
26 (a) flag_no_builtin is not declared in language-independent code,
27 and (b) that would prevent users from explicitly overriding the
28 default with -fbuiltin, which may sometimes be useful.
30 Make all symbols hidden by default. Symbian OS expects that all
31 exported symbols will be explicitly marked with
32 "__declspec(dllexport)".
34 Enumeration types use 4 bytes, even if the enumerals are small,
35 unless explicitly overridden.
37 The wchar_t type is a 2-byte type, unless explicitly
38 overridden. */
39 #define CC1_SPEC \
40 "%{!fbuiltin:%{!fno-builtin:-fno-builtin}} " \
41 "%{!fvisibility=*:-fvisibility=hidden} " \
42 "%{!fshort-enums:%{!fno-short-enums:-fno-short-enums}} " \
43 "%{!fshort-wchar:%{!fno-short-wchar:-fshort-wchar}} "
44 #define CC1PLUS_SPEC CC1_SPEC
46 /* Symbian OS does not use crt*.o, unlike the generic unknown-elf
47 configuration. */
48 #undef STARTFILE_SPEC
49 #define STARTFILE_SPEC ""
51 #undef ENDFILE_SPEC
52 #define ENDFILE_SPEC ""
54 /* Do not link with any libraries by default. On Symbian OS, the user
55 must supply all required libraries on the command line. */
56 #undef LIB_SPEC
57 #define LIB_SPEC ""
59 /* Support the "dllimport" attribute. */
60 #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 1
62 /* Symbian OS assumes ARM V5 or above. Since -march=armv5 is
63 equivalent to making the ARM 10TDMI core the default, we can set
64 SUBTARGET_CPU_DEFAULT and get an equivalent effect. */
65 #undef SUBTARGET_CPU_DEFAULT
66 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
68 /* The assembler should assume VFP FPU format, and armv5t. */
69 #undef SUBTARGET_ASM_FLOAT_SPEC
70 #define SUBTARGET_ASM_FLOAT_SPEC \
71 "%{!mfpu=*:-mfpu=vfp} %{!mcpu=*:%{!march=*:-march=armv5t}}"
73 /* Define the __symbian__ macro. */
74 #undef TARGET_OS_CPP_BUILTINS
75 #define TARGET_OS_CPP_BUILTINS() \
76 do \
77 { \
78 /* Include the default BPABI stuff. */ \
79 TARGET_BPABI_CPP_BUILTINS (); \
80 /* Symbian OS does not support merging symbols across DLL \
81 boundaries. */ \
82 builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
83 builtin_define ("__symbian__"); \
84 } \
85 while (false)
87 /* On SymbianOS, these sections are not writable, so we use "a",
88 rather than "aw", for the section attributes. */
89 #undef ARM_EABI_CTORS_SECTION_OP
90 #define ARM_EABI_CTORS_SECTION_OP \
91 "\t.section\t.init_array,\"a\",%init_array"
92 #undef ARM_EABI_DTORS_SECTION_OP
93 #define ARM_EABI_DTORS_SECTION_OP \
94 "\t.section\t.fini_array,\"a\",%fini_array"
96 /* SymbianOS cannot merge entities with vague linkage at runtime. */
97 #define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P false
99 #define TARGET_DEFAULT_WORD_RELOCATIONS 1
101 #define ARM_TARGET2_DWARF_FORMAT DW_EH_PE_absptr