]>
Commit | Line | Data |
---|---|---|
4977bab6 | 1 | /* Definitions of target machine for GNU compiler. Vxworks PowerPC version. |
47f67e51 | 2 | Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005, 2007, 2009 |
2eab15c9 PE |
3 | Free Software Foundation, Inc. |
4 | Contributed by CodeSourcery, LLC. | |
4977bab6 | 5 | |
2eab15c9 | 6 | This file is part of GCC. |
4977bab6 | 7 | |
2eab15c9 PE |
8 | GCC is free software; you can redistribute it and/or modify it under |
9 | the terms of the GNU General Public License as published by the Free | |
2f83c7d6 | 10 | Software Foundation; either version 3, or (at your option) any later |
2eab15c9 | 11 | version. |
4977bab6 | 12 | |
2eab15c9 PE |
13 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 | for more details. | |
4977bab6 | 17 | |
2eab15c9 | 18 | You should have received a copy of the GNU General Public License |
2f83c7d6 NC |
19 | along with GCC; see the file COPYING3. If not see |
20 | <http://www.gnu.org/licenses/>. */ | |
4977bab6 | 21 | |
2eab15c9 PE |
22 | /* Note to future editors: VxWorks is mostly an EABI target. We do |
23 | not use rs6000/eabi.h because we would have to override most of | |
24 | it anyway. However, if you change that file, consider making | |
25 | analogous changes here too. */ | |
26 | ||
27 | #undef TARGET_VERSION | |
28 | #define TARGET_VERSION fprintf (stderr, " (PowerPC VxWorks)"); | |
29 | ||
30 | /* CPP predefined macros. */ | |
31 | ||
32 | #undef TARGET_OS_CPP_BUILTINS | |
cc956ba2 NB |
33 | #define TARGET_OS_CPP_BUILTINS() \ |
34 | do \ | |
35 | { \ | |
2eab15c9 PE |
36 | builtin_define ("__ppc"); \ |
37 | builtin_define ("__EABI__"); \ | |
38 | builtin_define ("__ELF__"); \ | |
cc956ba2 | 39 | builtin_define ("__vxworks"); \ |
2eab15c9 PE |
40 | builtin_define ("__VXWORKS__"); \ |
41 | if (!TARGET_SOFT_FLOAT) \ | |
42 | builtin_define ("__hardfp"); \ | |
2eab15c9 PE |
43 | \ |
44 | /* C89 namespace violation! */ \ | |
45 | builtin_define ("CPU_FAMILY=PPC"); \ | |
cc956ba2 NB |
46 | } \ |
47 | while (0) | |
4977bab6 | 48 | |
2eab15c9 PE |
49 | /* Only big endian PPC is supported by VxWorks. */ |
50 | #undef BYTES_BIG_ENDIAN | |
51 | #define BYTES_BIG_ENDIAN 1 | |
52 | ||
4977bab6 ZW |
53 | /* We have to kill off the entire specs set created by rs6000/sysv4.h |
54 | and substitute our own set. The top level vxworks.h has done some | |
55 | of this for us. */ | |
56 | ||
57 | #undef SUBTARGET_EXTRA_SPECS | |
58 | #undef CPP_SPEC | |
59 | #undef CC1_SPEC | |
60 | #undef ASM_SPEC | |
61 | ||
62 | #define SUBTARGET_EXTRA_SPECS /* none needed */ | |
63 | ||
2eab15c9 PE |
64 | /* FIXME: The only reason we allow no -mcpu switch at all is because |
65 | config-ml.in insists on a "." multilib. */ | |
4977bab6 | 66 | #define CPP_SPEC \ |
2eab15c9 PE |
67 | "%{!DCPU=*: \ |
68 | %{mcpu=403 : -DCPU=PPC403 ; \ | |
69 | mcpu=405 : -DCPU=PPC405 ; \ | |
70 | mcpu=440 : -DCPU=PPC440 ; \ | |
47f67e51 PB |
71 | mcpu=464 : -DCPU=PPC464 ; \ |
72 | mcpu=476 : -DCPU=PPC476 ; \ | |
2eab15c9 PE |
73 | mcpu=603 : -DCPU=PPC603 ; \ |
74 | mcpu=604 : -DCPU=PPC604 ; \ | |
75 | mcpu=860 : -DCPU=PPC860 ; \ | |
76 | mcpu=8540: -DCPU=PPC85XX ; \ | |
77 | : -DCPU=PPC604 }}" \ | |
78 | VXWORKS_ADDITIONAL_CPP_SPEC | |
79 | ||
80 | #define CC1_SPEC \ | |
81 | "%{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default} \ | |
4977bab6 | 82 | %{mlittle|mlittle-endian:-mstrict-align} \ |
2eab15c9 | 83 | %{profile: -p} \ |
4977bab6 | 84 | %{fvec:-maltivec} %{fvec-eabi:-maltivec -mabi=altivec}" |
2eab15c9 PE |
85 | |
86 | #define ASM_SPEC \ | |
87 | "%(asm_cpu) \ | |
48137d59 | 88 | %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \ |
2eab15c9 PE |
89 | %{v:-v} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ |
90 | %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig" | |
91 | ||
92 | #undef LIB_SPEC | |
93 | #define LIB_SPEC VXWORKS_LIB_SPEC | |
94 | #undef LINK_SPEC | |
95 | #define LINK_SPEC VXWORKS_LINK_SPEC | |
96 | #undef STARTFILE_SPEC | |
97 | #define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC | |
98 | #undef ENDFILE_SPEC | |
99 | #define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC | |
100 | ||
101 | /* There is no default multilib. */ | |
102 | #undef MULTILIB_DEFAULTS | |
103 | ||
104 | #undef TARGET_DEFAULT | |
105 | #define TARGET_DEFAULT \ | |
106 | (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI | MASK_STRICT_ALIGN) | |
107 | ||
108 | #undef PROCESSOR_DEFAULT | |
109 | #define PROCESSOR_DEFAULT PROCESSOR_PPC604 | |
110 | ||
111 | /* Nor sdata, for kernel mode. We use this in | |
112 | SUBSUBTARGET_INITIALIZE_OPTIONS, after rs6000_rtp has been initialized. */ | |
113 | #undef SDATA_DEFAULT_SIZE | |
114 | #define SDATA_DEFAULT_SIZE (TARGET_VXWORKS_RTP ? 8 : 0) | |
115 | ||
116 | #undef STACK_BOUNDARY | |
117 | #define STACK_BOUNDARY (16*BITS_PER_UNIT) | |
118 | /* Override sysv4.h, reset to the default. */ | |
119 | #undef PREFERRED_STACK_BOUNDARY | |
120 | ||
2eab15c9 PE |
121 | /* Make -mcpu=8540 imply SPE. ISEL is automatically enabled, the |
122 | others must be done by hand. Handle -mrtp. Disable -fPIC | |
123 | for -mrtp - the VxWorks PIC model is not compatible with it. */ | |
124 | #undef SUBSUBTARGET_OVERRIDE_OPTIONS | |
125 | #define SUBSUBTARGET_OVERRIDE_OPTIONS \ | |
126 | do { \ | |
127 | if (TARGET_E500) \ | |
128 | { \ | |
129 | rs6000_spe = 1; \ | |
130 | rs6000_spe_abi = 1; \ | |
131 | rs6000_float_gprs = 1; \ | |
132 | } \ | |
133 | \ | |
134 | if (!g_switch_set) \ | |
135 | g_switch_value = SDATA_DEFAULT_SIZE; \ | |
136 | VXWORKS_OVERRIDE_OPTIONS; \ | |
137 | } while (0) | |
138 | ||
139 | /* No _mcount profiling on VxWorks. */ | |
140 | #undef FUNCTION_PROFILER | |
141 | #define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO) |