1 /* IA32 VxWorks target definitions for GNU compiler.
2    Copyright (C) 2003-2020 Free Software Foundation, Inc.
3    Updated by CodeSourcery, LLC.
4 
5 This file is part of GCC.
6 
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11 
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16 
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/>.  */
20 
21 #undef ASM_OUTPUT_ALIGNED_BSS
22 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
23   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
24 
25 /* VxWorks uses the same ABI as Solaris 2, so use i386/sol2.h version.  */
26 
27 #undef TARGET_SUBTARGET_DEFAULT
28 #define TARGET_SUBTARGET_DEFAULT \
29 	(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_VECT8_RETURNS)
30 
31 /* Provide our target specific DBX_REGISTER_NUMBER.  VxWorks relies on
32    the SVR4 numbering.  */
33 
34 #undef DBX_REGISTER_NUMBER
35 #define DBX_REGISTER_NUMBER(n) \
36   (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
37 
38 #undef PTRDIFF_TYPE
39 #define PTRDIFF_TYPE (TARGET_LP64 ? "long int" : "int")
40 
41 #undef SIZE_TYPE
42 #define SIZE_TYPE (TARGET_LP64 ? "long unsigned int" : "unsigned int")
43 
44 #if TARGET_64BIT_DEFAULT
45 #undef VXWORKS_SYSCALL_LIBS_RTP
46 #define VXWORKS_SYSCALL_LIBS_RTP "-lsyscall"
47 #endif
48 
49 #define TARGET_OS_CPP_BUILTINS()			\
50   do							\
51     {							\
52       VXWORKS_OS_CPP_BUILTINS ();			\
53       if (TARGET_386)					\
54         builtin_define ("CPU=I80386");			\
55       else if (TARGET_486)				\
56         builtin_define ("CPU=I80486");			\
57       else if (TARGET_PENTIUM)				\
58         {						\
59           builtin_define ("CPU=PENTIUM");		\
60           builtin_define ("CPU_VARIANT=PENTIUM");	\
61         }						\
62       else if (TARGET_PENTIUMPRO)			\
63         {						\
64           builtin_define ("CPU=PENTIUM2");		\
65           builtin_define ("CPU_VARIANT=PENTIUMPRO");	\
66         }						\
67       else if (TARGET_PENTIUM4)				\
68         {						\
69           builtin_define ("CPU=PENTIUM4");		\
70           builtin_define ("CPU_VARIANT=PENTIUM4");	\
71         }						\
72       else if (TARGET_64BIT)				\
73           builtin_define ("CPU=X86_64");		\
74       else						\
75           builtin_define ("CPU=I80386");		\
76     } 							\
77   while (0)
78 
79 #undef  CPP_SPEC
80 #define CPP_SPEC VXWORKS_ADDITIONAL_CPP_SPEC
81 #undef  LIB_SPEC
82 #define LIB_SPEC VXWORKS_LIB_SPEC
83 #undef  STARTFILE_SPEC
84 #define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC
85 #undef  ENDFILE_SPEC
86 #define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC
87 #undef  LINK_SPEC
88 #define LINK_SPEC VXWORKS_LINK_SPEC
89 
90 #undef  SUBTARGET_SWITCHES
91 #define SUBTARGET_SWITCHES EXTRA_SUBTARGET_SWITCHES
92 
93 #undef SUBTARGET_OVERRIDE_OPTIONS
94 #define SUBTARGET_OVERRIDE_OPTIONS VXWORKS_OVERRIDE_OPTIONS
95 
96 /* No _mcount profiling on VxWorks.  */
97 #undef FUNCTION_PROFILER
98 #define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO)
99 
100 /* We cannot use PC-relative accesses for VxWorks PIC because there is no
101    fixed gap between segments.  */
102 #undef ASM_PREFERRED_EH_DATA_FORMAT
103 
104 /* Define this to be nonzero if static stack checking is supported.  */
105 #define STACK_CHECK_STATIC_BUILTIN 1
106 
107 /* This platform supports the probing method of stack checking (RTP mode).
108    8K is reserved in the stack to propagate exceptions in case of overflow.
109    On 64-bit targets, we double that size.  */
110 #if TARGET_64BIT_DEFAULT
111 #define STACK_CHECK_PROTECT 16384
112 #else
113 #define STACK_CHECK_PROTECT 8192
114 #endif
115