Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/darwin.h @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
rev | line source |
---|---|
0 | 1 /* Target definitions for Darwin (Mac OS X) systems. |
131 | 2 Copyright (C) 1989-2018 Free Software Foundation, Inc. |
0 | 3 Contributed by Apple Computer Inc. |
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 Under Section 7 of GPL version 3, you are granted additional | |
18 permissions described in the GCC Runtime Library Exception, version | |
19 3.1, as published by the Free Software Foundation. | |
20 | |
21 You should have received a copy of the GNU General Public License and | |
22 a copy of the GCC Runtime Library Exception along with this program; | |
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
24 <http://www.gnu.org/licenses/>. */ | |
25 | |
26 #ifndef CONFIG_DARWIN_H | |
27 #define CONFIG_DARWIN_H | |
28 | |
29 /* The definitions in this file are common to all processor types | |
30 running Darwin, which is the kernel for Mac OS X. Darwin is | |
31 basically a BSD user layer laid over a Mach kernel, then evolved | |
32 for many years (at NeXT) in parallel with other Unix systems. So | |
33 while the runtime is a somewhat idiosyncratic Mach-based thing, | |
34 other definitions look like they would for a BSD variant. */ | |
35 | |
36 /* Although NeXT ran on many different architectures, as of Jan 2001 | |
37 the only supported Darwin targets are PowerPC and x86. */ | |
38 | |
39 /* One of Darwin's NeXT legacies is the Mach-O format, which is partly | |
40 like a.out and partly like COFF, with additional features like | |
41 multi-architecture binary support. */ | |
42 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
43 #define DARWIN_X86 0 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
44 #define DARWIN_PPC 0 |
0 | 45 |
46 /* Suppress g++ attempt to link in the math library automatically. */ | |
47 #define MATH_LIBRARY "" | |
48 | |
49 /* We have atexit. */ | |
50 | |
51 #define HAVE_ATEXIT | |
52 | |
53 /* Define an empty body for the function do_global_dtors() in libgcc2.c. */ | |
54 | |
55 #define DO_GLOBAL_DTORS_BODY | |
56 | |
57 /* The string value for __SIZE_TYPE__. */ | |
58 | |
59 #ifndef SIZE_TYPE | |
60 #define SIZE_TYPE "long unsigned int" | |
61 #endif | |
62 | |
63 /* Type used for ptrdiff_t, as a string used in a declaration. */ | |
64 | |
65 #undef PTRDIFF_TYPE | |
66 #define PTRDIFF_TYPE "int" | |
67 | |
68 /* wchar_t is int. */ | |
69 | |
70 #undef WCHAR_TYPE | |
71 #define WCHAR_TYPE "int" | |
72 #undef WCHAR_TYPE_SIZE | |
73 #define WCHAR_TYPE_SIZE 32 | |
74 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
75 #define INT8_TYPE "signed char" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
76 #define INT16_TYPE "short int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
77 #define INT32_TYPE "int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
78 #define INT64_TYPE "long long int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
79 #define UINT8_TYPE "unsigned char" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
80 #define UINT16_TYPE "short unsigned int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
81 #define UINT32_TYPE "unsigned int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
82 #define UINT64_TYPE "long long unsigned int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
83 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
84 #define INT_LEAST8_TYPE "signed char" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
85 #define INT_LEAST16_TYPE "short int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
86 #define INT_LEAST32_TYPE "int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
87 #define INT_LEAST64_TYPE "long long int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
88 #define UINT_LEAST8_TYPE "unsigned char" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
89 #define UINT_LEAST16_TYPE "short unsigned int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
90 #define UINT_LEAST32_TYPE "unsigned int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
91 #define UINT_LEAST64_TYPE "long long unsigned int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
92 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
93 #define INT_FAST8_TYPE "signed char" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
94 #define INT_FAST16_TYPE "short int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
95 #define INT_FAST32_TYPE "int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
96 #define INT_FAST64_TYPE "long long int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
97 #define UINT_FAST8_TYPE "unsigned char" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
98 #define UINT_FAST16_TYPE "short unsigned int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
99 #define UINT_FAST32_TYPE "unsigned int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
100 #define UINT_FAST64_TYPE "long long unsigned int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
101 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
102 #define INTPTR_TYPE "long int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
103 #define UINTPTR_TYPE "long unsigned int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
104 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
105 #define SIG_ATOMIC_TYPE "int" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
106 |
0 | 107 /* Default to using the NeXT-style runtime, since that's what is |
108 pre-installed on Darwin systems. */ | |
109 | |
111 | 110 #define NEXT_OBJC_RUNTIME 1 |
0 | 111 |
112 /* Don't default to pcc-struct-return, because gcc is the only compiler, and | |
113 we want to retain compatibility with older gcc versions. */ | |
114 | |
115 #undef DEFAULT_PCC_STRUCT_RETURN | |
116 #define DEFAULT_PCC_STRUCT_RETURN 0 | |
117 | |
118 /* True if pragma ms_struct is in effect. */ | |
119 extern GTY(()) int darwin_ms_struct; | |
120 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
121 #define DRIVER_SELF_SPECS \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
122 "%{gfull:-g -fno-eliminate-unused-debug-symbols} %<gfull", \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
123 "%{gused:-g -feliminate-unused-debug-symbols} %<gused", \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
124 "%{fapple-kext|mkernel:-static}", \ |
131 | 125 "%{shared:-Zdynamiclib} %<shared", \ |
126 "%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform } \ | |
127 %<gsplit-dwarf" | |
0 | 128 |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
129 #define DARWIN_CC1_SPEC \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
130 "%{findirect-virtual-calls: -fapple-kext} %<findirect-virtual-calls " \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
131 "%{fterminated-vtables: -fapple-kext} %<fterminated-vtables " \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
132 "%<filelist* %<framework*" |
0 | 133 |
134 #define SUBSUBTARGET_OVERRIDE_OPTIONS \ | |
135 do { \ | |
136 darwin_override_options (); \ | |
137 } while (0) | |
138 | |
139 #define SUBTARGET_C_COMMON_OVERRIDE_OPTIONS do { \ | |
140 if (flag_mkernel || flag_apple_kext) \ | |
141 { \ | |
142 if (flag_use_cxa_atexit == 2) \ | |
143 flag_use_cxa_atexit = 0; \ | |
144 /* kexts should always be built without the coalesced sections \ | |
145 because the kernel loader doesn't grok such sections. */ \ | |
146 flag_weak = 0; \ | |
147 /* No RTTI in kexts. */ \ | |
148 flag_rtti = 0; \ | |
149 } \ | |
150 } while (0) | |
151 | |
152 /* Machine dependent cpp options. Don't add more options here, add | |
153 them to darwin_cpp_builtins in darwin-c.c. */ | |
154 | |
155 #undef CPP_SPEC | |
156 #define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__}" \ | |
157 " %{pthread:-D_REENTRANT}" | |
158 | |
159 /* This is mostly a clone of the standard LINK_COMMAND_SPEC, plus | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
160 precomp, libtool, and fat build additions. |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
161 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
162 In general, random Darwin linker flags should go into LINK_SPEC |
0 | 163 instead of LINK_COMMAND_SPEC. The command spec is better for |
164 specifying the handling of options understood by generic Unix | |
165 linkers, and for positional arguments like libraries. */ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
166 |
111 | 167 #if LD64_HAS_EXPORT_DYNAMIC |
168 #define DARWIN_EXPORT_DYNAMIC " %{rdynamic:-export_dynamic}" | |
169 #else | |
170 #define DARWIN_EXPORT_DYNAMIC " %{rdynamic: %nrdynamic is not supported}" | |
171 #endif | |
172 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
173 #define LINK_COMMAND_SPEC_A \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
174 "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ |
111 | 175 %(linker)" \ |
176 LINK_PLUGIN_SPEC \ | |
177 "%{flto*:%<fcompare-debug*} \ | |
131 | 178 %{flto} %{fno-lto} %{flto=*} \ |
111 | 179 %l " LINK_COMPRESS_DEBUG_SPEC \ |
180 "%X %{s} %{t} %{Z} %{u*} \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
181 %{e*} %{r} \ |
0 | 182 %{o*}%{!o:-o a.out} \ |
131 | 183 %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
184 %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \ |
111 | 185 %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
186 %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \ |
111 | 187 %{fgnu-tm: \ |
188 %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \ | |
131 | 189 %{!nostdlib:%{!r:%{!nodefaultlibs:\ |
111 | 190 %{%:sanitize(address): -lasan } \ |
191 %{%:sanitize(undefined): -lubsan } \ | |
192 %(link_ssp) \ | |
193 " DARWIN_EXPORT_DYNAMIC " %<rdynamic \ | |
194 %(link_gcc_c_sequence) \ | |
131 | 195 }}}\ |
196 %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}" | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
197 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
198 #define DSYMUTIL "\ndsymutil" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
199 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
200 #define DSYMUTIL_SPEC \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
201 "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
202 %{v} \ |
111 | 203 %{gdwarf-2:%{!gstabs*:%{%:debug-level-gt(0): -idsym}}}\ |
0 | 204 %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \ |
111 | 205 %{gdwarf-2:%{!gstabs*:%{%:debug-level-gt(0): -dsym}}}}}}}}}}}" |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
206 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
207 #define LINK_COMMAND_SPEC LINK_COMMAND_SPEC_A DSYMUTIL_SPEC |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
208 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
209 /* Tell collect2 to run dsymutil for us as necessary. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
210 #define COLLECT_RUN_DSYMUTIL 1 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
211 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
212 /* We only want one instance of %G, since libSystem (Darwin's -lc) does not depend |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
213 on libgcc. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
214 #undef LINK_GCC_C_SEQUENCE_SPEC |
131 | 215 #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L}" |
0 | 216 |
111 | 217 /* ld64 supports a sysroot, it just has a different name and there's no easy |
218 way to check for it at config time. */ | |
219 #undef HAVE_LD_SYSROOT | |
220 #define HAVE_LD_SYSROOT 1 | |
221 /* It seems the only (working) way to get a space after %R is to append a | |
222 dangling '/'. */ | |
223 #define SYSROOT_SPEC "%{!isysroot*:-syslibroot %R/ }" | |
224 | |
225 /* Do the same as clang, for now, and insert the sysroot for ld when an | |
226 isysroot is specified. */ | |
0 | 227 #define LINK_SYSROOT_SPEC "%{isysroot*:-syslibroot %*}" |
111 | 228 |
229 /* Suppress the addition of extra prefix paths when a sysroot is in use. */ | |
230 #define STANDARD_STARTFILE_PREFIX_1 "" | |
231 #define STANDARD_STARTFILE_PREFIX_2 "" | |
232 | |
233 #define DARWIN_PIE_SPEC "%{fpie|pie|fPIE:}" | |
0 | 234 |
235 /* Please keep the random linker options in alphabetical order (modulo | |
236 'Z' and 'no' prefixes). Note that options taking arguments may appear | |
237 multiple times on a command line with different arguments each time, | |
238 so put a * after their names so all of them get passed. */ | |
239 #define LINK_SPEC \ | |
240 "%{static}%{!static:-dynamic} \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
241 %:remove-outfile(-ldl) \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
242 %:remove-outfile(-lm) \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
243 %:remove-outfile(-lpthread) \ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
244 %{fgnu-runtime: %{static|static-libgcc: \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
245 %:replace-outfile(-lobjc libobjc-gnu.a%s); \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
246 :%:replace-outfile(-lobjc -lobjc-gnu ) } }\ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
247 %{static|static-libgcc|static-libgfortran:%:replace-outfile(-lgfortran libgfortran.a%s)}\ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
248 %{static|static-libgcc|static-libstdc++|static-libgfortran:%:replace-outfile(-lgomp libgomp.a%s)}\ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
249 %{static|static-libgcc|static-libstdc++:%:replace-outfile(-lstdc++ libstdc++.a%s)}\ |
0 | 250 %{!Zdynamiclib: \ |
251 %{Zforce_cpusubtype_ALL:-arch %(darwin_arch) -force_cpusubtype_ALL} \ | |
252 %{!Zforce_cpusubtype_ALL:-arch %(darwin_subarch)} \ | |
253 %{Zbundle:-bundle} \ | |
254 %{Zbundle_loader*:-bundle_loader %*} \ | |
255 %{client_name*} \ | |
256 %{compatibility_version*:%e-compatibility_version only allowed with -dynamiclib\ | |
257 } \ | |
258 %{current_version*:%e-current_version only allowed with -dynamiclib} \ | |
259 %{Zforce_flat_namespace:-force_flat_namespace} \ | |
260 %{Zinstall_name*:%e-install_name only allowed with -dynamiclib} \ | |
261 %{keep_private_externs} \ | |
262 %{private_bundle} \ | |
263 } \ | |
264 %{Zdynamiclib: -dylib \ | |
265 %{Zbundle:%e-bundle not allowed with -dynamiclib} \ | |
266 %{Zbundle_loader*:%e-bundle_loader not allowed with -dynamiclib} \ | |
267 %{client_name*:%e-client_name not allowed with -dynamiclib} \ | |
268 %{compatibility_version*:-dylib_compatibility_version %*} \ | |
269 %{current_version*:-dylib_current_version %*} \ | |
270 %{Zforce_cpusubtype_ALL:-arch %(darwin_arch)} \ | |
271 %{!Zforce_cpusubtype_ALL: -arch %(darwin_subarch)} \ | |
272 %{Zforce_flat_namespace:%e-force_flat_namespace not allowed with -dynamiclib} \ | |
273 %{Zinstall_name*:-dylib_install_name %*} \ | |
274 %{keep_private_externs:%e-keep_private_externs not allowed with -dynamiclib} \ | |
275 %{private_bundle:%e-private_bundle not allowed with -dynamiclib} \ | |
276 } \ | |
277 %{Zall_load:-all_load} \ | |
278 %{Zallowable_client*:-allowable_client %*} \ | |
279 %{Zbind_at_load:-bind_at_load} \ | |
280 %{Zarch_errors_fatal:-arch_errors_fatal} \ | |
281 %{Zdead_strip:-dead_strip} \ | |
282 %{Zno_dead_strip_inits_and_terms:-no_dead_strip_inits_and_terms} \ | |
283 %{Zdylib_file*:-dylib_file %*} \ | |
284 %{Zdynamic:-dynamic}\ | |
285 %{Zexported_symbols_list*:-exported_symbols_list %*} \ | |
286 %{Zflat_namespace:-flat_namespace} \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
287 %{headerpad_max_install_names} \ |
0 | 288 %{Zimage_base*:-image_base %*} \ |
289 %{Zinit*:-init %*} \ | |
290 %{mmacosx-version-min=*:-macosx_version_min %*} \ | |
291 %{nomultidefs} \ | |
292 %{Zmulti_module:-multi_module} %{Zsingle_module:-single_module} \ | |
293 %{Zmultiply_defined*:-multiply_defined %*} \ | |
294 %{!Zmultiply_defined*:%{shared-libgcc: \ | |
295 %:version-compare(< 10.5 mmacosx-version-min= -multiply_defined) \ | |
296 %:version-compare(< 10.5 mmacosx-version-min= suppress)}} \ | |
297 %{Zmultiplydefinedunused*:-multiply_defined_unused %*} \ | |
111 | 298 " DARWIN_PIE_SPEC " \ |
0 | 299 %{prebind} %{noprebind} %{nofixprebinding} %{prebind_all_twolevel_modules} \ |
300 %{read_only_relocs} \ | |
301 %{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} \ | |
302 %{Zsegaddr*:-segaddr %*} \ | |
303 %{Zsegs_read_only_addr*:-segs_read_only_addr %*} \ | |
304 %{Zsegs_read_write_addr*:-segs_read_write_addr %*} \ | |
305 %{Zseg_addr_table*: -seg_addr_table %*} \ | |
306 %{Zfn_seg_addr_table_filename*:-seg_addr_table_filename %*} \ | |
307 %{sub_library*} %{sub_umbrella*} \ | |
308 " LINK_SYSROOT_SPEC " \ | |
309 %{twolevel_namespace} %{twolevel_namespace_hints} \ | |
310 %{Zumbrella*: -umbrella %*} \ | |
311 %{undefined*} \ | |
312 %{Zunexported_symbols_list*:-unexported_symbols_list %*} \ | |
313 %{Zweak_reference_mismatches*:-weak_reference_mismatches %*} \ | |
314 %{!Zweak_reference_mismatches*:-weak_reference_mismatches non-weak} \ | |
315 %{X} \ | |
316 %{y*} \ | |
317 %{w} \ | |
318 %{pagezero_size*} %{segs_read_*} %{seglinkedit} %{noseglinkedit} \ | |
319 %{sectalign*} %{sectobjectsymbols*} %{segcreate*} %{whyload} \ | |
320 %{whatsloaded} %{dylinker_install_name*} \ | |
321 %{dylinker} %{Mach} " | |
322 | |
323 | |
324 /* Machine dependent libraries. */ | |
325 | |
326 #define LIB_SPEC "%{!static:-lSystem}" | |
327 | |
328 /* Support -mmacosx-version-min by supplying different (stub) libgcc_s.dylib | |
329 libraries to link against, and by not linking against libgcc_s on | |
330 earlier-than-10.3.9. | |
331 | |
332 Note that by default, -lgcc_eh is not linked against! This is | |
333 because in a future version of Darwin the EH frame information may | |
334 be in a new format, or the fallback routine might be changed; if | |
335 you want to explicitly link against the static version of those | |
336 routines, because you know you don't need to unwind through system | |
337 libraries, you need to explicitly say -static-libgcc. | |
338 | |
339 If it is linked against, it has to be before -lgcc, because it may | |
340 need symbols from -lgcc. */ | |
341 #undef REAL_LIBGCC_SPEC | |
342 #define REAL_LIBGCC_SPEC \ | |
343 "%{static-libgcc|static: -lgcc_eh -lgcc; \ | |
344 shared-libgcc|fexceptions|fgnu-runtime: \ | |
345 %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
346 %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
347 %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
348 %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \ |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
349 -lgcc ; \ |
0 | 350 :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \ |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
351 %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
352 %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
353 %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \ |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
354 -lgcc }" |
0 | 355 |
356 /* We specify crt0.o as -lcrt0.o so that ld will search the library path. | |
357 | |
358 crt3.o provides __cxa_atexit on systems that don't have it. Since | |
359 it's only used with C++, which requires passing -shared-libgcc, key | |
360 off that to avoid unnecessarily adding a destructor to every | |
361 powerpc program built. */ | |
362 | |
363 #undef STARTFILE_SPEC | |
364 #define STARTFILE_SPEC \ | |
111 | 365 "%{Zdynamiclib: %(darwin_dylib1) %{fgnu-tm: -lcrttms.o}} \ |
366 %{!Zdynamiclib:%{Zbundle:%{!static: \ | |
367 %:version-compare(< 10.6 mmacosx-version-min= -lbundle1.o) \ | |
368 %{fgnu-tm: -lcrttms.o}}} \ | |
0 | 369 %{!Zbundle:%{pg:%{static:-lgcrt0.o} \ |
370 %{!static:%{object:-lgcrt0.o} \ | |
371 %{!object:%{preload:-lgcrt0.o} \ | |
111 | 372 %{!preload:-lgcrt1.o \ |
373 %:version-compare(>= 10.8 mmacosx-version-min= -no_new_main) \ | |
374 %(darwin_crt2)}}}} \ | |
0 | 375 %{!pg:%{static:-lcrt0.o} \ |
376 %{!static:%{object:-lcrt0.o} \ | |
377 %{!object:%{preload:-lcrt0.o} \ | |
378 %{!preload: %(darwin_crt1) \ | |
379 %(darwin_crt2)}}}}}} \ | |
380 %{shared-libgcc:%:version-compare(< 10.5 mmacosx-version-min= crt3.o%s)}" | |
381 | |
111 | 382 /* We want a destructor last in the list. */ |
383 #define TM_DESTRUCTOR "%{fgnu-tm: -lcrttme.o}" | |
384 #define ENDFILE_SPEC TM_DESTRUCTOR | |
0 | 385 |
386 #define DARWIN_EXTRA_SPECS \ | |
387 { "darwin_crt1", DARWIN_CRT1_SPEC }, \ | |
111 | 388 { "darwin_dylib1", DARWIN_DYLIB1_SPEC }, |
0 | 389 |
390 #define DARWIN_DYLIB1_SPEC \ | |
391 "%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \ | |
111 | 392 %:version-compare(>< 10.5 10.6 mmacosx-version-min= -ldylib1.10.5.o)" |
0 | 393 |
394 #define DARWIN_CRT1_SPEC \ | |
395 "%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o) \ | |
111 | 396 %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lcrt1.10.5.o) \ |
397 %:version-compare(>< 10.6 10.8 mmacosx-version-min= -lcrt1.10.6.o) \ | |
398 %{fgnu-tm: -lcrttms.o}" | |
399 | |
400 #ifdef HAVE_AS_MMACOSX_VERSION_MIN_OPTION | |
401 /* Emit macosx version (but only major). */ | |
402 #define ASM_MMACOSX_VERSION_MIN_SPEC \ | |
403 " %{asm_macosx_version_min=*: -mmacosx-version-min=%*} %<asm_macosx_version_min=*" | |
404 #else | |
405 #define ASM_MMACOSX_VERSION_MIN_SPEC " %<asm_macosx_version_min=*" | |
406 #endif | |
0 | 407 |
111 | 408 /* When we detect that we're cctools or llvm as, we need to insert the right |
409 additional options. */ | |
410 #if HAVE_GNU_AS | |
411 #define ASM_OPTIONS "" | |
412 #else | |
413 #define ASM_OPTIONS "%{v} %{w:-W} %{I*}" | |
414 #endif | |
415 | |
416 /* Default Darwin ASM_SPEC, very simple. */ | |
0 | 417 #define ASM_SPEC "-arch %(darwin_arch) \ |
111 | 418 " ASM_OPTIONS " \ |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
419 %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \ |
111 | 420 %{static}" ASM_MMACOSX_VERSION_MIN_SPEC |
421 | |
422 /* Default ASM_DEBUG_SPEC. Darwin's as cannot currently produce dwarf | |
423 debugging data. */ | |
0 | 424 |
111 | 425 #define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):%{!gdwarf*:--gstabs}}}" |
131 | 426 #define ASM_FINAL_SPEC \ |
427 "%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform } %<gsplit-dwarf" | |
0 | 428 |
111 | 429 /* We still allow output of STABS if the assembler supports it. */ |
430 #ifdef HAVE_AS_STABS_DIRECTIVE | |
0 | 431 #define DBX_DEBUGGING_INFO 1 |
111 | 432 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG |
433 #endif | |
0 | 434 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
435 #define DWARF2_DEBUGGING_INFO 1 |
0 | 436 |
131 | 437 #define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug" |
438 #define DEBUG_INFO_SECTION "__DWARF,__debug_info,regular,debug" | |
439 #define DEBUG_ABBREV_SECTION "__DWARF,__debug_abbrev,regular,debug" | |
440 #define DEBUG_ARANGES_SECTION "__DWARF,__debug_aranges,regular,debug" | |
441 #define DEBUG_MACINFO_SECTION "__DWARF,__debug_macinfo,regular,debug" | |
442 #define DEBUG_LINE_SECTION "__DWARF,__debug_line,regular,debug" | |
443 #define DEBUG_LOC_SECTION "__DWARF,__debug_loc,regular,debug" | |
444 #define DEBUG_LOCLISTS_SECTION "__DWARF,__debug_loclists,regular,debug" | |
445 | |
446 #define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug" | |
447 #define DEBUG_STR_OFFSETS_SECTION "__DWARF,__debug_str_offs,regular,debug" | |
448 #define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug" | |
449 #define DEBUG_RNGLISTS_SECTION "__DWARF,__debug_rnglists,regular,debug" | |
450 #define DEBUG_MACRO_SECTION "__DWARF,__debug_macro,regular,debug" | |
111 | 451 |
452 #define DEBUG_LTO_INFO_SECTION "__GNU_DWARF_LTO,__debug_info,regular,debug" | |
453 #define DEBUG_LTO_ABBREV_SECTION "__GNU_DWARF_LTO,__debug_abbrev,regular,debug" | |
454 #define DEBUG_LTO_MACINFO_SECTION "__GNU_DWARF_LTO,__debug_macinfo,regular,debug" | |
455 #define DEBUG_LTO_LINE_SECTION "__GNU_DWARF_LTO,__debug_line,regular,debug" | |
456 #define DEBUG_LTO_STR_SECTION "__GNU_DWARF_LTO,__debug_str,regular,debug" | |
457 #define DEBUG_LTO_MACRO_SECTION "__GNU_DWARF_LTO,__debug_macro,regular,debug" | |
0 | 458 |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
459 #define TARGET_WANT_DEBUG_PUB_SECTIONS true |
131 | 460 #define DEBUG_PUBNAMES_SECTION ((debug_generate_pub_sections == 2) \ |
461 ? "__DWARF,__debug_gnu_pubn,regular,debug" \ | |
462 : "__DWARF,__debug_pubnames,regular,debug") | |
463 | |
464 #define DEBUG_PUBTYPES_SECTION ((debug_generate_pub_sections == 2) \ | |
465 ? "__DWARF,__debug_gnu_pubt,regular,debug" \ | |
466 : "__DWARF,__debug_pubtypes,regular,debug") | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
467 |
0 | 468 /* When generating stabs debugging, use N_BINCL entries. */ |
469 | |
470 #define DBX_USE_BINCL | |
471 | |
472 /* There is no limit to the length of stabs strings. */ | |
473 | |
474 #define DBX_CONTIN_LENGTH 0 | |
475 | |
476 /* gdb needs a null N_SO at the end of each file for scattered loading. */ | |
477 | |
478 #define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END | |
479 | |
480 /* GCC's definition of 'one_only' is the same as its definition of 'weak'. */ | |
481 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) | |
482 | |
483 /* Mach-O supports 'weak imports', and 'weak definitions' in coalesced | |
484 sections. machopic_select_section ensures that weak variables go in | |
485 coalesced sections. Weak aliases (or any other kind of aliases) are | |
486 not supported. Weak symbols that aren't visible outside the .s file | |
487 are not supported. */ | |
488 #define ASM_WEAKEN_DECL(FILE, DECL, NAME, ALIAS) \ | |
489 do { \ | |
490 if (ALIAS) \ | |
491 { \ | |
492 warning (0, "alias definitions not supported in Mach-O; ignored"); \ | |
493 break; \ | |
494 } \ | |
495 \ | |
496 if (! DECL_EXTERNAL (DECL) && TREE_PUBLIC (DECL)) \ | |
497 targetm.asm_out.globalize_label (FILE, NAME); \ | |
498 if (DECL_EXTERNAL (DECL)) \ | |
499 fputs ("\t.weak_reference ", FILE); \ | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
500 else if (lookup_attribute ("weak_import", DECL_ATTRIBUTES (DECL))) \ |
0 | 501 break; \ |
502 else if (TREE_PUBLIC (DECL)) \ | |
503 fputs ("\t.weak_definition ", FILE); \ | |
504 else \ | |
505 break; \ | |
506 assemble_name (FILE, NAME); \ | |
507 fputc ('\n', FILE); \ | |
508 } while (0) | |
509 | |
510 /* Darwin has the pthread routines in libSystem, which every program | |
511 links to, so there's no need for weak-ness for that. */ | |
512 #define GTHREAD_USE_WEAK 0 | |
513 | |
514 /* The Darwin linker doesn't want coalesced symbols to appear in | |
515 a static archive's table of contents. */ | |
516 #undef TARGET_WEAK_NOT_IN_ARCHIVE_TOC | |
517 #define TARGET_WEAK_NOT_IN_ARCHIVE_TOC 1 | |
518 | |
519 /* On Darwin, we don't (at the time of writing) have linkonce sections | |
520 with names, so it's safe to make the class data not comdat. */ | |
521 #define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_false | |
522 | |
523 /* For efficiency, on Darwin the RTTI information that is always | |
524 emitted in the standard C++ library should not be COMDAT. */ | |
525 #define TARGET_CXX_LIBRARY_RTTI_COMDAT hook_bool_void_false | |
526 | |
527 /* We make exception information linkonce. */ | |
528 #undef TARGET_USES_WEAK_UNWIND_INFO | |
529 #define TARGET_USES_WEAK_UNWIND_INFO 1 | |
530 | |
531 /* We need to use a nonlocal label for the start of an EH frame: the | |
532 Darwin linker requires that a coalesced section start with a label. | |
533 Unfortunately, it also requires that 'debug' sections don't contain | |
534 labels. */ | |
535 #undef FRAME_BEGIN_LABEL | |
536 #define FRAME_BEGIN_LABEL (for_eh ? "EH_frame" : "Lframe") | |
537 | |
538 /* Emit a label for the FDE corresponding to DECL. EMPTY means | |
539 emit a label for an empty FDE. */ | |
540 #define TARGET_ASM_EMIT_UNWIND_LABEL darwin_emit_unwind_label | |
541 | |
542 /* Emit a label to separate the exception table. */ | |
543 #define TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL darwin_emit_except_table_label | |
544 | |
545 /* Our profiling scheme doesn't LP labels and counter words. */ | |
546 | |
547 #define NO_PROFILE_COUNTERS 1 | |
548 | |
549 #undef INIT_SECTION_ASM_OP | |
111 | 550 #define INIT_SECTION_ASM_OP "" |
0 | 551 |
552 #undef INVOKE__main | |
553 | |
554 #define TARGET_ASM_CONSTRUCTOR machopic_asm_out_constructor | |
555 #define TARGET_ASM_DESTRUCTOR machopic_asm_out_destructor | |
556 | |
557 /* Always prefix with an underscore. */ | |
558 | |
559 #define USER_LABEL_PREFIX "_" | |
560 | |
561 /* A dummy symbol that will be replaced with the function base name. */ | |
562 #define MACHOPIC_FUNCTION_BASE_NAME "<pic base>" | |
563 | |
564 /* Don't output a .file directive. That is only used by the assembler for | |
565 error reporting. */ | |
566 #undef TARGET_ASM_FILE_START_FILE_DIRECTIVE | |
567 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE false | |
568 | |
569 #undef TARGET_ASM_FILE_END | |
570 #define TARGET_ASM_FILE_END darwin_file_end | |
571 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
572 /* Because Mach-O relocations have a counter from 1 to 255 for the |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
573 section number they apply to, it is necessary to output all |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
574 normal sections before the LTO sections, to make sure that the |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
575 sections that may have relocations always have a section number |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
576 smaller than 255. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
577 #undef TARGET_ASM_LTO_START |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
578 #define TARGET_ASM_LTO_START darwin_asm_lto_start |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
579 #undef TARGET_ASM_LTO_END |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
580 #define TARGET_ASM_LTO_END darwin_asm_lto_end |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
581 |
0 | 582 #define ASM_OUTPUT_SKIP(FILE,SIZE) \ |
111 | 583 fprintf (FILE, "\t.space " HOST_WIDE_INT_PRINT_UNSIGNED"\n", SIZE) |
0 | 584 |
585 /* Give ObjC methods pretty symbol names. */ | |
586 | |
587 #undef OBJC_GEN_METHOD_LABEL | |
588 #define OBJC_GEN_METHOD_LABEL(BUF,IS_INST,CLASS_NAME,CAT_NAME,SEL_NAME,NUM) \ | |
589 do { if (CAT_NAME) \ | |
590 sprintf (BUF, "%c[%s(%s) %s]", (IS_INST) ? '-' : '+', \ | |
591 (CLASS_NAME), (CAT_NAME), (SEL_NAME)); \ | |
592 else \ | |
593 sprintf (BUF, "%c[%s %s]", (IS_INST) ? '-' : '+', \ | |
594 (CLASS_NAME), (SEL_NAME)); \ | |
595 } while (0) | |
596 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
597 #undef ASM_DECLARE_OBJECT_NAME |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
598 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
599 darwin_asm_declare_object_name ((FILE), (NAME), (DECL)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
600 |
0 | 601 /* The RTTI data (e.g., __ti4name) is common and public (and static), |
602 but it does need to be referenced via indirect PIC data pointers. | |
603 The machopic_define_symbol calls are telling the machopic subsystem | |
604 that the name *is* defined in this module, so it doesn't need to | |
605 make them indirect. */ | |
606 | |
607 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ | |
608 do { \ | |
609 const char *xname = NAME; \ | |
610 if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \ | |
611 xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \ | |
612 if (! DECL_WEAK (DECL) \ | |
613 && ((TREE_STATIC (DECL) \ | |
614 && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ | |
615 || DECL_INITIAL (DECL))) \ | |
616 machopic_define_symbol (DECL_RTL (DECL)); \ | |
617 if ((TREE_STATIC (DECL) \ | |
618 && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ | |
619 || DECL_INITIAL (DECL)) \ | |
620 (* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
621 ASM_OUTPUT_FUNCTION_LABEL (FILE, xname, DECL); \ |
0 | 622 } while (0) |
623 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
624 #undef TARGET_ASM_DECLARE_CONSTANT_NAME |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
625 #define TARGET_ASM_DECLARE_CONSTANT_NAME darwin_asm_declare_constant_name |
0 | 626 |
627 /* Wrap new method names in quotes so the assembler doesn't gag. | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
628 Make Objective-C internal symbols local and in doing this, we need |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
629 to accommodate the name mangling done by c++ on file scope locals. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
630 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
631 int darwin_label_is_anonymous_local_objc_name (const char *name); |
0 | 632 |
633 #undef ASM_OUTPUT_LABELREF | |
634 #define ASM_OUTPUT_LABELREF(FILE,NAME) \ | |
635 do { \ | |
636 const char *xname = (NAME); \ | |
637 if (! strcmp (xname, MACHOPIC_FUNCTION_BASE_NAME)) \ | |
638 machopic_output_function_base_name(FILE); \ | |
639 else if (xname[0] == '&' || xname[0] == '*') \ | |
640 { \ | |
641 int len = strlen (xname); \ | |
642 if (len > 6 && !strcmp ("$stub", xname + len - 5)) \ | |
643 machopic_validate_stub_or_non_lazy_ptr (xname); \ | |
644 else if (len > 7 && !strcmp ("$stub\"", xname + len - 6)) \ | |
645 machopic_validate_stub_or_non_lazy_ptr (xname); \ | |
646 else if (len > 14 && !strcmp ("$non_lazy_ptr", xname + len - 13)) \ | |
647 machopic_validate_stub_or_non_lazy_ptr (xname); \ | |
648 else if (len > 15 && !strcmp ("$non_lazy_ptr\"", xname + len - 14)) \ | |
649 machopic_validate_stub_or_non_lazy_ptr (xname); \ | |
650 if (xname[1] != '"' && name_needs_quotes (&xname[1])) \ | |
651 fprintf (FILE, "\"%s\"", &xname[1]); \ | |
652 else \ | |
653 fputs (&xname[1], FILE); \ | |
654 } \ | |
655 else if (xname[0] == '+' || xname[0] == '-') \ | |
656 fprintf (FILE, "\"%s\"", xname); \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
657 else if (darwin_label_is_anonymous_local_objc_name (xname)) \ |
0 | 658 fprintf (FILE, "L%s", xname); \ |
659 else if (xname[0] != '"' && name_needs_quotes (xname)) \ | |
111 | 660 asm_fprintf (FILE, "\"%U%s\"", xname); \ |
0 | 661 else \ |
662 asm_fprintf (FILE, "%U%s", xname); \ | |
663 } while (0) | |
664 | |
665 /* Output before executable code. */ | |
666 #undef TEXT_SECTION_ASM_OP | |
667 #define TEXT_SECTION_ASM_OP "\t.text" | |
668 | |
669 /* Output before writable data. */ | |
670 | |
671 #undef DATA_SECTION_ASM_OP | |
672 #define DATA_SECTION_ASM_OP "\t.data" | |
673 | |
674 #undef ALIGN_ASM_OP | |
675 #define ALIGN_ASM_OP ".align" | |
676 | |
677 #undef ASM_OUTPUT_ALIGN | |
678 #define ASM_OUTPUT_ALIGN(FILE,LOG) \ | |
679 if ((LOG) != 0) \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
680 fprintf (FILE, "\t%s\t%d\n", ALIGN_ASM_OP, (LOG)) |
0 | 681 |
682 /* The maximum alignment which the object file format can support in | |
683 bits. For Mach-O, this is 2^15 bytes. */ | |
684 | |
685 #undef MAX_OFILE_ALIGNMENT | |
686 #define MAX_OFILE_ALIGNMENT (0x8000 * 8) | |
687 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
688 #define L2_MAX_OFILE_ALIGNMENT 15 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
689 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
690 /* These are the three variants that emit referenced blank space. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
691 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
692 darwin_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
693 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
694 #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
695 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
696 darwin_asm_output_aligned_decl_local \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
697 ((FILE), (DECL), (NAME), (SIZE), (ALIGN)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
698 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
699 #undef ASM_OUTPUT_ALIGNED_DECL_COMMON |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
700 #define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
701 darwin_asm_output_aligned_decl_common \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
702 ((FILE), (DECL), (NAME), (SIZE), (ALIGN)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
703 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
704 /* The generic version, archs should over-ride where required. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
705 #define MACHOPIC_NL_SYMBOL_PTR_SECTION ".non_lazy_symbol_pointer" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
706 |
0 | 707 /* Declare the section variables. */ |
708 #ifndef USED_FOR_TARGET | |
709 enum darwin_section_enum { | |
710 #define DEF_SECTION(NAME, FLAGS, DIRECTIVE, OBJC) NAME, | |
711 #include "darwin-sections.def" | |
712 #undef DEF_SECTION | |
713 NUM_DARWIN_SECTIONS | |
714 }; | |
715 extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS]; | |
716 #endif | |
717 | |
718 #undef TARGET_ASM_SELECT_SECTION | |
719 #define TARGET_ASM_SELECT_SECTION machopic_select_section | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
720 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
721 #undef TARGET_ASM_FUNCTION_SECTION |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
722 #define TARGET_ASM_FUNCTION_SECTION darwin_function_section |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
723 |
0 | 724 #undef TARGET_ASM_SELECT_RTX_SECTION |
725 #define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section | |
726 #undef TARGET_ASM_UNIQUE_SECTION | |
727 #define TARGET_ASM_UNIQUE_SECTION darwin_unique_section | |
728 #undef TARGET_ASM_FUNCTION_RODATA_SECTION | |
729 #define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section | |
111 | 730 |
731 #undef TARGET_ASM_TM_CLONE_TABLE_SECTION | |
732 #define TARGET_ASM_TM_CLONE_TABLE_SECTION darwin_tm_clone_table_section | |
733 | |
0 | 734 #undef TARGET_ASM_RELOC_RW_MASK |
735 #define TARGET_ASM_RELOC_RW_MASK machopic_reloc_rw_mask | |
736 | |
737 /* Globalizing directive for a label. */ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
738 #define GLOBAL_ASM_OP "\t.globl " |
0 | 739 #define TARGET_ASM_GLOBALIZE_LABEL darwin_globalize_label |
740 | |
741 /* Emit an assembler directive to set visibility for a symbol. Used | |
742 to support visibility attribute and Darwin's private extern | |
743 feature. */ | |
744 #undef TARGET_ASM_ASSEMBLE_VISIBILITY | |
745 #define TARGET_ASM_ASSEMBLE_VISIBILITY darwin_assemble_visibility | |
746 | |
747 /* Extra attributes for Darwin. */ | |
748 #define SUBTARGET_ATTRIBUTE_TABLE \ | |
131 | 749 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, \ |
750 affects_type_identity, handler, exclude } */ \ | |
751 { "apple_kext_compatibility", 0, 0, false, true, false, false, \ | |
752 darwin_handle_kext_attribute, NULL }, \ | |
753 { "weak_import", 0, 0, true, false, false, false, \ | |
754 darwin_handle_weak_import_attribute, NULL } | |
0 | 755 |
111 | 756 /* Make local constant labels linker-visible, so that if one follows a |
757 weak_global constant, ld64 will be able to separate the atoms. */ | |
0 | 758 #undef ASM_GENERATE_INTERNAL_LABEL |
759 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ | |
111 | 760 do { \ |
761 if (strcmp ("LC", PREFIX) == 0) \ | |
762 sprintf (LABEL, "*%s%ld", "lC", (long)(NUM)); \ | |
763 else \ | |
764 sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)); \ | |
765 } while (0) | |
0 | 766 |
767 #undef TARGET_ASM_MARK_DECL_PRESERVED | |
768 #define TARGET_ASM_MARK_DECL_PRESERVED darwin_mark_decl_preserved | |
769 | |
770 /* Set on a symbol with SYMBOL_FLAG_FUNCTION or | |
771 MACHO_SYMBOL_FLAG_VARIABLE to indicate that the function or | |
772 variable has been defined in this translation unit. | |
773 When porting Mach-O to new architectures you need to make | |
774 sure these aren't clobbered by the backend. */ | |
775 | |
776 #define MACHO_SYMBOL_FLAG_VARIABLE (SYMBOL_FLAG_MACH_DEP) | |
777 #define MACHO_SYMBOL_FLAG_DEFINED ((SYMBOL_FLAG_MACH_DEP) << 1) | |
778 | |
779 /* Set on a symbol to indicate when fix-and-continue style code | |
780 generation is being used and the symbol refers to a static symbol | |
781 that should be rebound from new instances of a translation unit to | |
782 the original instance of the data. */ | |
783 | |
784 #define MACHO_SYMBOL_STATIC ((SYMBOL_FLAG_MACH_DEP) << 2) | |
785 | |
786 /* Symbolic names for various things we might know about a symbol. */ | |
787 | |
788 enum machopic_addr_class { | |
789 MACHOPIC_UNDEFINED, | |
790 MACHOPIC_DEFINED_DATA, | |
791 MACHOPIC_UNDEFINED_DATA, | |
792 MACHOPIC_DEFINED_FUNCTION, | |
793 MACHOPIC_UNDEFINED_FUNCTION | |
794 }; | |
795 | |
796 /* Macros defining the various PIC cases. */ | |
797 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
798 #undef MACHO_DYNAMIC_NO_PIC_P |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
799 #define MACHO_DYNAMIC_NO_PIC_P (TARGET_MACHO_DYNAMIC_NO_PIC) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
800 #undef MACHOPIC_INDIRECT |
0 | 801 #define MACHOPIC_INDIRECT (flag_pic || MACHO_DYNAMIC_NO_PIC_P) |
802 #define MACHOPIC_JUST_INDIRECT (MACHO_DYNAMIC_NO_PIC_P) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
803 #undef MACHOPIC_PURE |
0 | 804 #define MACHOPIC_PURE (flag_pic && ! MACHO_DYNAMIC_NO_PIC_P) |
805 | |
806 #undef TARGET_ENCODE_SECTION_INFO | |
807 #define TARGET_ENCODE_SECTION_INFO darwin_encode_section_info | |
808 #undef TARGET_STRIP_NAME_ENCODING | |
809 #define TARGET_STRIP_NAME_ENCODING default_strip_name_encoding | |
810 | |
811 #define GEN_BINDER_NAME_FOR_STUB(BUF,STUB,STUB_LENGTH) \ | |
812 do { \ | |
813 const char *const stub_ = (STUB); \ | |
814 char *buffer_ = (BUF); \ | |
815 strcpy (buffer_, stub_); \ | |
816 if (stub_[0] == '"') \ | |
817 { \ | |
818 strcpy (buffer_ + (STUB_LENGTH) - 1, "_binder\""); \ | |
819 } \ | |
820 else \ | |
821 { \ | |
822 strcpy (buffer_ + (STUB_LENGTH), "_binder"); \ | |
823 } \ | |
824 } while (0) | |
825 | |
826 #define GEN_SYMBOL_NAME_FOR_SYMBOL(BUF,SYMBOL,SYMBOL_LENGTH) \ | |
827 do { \ | |
828 const char *const symbol_ = (SYMBOL); \ | |
829 char *buffer_ = (BUF); \ | |
830 if (name_needs_quotes (symbol_) && symbol_[0] != '"') \ | |
831 { \ | |
832 sprintf (buffer_, "\"%s\"", symbol_); \ | |
833 } \ | |
834 else \ | |
835 { \ | |
836 strcpy (buffer_, symbol_); \ | |
837 } \ | |
838 } while (0) | |
839 | |
840 /* Given a symbol name string, create the lazy pointer version | |
841 of the symbol name. */ | |
842 | |
843 #define GEN_LAZY_PTR_NAME_FOR_SYMBOL(BUF,SYMBOL,SYMBOL_LENGTH) \ | |
844 do { \ | |
845 const char *symbol_ = (SYMBOL); \ | |
846 char *buffer_ = (BUF); \ | |
847 if (symbol_[0] == '"') \ | |
848 { \ | |
849 strcpy (buffer_, "\"L"); \ | |
850 strcpy (buffer_ + 2, symbol_ + 1); \ | |
851 strcpy (buffer_ + (SYMBOL_LENGTH), "$lazy_ptr\""); \ | |
852 } \ | |
853 else if (name_needs_quotes (symbol_)) \ | |
854 { \ | |
855 strcpy (buffer_, "\"L"); \ | |
856 strcpy (buffer_ + 2, symbol_); \ | |
857 strcpy (buffer_ + (SYMBOL_LENGTH) + 2, "$lazy_ptr\""); \ | |
858 } \ | |
859 else \ | |
860 { \ | |
861 strcpy (buffer_, "L"); \ | |
862 strcpy (buffer_ + 1, symbol_); \ | |
863 strcpy (buffer_ + (SYMBOL_LENGTH) + 1, "$lazy_ptr"); \ | |
864 } \ | |
865 } while (0) | |
866 | |
867 #define EH_FRAME_SECTION_NAME "__TEXT" | |
868 #define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms+live_support" | |
869 | |
870 #undef ASM_PREFERRED_EH_DATA_FORMAT | |
871 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ | |
872 (((CODE) == 2 && (GLOBAL) == 1) \ | |
873 ? (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4) : \ | |
874 ((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr) | |
875 | |
876 #define ASM_OUTPUT_DWARF_DELTA(FILE,SIZE,LABEL1,LABEL2) \ | |
111 | 877 darwin_asm_output_dwarf_delta (FILE, SIZE, LABEL1, LABEL2, 0) |
0 | 878 |
111 | 879 #define ASM_OUTPUT_DWARF_OFFSET(FILE,SIZE,LABEL,OFFSET,BASE) \ |
880 darwin_asm_output_dwarf_offset (FILE, SIZE, LABEL, OFFSET, BASE) | |
0 | 881 |
882 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(ASM_OUT_FILE, ENCODING, SIZE, ADDR, DONE) \ | |
883 if (ENCODING == ASM_PREFERRED_EH_DATA_FORMAT (2, 1)) { \ | |
884 darwin_non_lazy_pcrel (ASM_OUT_FILE, ADDR); \ | |
885 goto DONE; \ | |
886 } | |
887 | |
888 /* Experimentally, putting jump tables in text is faster on SPEC. | |
889 Also this is needed for correctness for coalesced functions. */ | |
890 | |
891 #ifndef JUMP_TABLES_IN_TEXT_SECTION | |
892 #define JUMP_TABLES_IN_TEXT_SECTION 1 | |
893 #endif | |
894 | |
895 #define TARGET_TERMINATE_DW2_EH_FRAME_INFO false | |
896 | |
897 #define TARGET_ASM_INIT_SECTIONS darwin_init_sections | |
898 #undef TARGET_ASM_NAMED_SECTION | |
899 #define TARGET_ASM_NAMED_SECTION darwin_asm_named_section | |
900 | |
901 #define DARWIN_REGISTER_TARGET_PRAGMAS() \ | |
902 do { \ | |
903 if (!flag_preprocess_only) \ | |
904 cpp_register_pragma (parse_in, NULL, "mark", \ | |
905 darwin_pragma_ignore, false); \ | |
906 c_register_pragma (0, "options", darwin_pragma_options); \ | |
907 c_register_pragma (0, "segment", darwin_pragma_ignore); \ | |
908 c_register_pragma (0, "unused", darwin_pragma_unused); \ | |
909 c_register_pragma (0, "ms_struct", darwin_pragma_ms_struct); \ | |
910 } while (0) | |
911 | |
912 #undef ASM_APP_ON | |
913 #define ASM_APP_ON "" | |
914 #undef ASM_APP_OFF | |
915 #define ASM_APP_OFF "" | |
916 | |
917 void darwin_register_frameworks (const char *, const char *, int); | |
918 void darwin_register_objc_includes (const char *, const char *, int); | |
919 #define TARGET_EXTRA_PRE_INCLUDES darwin_register_objc_includes | |
920 #define TARGET_EXTRA_INCLUDES darwin_register_frameworks | |
921 | |
922 void add_framework_path (char *); | |
923 #define TARGET_OPTF add_framework_path | |
924 | |
925 #define TARGET_POSIX_IO | |
926 | |
927 #define WINT_TYPE "int" | |
928 | |
929 /* Every program on darwin links against libSystem which contains the pthread | |
930 routines, so there's no need to explicitly call out when doing threaded | |
931 work. */ | |
932 | |
933 #undef GOMP_SELF_SPECS | |
934 #define GOMP_SELF_SPECS "" | |
111 | 935 #undef GTM_SELF_SPECS |
936 #define GTM_SELF_SPECS "" | |
0 | 937 |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
938 /* Darwin disables section anchors by default. |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
939 They should be enabled per arch where support exists in that arch. */ |
0 | 940 #define TARGET_ASM_OUTPUT_ANCHOR NULL |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
941 #define DARWIN_SECTION_ANCHORS 0 |
0 | 942 |
111 | 943 #define HAVE_ENABLE_EXECUTE_STACK |
0 | 944 |
945 /* For Apple KEXTs, we make the constructors return this to match gcc | |
946 2.95. */ | |
947 #define TARGET_CXX_CDTOR_RETURNS_THIS (darwin_kextabi_p) | |
948 #define TARGET_KEXTABI flag_apple_kext | |
949 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
950 /* We have target-specific builtins. */ |
111 | 951 #define SUBTARGET_FOLD_BUILTIN darwin_fold_builtin |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
952 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
953 #define TARGET_N_FORMAT_TYPES 1 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
954 #define TARGET_FORMAT_TYPES darwin_additional_format_types |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
955 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
956 #ifndef USED_FOR_TARGET |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
957 extern void darwin_driver_init (unsigned int *,struct cl_decoded_option **); |
0 | 958 #define GCC_DRIVER_HOST_INITIALIZATION \ |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
959 darwin_driver_init (&decoded_options_count, &decoded_options) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
960 #endif |
0 | 961 |
962 /* The Apple assembler and linker do not support constructor priorities. */ | |
963 #undef SUPPORTS_INIT_PRIORITY | |
964 #define SUPPORTS_INIT_PRIORITY 0 | |
965 | |
111 | 966 /* When building cross-compilers (and native crosses) we shall default to |
967 providing an osx-version-min of this unless overridden by the User. | |
968 10.5 is the only version that fully supports all our archs so that's the | |
969 fall-back default. */ | |
970 #define DEF_MIN_OSX_VERSION "10.5" | |
971 | |
972 /* Later versions of ld64 support coalescing weak code/data without requiring | |
973 that they be placed in specially identified sections. This is the earliest | |
974 _tested_ version known to support this so far. */ | |
975 #define MIN_LD64_NO_COAL_SECTS "236.4" | |
976 | |
977 #ifndef LD64_VERSION | |
978 #define LD64_VERSION "85.2" | |
979 #else | |
980 #define DEF_LD64 LD64_VERSION | |
981 #endif | |
982 | |
0 | 983 #endif /* CONFIG_DARWIN_H */ |