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