xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/vx-common.h (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
11debfc3dSmrg /* Target-independent configuration for VxWorks and VxWorks AE.
2*8feb0f0bSmrg    Copyright (C) 2005-2020 Free Software Foundation, Inc.
31debfc3dSmrg    Contributed by CodeSourcery, LLC.
41debfc3dSmrg 
51debfc3dSmrg This file is part of GCC.
61debfc3dSmrg 
71debfc3dSmrg GCC is free software; you can redistribute it and/or modify it under
81debfc3dSmrg the terms of the GNU General Public License as published by the Free
91debfc3dSmrg Software Foundation; either version 3, or (at your option) any later
101debfc3dSmrg version.
111debfc3dSmrg 
121debfc3dSmrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
131debfc3dSmrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
141debfc3dSmrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
151debfc3dSmrg for more details.
161debfc3dSmrg 
171debfc3dSmrg You should have received a copy of the GNU General Public License
181debfc3dSmrg along with GCC; see the file COPYING3.  If not see
191debfc3dSmrg <http://www.gnu.org/licenses/>.  */
201debfc3dSmrg 
21*8feb0f0bSmrg /* ------------------------- Common SPEC strings -------------------------  */
22*8feb0f0bSmrg 
231debfc3dSmrg /* Most of these will probably be overridden by subsequent headers.  We
241debfc3dSmrg    undefine them here just in case, and define VXWORKS_ versions of each,
251debfc3dSmrg    to be used in port-specific vxworks.h.  */
261debfc3dSmrg #undef LIB_SPEC
271debfc3dSmrg #undef LINK_SPEC
281debfc3dSmrg #undef LIBGCC_SPEC
291debfc3dSmrg #define LIBGCC_SPEC VXWORKS_LIBGCC_SPEC
301debfc3dSmrg #undef STARTFILE_SPEC
311debfc3dSmrg #undef ENDFILE_SPEC
321debfc3dSmrg 
331debfc3dSmrg /* Most of these macros are overridden in "config/vxworks.h" or
341debfc3dSmrg    "config/vxworksae.h" and are here merely for documentation
351debfc3dSmrg    purposes.  */
361debfc3dSmrg #define VXWORKS_ADDITIONAL_CPP_SPEC ""
371debfc3dSmrg #define	VXWORKS_LIB_SPEC ""
381debfc3dSmrg #define VXWORKS_LINK_SPEC ""
391debfc3dSmrg #define VXWORKS_LIBGCC_SPEC ""
401debfc3dSmrg #define	VXWORKS_STARTFILE_SPEC ""
411debfc3dSmrg #define VXWORKS_ENDFILE_SPEC ""
42*8feb0f0bSmrg #define VXWORKS_CC1_SPEC ""
431debfc3dSmrg 
44*8feb0f0bSmrg /* ----------------------- Common type descriptions -----------------------  */
451debfc3dSmrg 
46*8feb0f0bSmrg /* Regardless of the target architecture, VxWorks uses a signed 32bit
47*8feb0f0bSmrg    integer for wchar_t starting with vx7 SR06xx.  An unsigned short
48*8feb0f0bSmrg    otherwise.  */
49*8feb0f0bSmrg #if TARGET_VXWORKS7
50*8feb0f0bSmrg 
51*8feb0f0bSmrg #undef WCHAR_TYPE_SIZE
52*8feb0f0bSmrg #define WCHAR_TYPE_SIZE 32
531debfc3dSmrg #undef WCHAR_TYPE
54*8feb0f0bSmrg #define WCHAR_TYPE (TARGET_VXWORKS64 ? "int" : "long int")
55*8feb0f0bSmrg 
56*8feb0f0bSmrg #else
57*8feb0f0bSmrg 
581debfc3dSmrg #undef WCHAR_TYPE_SIZE
591debfc3dSmrg #define WCHAR_TYPE_SIZE 16
60*8feb0f0bSmrg #undef WCHAR_TYPE
61*8feb0f0bSmrg #define WCHAR_TYPE "short unsigned int"
621debfc3dSmrg 
63*8feb0f0bSmrg #endif
64*8feb0f0bSmrg 
65*8feb0f0bSmrg /* The VxWorks headers base wint_t on the definitions used for wchar_t.
66*8feb0f0bSmrg    Do the same here to make sure they remain in sync, in case WCHAR_TYPE
67*8feb0f0bSmrg    gets redefined for a specific CPU architecture.  */
681debfc3dSmrg #undef WINT_TYPE_SIZE
69*8feb0f0bSmrg #define WINT_TYPE_SIZE WCHAR_TYPE_SIZE
70*8feb0f0bSmrg #undef WINT_TYPE
71*8feb0f0bSmrg #define WINT_TYPE WCHAR_TYPE
721debfc3dSmrg 
73*8feb0f0bSmrg /* ---------------------- Debug and unwind info formats ------------------  */
74*8feb0f0bSmrg 
75*8feb0f0bSmrg /* Dwarf2 unwind info is supported, unless overriden by a request for a target
76*8feb0f0bSmrg    specific format.
77*8feb0f0bSmrg 
78*8feb0f0bSmrg    Taking care of this here allows using DWARF2_UNWIND_INFO in #if conditions
79*8feb0f0bSmrg    from the common config/vxworks.h files, included before the cpu
80*8feb0f0bSmrg    specializations.  Unlike with conditions used in C expressions, where the
81*8feb0f0bSmrg    definitions which matter are those at the expression expansion point, use
82*8feb0f0bSmrg    in #if constructs requires an accurate definition of the operands at the
83*8feb0f0bSmrg    #if point.  Since <cpu>/vxworks.h. is typically included after
84*8feb0f0bSmrg    config/vxworks.h, #if expressions in the latter can't rely on possible
85*8feb0f0bSmrg    redefinitions in the former.  */
86*8feb0f0bSmrg #if !ARM_UNWIND_INFO
871debfc3dSmrg #undef DWARF2_UNWIND_INFO
88a2dc1f3fSmrg #define DWARF2_UNWIND_INFO 1
89*8feb0f0bSmrg #endif
901debfc3dSmrg 
91*8feb0f0bSmrg /* VxWorks uses DWARF2 debugging info.  */
921debfc3dSmrg #define DWARF2_DEBUGGING_INFO 1
931debfc3dSmrg #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
941debfc3dSmrg 
951debfc3dSmrg /* None of these other formats is supported.  */
961debfc3dSmrg #undef DBX_DEBUGGING_INFO
971debfc3dSmrg #undef XCOFF_DEBUGGING_INFO
981debfc3dSmrg #undef VMS_DEBUGGING_INFO
991debfc3dSmrg 
100*8feb0f0bSmrg /* ------------------------ Misc configuration bits ----------------------  */
101*8feb0f0bSmrg 
102*8feb0f0bSmrg #ifndef TARGET_VXWORKS7
103*8feb0f0bSmrg /* VxWorks, prior to version 7, could not have dots in constructor
104*8feb0f0bSmrg    labels, because it used a mutant variation of collect2 that
105*8feb0f0bSmrg    generates C code instead of assembly.  Thus each constructor label
106*8feb0f0bSmrg    had to be a legitimate C symbol.  */
107*8feb0f0bSmrg # undef NO_DOLLAR_IN_LABEL
108*8feb0f0bSmrg # define NO_DOT_IN_LABEL
109*8feb0f0bSmrg #endif
110*8feb0f0bSmrg 
1111debfc3dSmrg /* Kernel mode doesn't have ctors/dtors, but RTP mode does.  */
1121debfc3dSmrg #define TARGET_HAVE_CTORS_DTORS false
1131debfc3dSmrg #define VXWORKS_OVERRIDE_OPTIONS /* empty */
1141debfc3dSmrg 
1151debfc3dSmrg /* No math library needed.  */
1161debfc3dSmrg #define MATH_LIBRARY ""
1171debfc3dSmrg 
1181debfc3dSmrg /* No profiling.  */
1191debfc3dSmrg #define VXWORKS_FUNCTION_PROFILER(FILE, LABELNO) do	\
1201debfc3dSmrg {							\
1211debfc3dSmrg   sorry ("profiler support for VxWorks");		\
1221debfc3dSmrg } while (0)
1231debfc3dSmrg 
1241debfc3dSmrg /* We occasionally need to distinguish between the VxWorks variants.  */
1251debfc3dSmrg #define VXWORKS_KIND_NORMAL  1
1261debfc3dSmrg #define VXWORKS_KIND_AE      2
127