]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/arm/vxworks.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / arm / vxworks.h
CommitLineData
55047c9d 1/* Definitions of target machine for GCC,
073a8998 2 for ARM with targeting the VXWorks run time environment.
99dee823 3 Copyright (C) 1999-2021 Free Software Foundation, Inc.
55047c9d
PE
4
5 Contributed by: Mike Stump <mrs@wrs.com>
6 Brought up to date by CodeSourcery, LLC.
7
8This file is part of GCC.
9
10GCC is free software; you can redistribute it and/or modify
11it under the terms of the GNU General Public License as published by
2f83c7d6 12the Free Software Foundation; either version 3, or (at your option)
55047c9d
PE
13any later version.
14
15GCC is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
999db125
GJL
20Under Section 7 of GPL version 3, you are granted additional
21permissions described in the GCC Runtime Library Exception, version
223.1, as published by the Free Software Foundation.
23
c7eca9fe
GJL
24You should have received a copy of the GNU General Public License and
25a copy of the GCC Runtime Library Exception along with this program;
26see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
2f83c7d6 27<http://www.gnu.org/licenses/>. */
55047c9d 28
0b458d2b 29/* TARGET_OS_CPP_BUILTINS, down to BPABI if defined. */
55047c9d 30
0b458d2b
JL
31#if defined (TARGET_BPABI_CPP_BUILTINS)
32#define MAYBE_TARGET_BPABI_CPP_BUILTINS TARGET_BPABI_CPP_BUILTINS
33#else
34#define MAYBE_TARGET_BPABI_CPP_BUILTINS()
35#endif
36
37#undef TARGET_OS_CPP_BUILTINS
071ef254
JL
38#define TARGET_OS_CPP_BUILTINS() \
39 do { \
40 if (TARGET_BIG_END) \
41 builtin_define ("ARMEB"); \
42 else \
43 builtin_define ("ARMEL"); \
44 \
45 if (arm_arch_xscale) \
46 builtin_define ("_VX_CPU=XSCALE"); \
2fca6a98 47 else if (arm_arch8) \
071ef254
JL
48 builtin_define ("_VX_CPU=ARMARCH8A"); \
49 else if (arm_arch7) \
50 { \
51 if (!arm_arch_notm) \
52 builtin_define ("_VX_CPU=ARMARCH7M"); \
53 else if (TARGET_THUMB) \
54 builtin_define ("_VX_CPU=ARMARCH7_T2"); \
55 else \
56 builtin_define ("_VX_CPU=ARMARCH7"); \
57 } \
58 else if (arm_arch6) \
59 { \
60 if (TARGET_THUMB) \
61 builtin_define ("_VX_CPU=ARMARCH6_T"); \
62 else \
63 builtin_define ("_VX_CPU=ARMARCH6"); \
64 } \
c3f808d3 65 else if (arm_arch5t) \
071ef254
JL
66 builtin_define ("_VX_CPU=ARMARCH5_T"); \
67 else if (arm_arch4) \
68 { \
69 if (TARGET_THUMB) \
70 builtin_define ("_VX_CPU=ARMARCH4_T"); \
71 else \
72 builtin_define ("_VX_CPU=ARMARCH4"); \
73 } \
74 VXWORKS_OS_CPP_BUILTINS (); \
75 MAYBE_TARGET_BPABI_CPP_BUILTINS (); \
55047c9d
PE
76 } while (0)
77
c5387660
JM
78#undef SUBTARGET_OVERRIDE_OPTIONS
79#define SUBTARGET_OVERRIDE_OPTIONS VXWORKS_OVERRIDE_OPTIONS
9403b7f7
RS
80
81/* Subsume the arm/elf.h definition, and add RTP hooks. */
82#undef SUBTARGET_CPP_SPEC
83#define SUBTARGET_CPP_SPEC "-D__ELF__" VXWORKS_ADDITIONAL_CPP_SPEC
84
0b458d2b
JL
85/* .text.hot and .text.unlikely sections are badly handled by the
86 VxWorks kernel mode loader for ARM style exceptions. */
55047c9d 87#undef CC1_SPEC
27204060 88#define CC1_SPEC VXWORKS_CC1_SPEC " %{!mrtp:-fno-reorder-functions}"
0b458d2b
JL
89
90/* Translate an explicit -mbig-endian as an explicit -EB to assembler
91 and linker, and pass abi options matching the target expectations
92 or command-line requests. */
93#define VXWORKS_ENDIAN_SPEC "%{mbig-endian:-EB}"
94
95#if defined (TARGET_BPABI_CPP_BUILTINS)
96#define MAYBE_ASM_ABI_SPEC \
97 "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC
98#else
99#define MAYBE_ASM_ABI_SPEC
100#endif
9403b7f7 101
c447f774 102#undef SUBTARGET_EXTRA_ASM_SPEC
0b458d2b 103#define SUBTARGET_EXTRA_ASM_SPEC MAYBE_ASM_ABI_SPEC " " VXWORKS_ENDIAN_SPEC
55047c9d 104
9403b7f7
RS
105#undef LINK_SPEC
106#define LINK_SPEC VXWORKS_LINK_SPEC " " VXWORKS_ENDIAN_SPEC
55047c9d 107
9403b7f7
RS
108#undef LIB_SPEC
109#define LIB_SPEC VXWORKS_LIB_SPEC
55047c9d 110
9403b7f7
RS
111#undef STARTFILE_SPEC
112#define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC
55047c9d 113
9403b7f7
RS
114#undef ENDFILE_SPEC
115#define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC
55047c9d 116
55047c9d
PE
117/* There is no default multilib. */
118#undef MULTILIB_DEFAULTS
119
9403b7f7
RS
120#undef FUNCTION_PROFILER
121#define FUNCTION_PROFILER VXWORKS_FUNCTION_PROFILER
122
123/* We want to be compatible with a version of "2.96" at one point in
124 the past before this macro was changed. */
125#undef DEFAULT_STRUCTURE_SIZE_BOUNDARY
126#define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8
8426b956
RS
127
128/* The kernel loader does not allow relocations to overflow, so we
129 cannot allow arbitrary relocation addends in kernel modules or RTP
130 executables. Also, the dynamic loader uses the resolved relocation
131 value to distinguish references to the text and data segments, so we
132 cannot allow arbitrary offsets for shared libraries either. */
133#undef ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P
134#define ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 1
571191af
PB
135
136#undef TARGET_DEFAULT_WORD_RELOCATIONS
137#define TARGET_DEFAULT_WORD_RELOCATIONS 1
3488bd6b
EB
138
139/* Define this to be nonzero if static stack checking is supported. */
140#define STACK_CHECK_STATIC_BUILTIN 1
141
142/* This platform supports the probing method of stack checking (RTP mode).
143 8K is reserved in the stack to propagate exceptions in case of overflow. */
144#define STACK_CHECK_PROTECT 8192
b663b831
RE
145
146/* Unless overridded by the target options, the default is little-endian. */
147#define TARGET_ENDIAN_DEFAULT 0
27204060
JL
148
149/* The VxWorks environment on ARM is llvm based and we need to link
150 against libllvm.a to resolve __aeabi_memcpy4. */
151
152#undef VXWORKS_PERSONALITY
153#define VXWORKS_PERSONALITY "llvm"
154
155#undef VXWORKS_EXTRA_LIBS_RTP
156#define VXWORKS_EXTRA_LIBS_RTP "-lllvm"