]>
Commit | Line | Data |
---|---|---|
0b85d816 | 1 | /* Definitions for GCC. Part of the machine description for CRIS. |
5624e564 | 2 | Copyright (C) 2001-2015 Free Software Foundation, Inc. |
0b85d816 HPN |
3 | Contributed by Axis Communications. Written by Hans-Peter Nilsson. |
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 | |
2f83c7d6 | 9 | the Free Software Foundation; either version 3, or (at your option) |
0b85d816 HPN |
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 | |
2f83c7d6 NC |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
0b85d816 HPN |
20 | |
21 | ||
22 | /* After the first "Node:" comment comes all preprocessor directives and | |
23 | attached declarations described in the info files, the "Using and | |
24 | Porting GCC" manual (uapgcc), in the same order as found in the "Target | |
25 | macros" section in the gcc-2.9x CVS edition of 2000-03-17. FIXME: Not | |
26 | really, but needs an update anyway. | |
27 | ||
28 | There is no generic copy-of-uapgcc comment, you'll have to see uapgcc | |
29 | for that. If applicable, there is a CRIS-specific comment. The order | |
30 | of macro definitions follow the order in the manual. Every section in | |
31 | the manual (node in the info pages) has an introductory `Node: | |
32 | <subchapter>' comment. If no macros are defined for a section, only | |
33 | the section-comment is present. */ | |
34 | ||
35 | /* This file defines the macros for cris-axis-linux-gnu that are not | |
36 | covered by cris.h, elfos.h and (config/)linux.h. */ | |
37 | ||
39ecc4b5 HPN |
38 | /* Make sure we have a valid TARGET_CPU_DEFAULT, so we can assume it |
39 | and take shortcuts below. */ | |
40 | #ifndef TARGET_CPU_DEFAULT | |
41 | #error "TARGET_CPU_DEFAULT not defined" | |
42 | #elif (TARGET_CPU_DEFAULT+0) != 10 && (TARGET_CPU_DEFAULT+0) != 32 | |
43 | #error "TARGET_CPU_DEFAULT must be 10 or 32, or this file be updated" | |
44 | #endif | |
0b85d816 HPN |
45 | |
46 | /* Node: Instruction Output */ | |
47 | ||
48 | #undef USER_LABEL_PREFIX | |
49 | #define USER_LABEL_PREFIX "" | |
50 | ||
51 | /* Node: Driver */ | |
52 | /* These macros are CRIS-specific, but used in target driver macros. */ | |
53 | ||
54 | #undef CRIS_CPP_SUBTARGET_SPEC | |
39ecc4b5 HPN |
55 | #if TARGET_CPU_DEFAULT == 32 |
56 | # define CRIS_CPP_SUBTARGET_SPEC \ | |
57 | "%{pthread:-D_REENTRANT}\ | |
a3010a69 | 58 | %{!march=*:%{!mcpu=*:-D__arch_v32 -D__CRIS_arch_version=32}}" |
39ecc4b5 HPN |
59 | #else |
60 | # define CRIS_CPP_SUBTARGET_SPEC \ | |
a6e464ae | 61 | "%{pthread:-D_REENTRANT}\ |
a3010a69 | 62 | %{!march=*:%{!mcpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}" |
39ecc4b5 | 63 | #endif |
0b85d816 HPN |
64 | |
65 | #undef CRIS_CC1_SUBTARGET_SPEC | |
39ecc4b5 HPN |
66 | #if TARGET_CPU_DEFAULT == 32 |
67 | # define CRIS_CC1_SUBTARGET_SPEC \ | |
a3010a69 | 68 | "%{!march=*:%{!mcpu=*:-march=v32}}" |
39ecc4b5 HPN |
69 | #define CRIS_SUBTARGET_DEFAULT_ARCH MASK_AVOID_GOTPLT |
70 | #else | |
71 | # define CRIS_CC1_SUBTARGET_SPEC \ | |
a3010a69 | 72 | "%{!march=*:%{!mcpu=*:-march=v10}}" |
39ecc4b5 HPN |
73 | #define CRIS_SUBTARGET_DEFAULT_ARCH 0 |
74 | #endif | |
0b85d816 HPN |
75 | |
76 | #undef CRIS_ASM_SUBTARGET_SPEC | |
39ecc4b5 HPN |
77 | #if TARGET_CPU_DEFAULT == 32 |
78 | # define CRIS_ASM_SUBTARGET_SPEC \ | |
79 | "--em=criself \ | |
a3010a69 | 80 | %{!march=*:%{!mcpu=*:--march=v32}} \ |
39ecc4b5 | 81 | %{!fleading-underscore:--no-underscore}\ |
428b3812 | 82 | %{" FPIE_OR_FPIC_SPEC ": --pic}" |
39ecc4b5 HPN |
83 | #else |
84 | # define CRIS_ASM_SUBTARGET_SPEC \ | |
85 | "--em=criself \ | |
a3010a69 | 86 | %{!march=*:%{!mcpu=*:--march=v10}} \ |
0b85d816 | 87 | %{!fleading-underscore:--no-underscore}\ |
428b3812 | 88 | %{" FPIE_OR_FPIC_SPEC ": --pic}" |
39ecc4b5 | 89 | #endif |
0b85d816 | 90 | |
2a186d97 HPN |
91 | /* Previously controlled by target_flags. */ |
92 | #undef TARGET_LINUX | |
93 | #define TARGET_LINUX 1 | |
0b85d816 HPN |
94 | |
95 | #undef CRIS_SUBTARGET_DEFAULT | |
96 | #define CRIS_SUBTARGET_DEFAULT \ | |
2a186d97 HPN |
97 | (MASK_SVINTO \ |
98 | + MASK_ETRAX4_ADD \ | |
39ecc4b5 HPN |
99 | + MASK_ALIGN_BY_32 \ |
100 | + CRIS_SUBTARGET_DEFAULT_ARCH) | |
0b85d816 HPN |
101 | |
102 | #undef CRIS_DEFAULT_CPU_VERSION | |
103 | #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG | |
104 | ||
7bd85ce0 JM |
105 | #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" |
106 | ||
0b85d816 HPN |
107 | #undef CRIS_LINK_SUBTARGET_SPEC |
108 | #define CRIS_LINK_SUBTARGET_SPEC \ | |
109 | "-mcrislinux\ | |
0b85d816 | 110 | %{shared} %{static}\ |
a3010a69 | 111 | %{symbolic:-Bdynamic} %{static:-Bstatic}\ |
7bd85ce0 JM |
112 | %{!shared:%{!static:\ |
113 | %{rdynamic:-export-dynamic}\ | |
107fd1c1 | 114 | -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}\ |
349ccf2e | 115 | %{!r:%{O2|O3: --gc-sections}}" |
0b85d816 | 116 | |
0b85d816 | 117 | |
a6e464ae HPN |
118 | /* Node: Run-time Target */ |
119 | ||
120 | /* For the cris-*-linux* subtarget. */ | |
121 | #undef TARGET_OS_CPP_BUILTINS | |
122 | #define TARGET_OS_CPP_BUILTINS() \ | |
123 | do \ | |
124 | { \ | |
107fd1c1 | 125 | GNU_USER_TARGET_OS_CPP_BUILTINS(); \ |
a6e464ae HPN |
126 | if (flag_leading_underscore <= 0) \ |
127 | builtin_define ("__NO_UNDERSCORES__"); \ | |
128 | } \ | |
129 | while (0) | |
7d459587 JM |
130 | |
131 | /* Node: Type Layout */ | |
a6e464ae | 132 | |
7d459587 JM |
133 | #undef SIZE_TYPE |
134 | #define SIZE_TYPE "unsigned int" | |
135 | ||
136 | #undef PTRDIFF_TYPE | |
137 | #define PTRDIFF_TYPE "int" | |
a6e464ae | 138 | |
0b85d816 HPN |
139 | /* Node: Sections */ |
140 | ||
141 | /* GNU/Linux has crti and crtn and does not need the | |
cea3bd3e RH |
142 | CRT_CALL_STATIC_FUNCTION trick in cris.h. */ |
143 | #undef CRT_CALL_STATIC_FUNCTION | |
0b85d816 HPN |
144 | |
145 | /* | |
146 | * Local variables: | |
147 | * eval: (c-set-style "gnu") | |
148 | * indent-tabs-mode: t | |
149 | * End: | |
150 | */ |