gcc/
[official-gcc.git] / gcc / config / arm / vxworks.h
blob239a92618e9f19bc107678d92801e035906355bd
1 /* Definitions of target machine for GCC,
2 for ARM with targeting the VXWorks run time environment.
3 Copyright (C) 1999-2014 Free Software Foundation, Inc.
5 Contributed by: Mike Stump <mrs@wrs.com>
6 Brought up to date by CodeSourcery, LLC.
8 This file is part of GCC.
10 GCC is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3, or (at your option)
13 any later version.
15 GCC is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 Under Section 7 of GPL version 3, you are granted additional
21 permissions described in the GCC Runtime Library Exception, version
22 3.1, as published by the Free Software Foundation.
24 You should have received a copy of the GNU General Public License
25 along with GCC; see the file COPYING3. If not see
26 <http://www.gnu.org/licenses/>. */
29 #define TARGET_OS_CPP_BUILTINS() \
30 do { \
31 if (TARGET_BIG_END) \
32 builtin_define ("ARMEB"); \
33 else \
34 builtin_define ("ARMEL"); \
36 if (arm_arch_xscale) \
37 builtin_define ("CPU=XSCALE"); \
38 else if (arm_arch5) \
39 builtin_define ("CPU=ARMARCH5"); \
40 else if (arm_arch4) \
41 { \
42 if (thumb_code) \
43 builtin_define ("CPU=ARMARCH4_T"); \
44 else \
45 builtin_define ("CPU=ARMARCH4"); \
46 } \
47 VXWORKS_OS_CPP_BUILTINS (); \
48 } while (0)
50 #undef SUBTARGET_OVERRIDE_OPTIONS
51 #define SUBTARGET_OVERRIDE_OPTIONS VXWORKS_OVERRIDE_OPTIONS
53 /* Subsume the arm/elf.h definition, and add RTP hooks. */
54 #undef SUBTARGET_CPP_SPEC
55 #define SUBTARGET_CPP_SPEC "-D__ELF__" VXWORKS_ADDITIONAL_CPP_SPEC
57 #undef CC1_SPEC
58 #define CC1_SPEC \
59 "%{tstrongarm:-mlittle-endian -mcpu=strongarm ; \
60 t4: -mlittle-endian -march=armv4 ; \
61 t4be: -mbig-endian -march=armv4 ; \
62 t4t: -mthumb -mthumb-interwork -mlittle-endian -march=armv4t ; \
63 t4tbe: -mthumb -mthumb-interwork -mbig-endian -march=armv4t ; \
64 t5: -mlittle-endian -march=armv5 ; \
65 t5be: -mbig-endian -march=armv5 ; \
66 t5t: -mthumb -mthumb-interwork -mlittle-endian -march=armv5 ; \
67 t5tbe: -mthumb -mthumb-interwork -mbig-endian -march=armv5 ; \
68 txscale: -mlittle-endian -mcpu=xscale ; \
69 txscalebe: -mbig-endian -mcpu=xscale ; \
70 : -march=armv4}"
72 /* Pass -EB for big-endian targets. */
73 #define VXWORKS_ENDIAN_SPEC \
74 "%{mbig-endian|t4be|t4tbe|t5be|t5tbe|txscalebe:-EB}"
76 #undef SUBTARGET_EXTRA_ASM_SPEC
77 #define SUBTARGET_EXTRA_ASM_SPEC VXWORKS_ENDIAN_SPEC
79 #undef LINK_SPEC
80 #define LINK_SPEC VXWORKS_LINK_SPEC " " VXWORKS_ENDIAN_SPEC
82 #undef LIB_SPEC
83 #define LIB_SPEC VXWORKS_LIB_SPEC
85 #undef STARTFILE_SPEC
86 #define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC
88 #undef ENDFILE_SPEC
89 #define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC
91 /* There is no default multilib. */
92 #undef MULTILIB_DEFAULTS
94 #define FPUTYPE_DEFAULT "vfp"
96 #undef FUNCTION_PROFILER
97 #define FUNCTION_PROFILER VXWORKS_FUNCTION_PROFILER
99 /* We want to be compatible with a version of "2.96" at one point in
100 the past before this macro was changed. */
101 #undef DEFAULT_STRUCTURE_SIZE_BOUNDARY
102 #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8
104 /* The kernel loader does not allow relocations to overflow, so we
105 cannot allow arbitrary relocation addends in kernel modules or RTP
106 executables. Also, the dynamic loader uses the resolved relocation
107 value to distinguish references to the text and data segments, so we
108 cannot allow arbitrary offsets for shared libraries either. */
109 #undef ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P
110 #define ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 1
112 #undef TARGET_DEFAULT_WORD_RELOCATIONS
113 #define TARGET_DEFAULT_WORD_RELOCATIONS 1