Daily bump.
[official-gcc.git] / gcc / config / vx-common.h
bloba436bf14074cf09e456cf4a125c61dc76062737c
1 /* Target-independent configuration for VxWorks and VxWorks AE.
2 Copyright (C) 2005-2021 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 under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 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 /* ------------------------- Common SPEC strings ------------------------- */
23 /* Most of these will probably be overridden by subsequent headers. We
24 undefine them here just in case, and define VXWORKS_ versions of each,
25 to be used in port-specific vxworks.h. */
26 #undef LIBGCC_SPEC
27 #define LIBGCC_SPEC VXWORKS_LIBGCC_SPEC
28 #undef STARTFILE_SPEC
29 #undef ENDFILE_SPEC
31 /* Most of these macros are overridden in "config/vxworks.h" or
32 "config/vxworksae.h" and are here merely for documentation
33 purposes. */
34 #define VXWORKS_ADDITIONAL_CPP_SPEC ""
35 #define VXWORKS_LIB_SPEC ""
36 #define VXWORKS_LINK_SPEC ""
37 #define VXWORKS_LIBGCC_SPEC ""
38 #define VXWORKS_STARTFILE_SPEC ""
39 #define VXWORKS_ENDFILE_SPEC ""
40 #define VXWORKS_CC1_SPEC ""
42 /* ----------------------- Common type descriptions ----------------------- */
44 /* Regardless of the target architecture, VxWorks uses a signed 32bit
45 integer for wchar_t starting with vx7 SR06xx. An unsigned short
46 otherwise. */
47 #if TARGET_VXWORKS7
49 #undef WCHAR_TYPE_SIZE
50 #define WCHAR_TYPE_SIZE 32
51 #undef WCHAR_TYPE
52 #define WCHAR_TYPE (TARGET_VXWORKS64 ? "int" : "long int")
54 #else
56 #undef WCHAR_TYPE_SIZE
57 #define WCHAR_TYPE_SIZE 16
58 #undef WCHAR_TYPE
59 #define WCHAR_TYPE "short unsigned int"
61 #endif
63 /* The VxWorks headers base wint_t on the definitions used for wchar_t.
64 Do the same here to make sure they remain in sync, in case WCHAR_TYPE
65 gets redefined for a specific CPU architecture. */
66 #undef WINT_TYPE_SIZE
67 #define WINT_TYPE_SIZE WCHAR_TYPE_SIZE
68 #undef WINT_TYPE
69 #define WINT_TYPE WCHAR_TYPE
71 /* ---------------------- Debug and unwind info formats ------------------ */
73 /* Dwarf2 unwind info is supported, unless overriden by a request for a target
74 specific format.
76 Taking care of this here allows using DWARF2_UNWIND_INFO in #if conditions
77 from the common config/vxworks.h files, included before the cpu
78 specializations. Unlike with conditions used in C expressions, where the
79 definitions which matter are those at the expression expansion point, use
80 in #if constructs requires an accurate definition of the operands at the
81 #if point. Since <cpu>/vxworks.h. is typically included after
82 config/vxworks.h, #if expressions in the latter can't rely on possible
83 redefinitions in the former. */
84 #if !ARM_UNWIND_INFO
85 #undef DWARF2_UNWIND_INFO
86 #define DWARF2_UNWIND_INFO 1
87 #endif
89 /* VxWorks uses DWARF2 debugging info. */
90 #define DWARF2_DEBUGGING_INFO 1
91 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
93 /* None of these other formats is supported. */
94 #undef DBX_DEBUGGING_INFO
95 #undef XCOFF_DEBUGGING_INFO
96 #undef VMS_DEBUGGING_INFO
98 /* ------------------------ Misc configuration bits ---------------------- */
100 #if !TARGET_VXWORKS7
101 /* VxWorks, prior to version 7, could not have dots in constructor
102 labels, because it used a mutant variation of collect2 that
103 generates C code instead of assembly. Thus each constructor label
104 had to be a legitimate C symbol. */
105 # undef NO_DOLLAR_IN_LABEL
106 # define NO_DOT_IN_LABEL
107 #endif
109 /* Kernel mode doesn't have ctors/dtors, but RTP mode does. */
110 #define TARGET_HAVE_CTORS_DTORS false
111 #define VXWORKS_OVERRIDE_OPTIONS /* empty */
113 /* No math library needed. */
114 #define MATH_LIBRARY ""
116 /* No profiling. */
117 #define VXWORKS_FUNCTION_PROFILER(FILE, LABELNO) do \
119 sorry ("profiler support for VxWorks"); \
120 } while (0)
122 /* We occasionally need to distinguish between the VxWorks variants. */
123 #define VXWORKS_KIND_NORMAL 1
124 #define VXWORKS_KIND_AE 2