Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/i386/mingw32.h @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | f6334be47118 |
children | 84e7813d76e9 |
rev | line source |
---|---|
0 | 1 /* Operating system specific defines to be used when targeting GCC for |
2 hosting on Windows32, using GNU tools and the Windows32 API Library. | |
111 | 3 Copyright (C) 1997-2017 Free Software Foundation, Inc. |
0 | 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 | |
111 | 21 #undef DEFAULT_ABI |
22 #define DEFAULT_ABI MS_ABI | |
23 | |
24 /* By default, target has a 80387, uses IEEE compatible arithmetic, | |
25 returns float values in the 387 and needs stack probes. | |
26 We also align doubles to 64-bits for MSVC default compatibility. | |
27 Additionally we enable MS_BITFIELD_LAYOUT by default. */ | |
28 | |
29 #undef TARGET_SUBTARGET_DEFAULT | |
30 #define TARGET_SUBTARGET_DEFAULT \ | |
31 (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS \ | |
32 | MASK_STACK_PROBE | MASK_ALIGN_DOUBLE \ | |
33 | MASK_MS_BITFIELD_LAYOUT) | |
0 | 34 |
35 /* See i386/crtdll.h for an alternative definition. _INTEGRAL_MAX_BITS | |
36 is for compatibility with native compiler. */ | |
37 #define EXTRA_OS_CPP_BUILTINS() \ | |
38 do \ | |
39 { \ | |
40 builtin_define ("__MSVCRT__"); \ | |
41 builtin_define ("__MINGW32__"); \ | |
42 builtin_define ("_WIN32"); \ | |
43 builtin_define_std ("WIN32"); \ | |
44 builtin_define_std ("WINNT"); \ | |
45 builtin_define_with_int_value ("_INTEGRAL_MAX_BITS", \ | |
46 TYPE_PRECISION (intmax_type_node));\ | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
47 if (TARGET_64BIT && ix86_abi == MS_ABI) \ |
0 | 48 { \ |
49 builtin_define ("__MINGW64__"); \ | |
50 builtin_define_std ("WIN64"); \ | |
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
|
51 builtin_define ("_WIN64"); \ |
0 | 52 } \ |
53 } \ | |
54 while (0) | |
55 | |
111 | 56 #ifndef TARGET_USE_PTHREAD_BY_DEFAULT |
57 #define SPEC_PTHREAD1 "pthread" | |
58 #define SPEC_PTHREAD2 "!no-pthread" | |
59 #else | |
60 #define SPEC_PTHREAD1 "!no-pthread" | |
61 #define SPEC_PTHREAD2 "pthread" | |
62 #endif | |
63 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
64 #undef SUB_LINK_ENTRY32 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
65 #undef SUB_LINK_ENTRY64 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
66 #define SUB_LINK_ENTRY32 "-e _DllMainCRTStartup@12" |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
67 #if defined(USE_MINGW64_LEADING_UNDERSCORES) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
68 #define SUB_LINK_ENTRY64 "-e _DllMainCRTStartup" |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
69 #else |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
70 #define SUB_LINK_ENTRY64 "-e DllMainCRTStartup" |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
71 #endif |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
72 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
73 #undef SUB_LINK_ENTRY |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
74 #if TARGET_64BIT_DEFAULT |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
75 #define SUB_LINK_ENTRY SUB_LINK_ENTRY64 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
76 #else |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
77 #define SUB_LINK_ENTRY SUB_LINK_ENTRY32 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
78 #endif |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
79 |
111 | 80 #undef NATIVE_SYSTEM_HEADER_COMPONENT |
81 #define NATIVE_SYSTEM_HEADER_COMPONENT "MINGW" | |
0 | 82 |
83 #undef CPP_SPEC | |
111 | 84 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} " \ |
85 "%{" SPEC_PTHREAD1 ":-D_REENTRANT} " \ | |
86 "%{" SPEC_PTHREAD2 ": } " | |
0 | 87 |
88 /* For Windows applications, include more libraries, but always include | |
89 kernel32. */ | |
90 #undef LIB_SPEC | |
111 | 91 #define LIB_SPEC "%{pg:-lgmon} %{" SPEC_PTHREAD1 ":-lpthread} " \ |
92 "%{" SPEC_PTHREAD2 ": } " \ | |
93 "%{mwindows:-lgdi32 -lcomdlg32} " \ | |
94 "%{fvtable-verify=preinit:-lvtv -lpsapi; \ | |
95 fvtable-verify=std:-lvtv -lpsapi} " \ | |
96 "-ladvapi32 -lshell32 -luser32 -lkernel32" | |
0 | 97 |
98 /* Weak symbols do not get resolved if using a Windows dll import lib. | |
99 Make the unwind registration references strong undefs. */ | |
100 #if DWARF2_UNWIND_INFO | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
101 /* DW2-unwind is just available for 32-bit mode. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
102 #if TARGET_64BIT_DEFAULT |
111 | 103 #define SHARED_LIBGCC_UNDEFS_SPEC \ |
104 "%{m32: %{shared-libgcc: -u ___register_frame_info -u ___deregister_frame_info}}" | |
105 #else | |
0 | 106 #define SHARED_LIBGCC_UNDEFS_SPEC \ |
107 "%{shared-libgcc: -u ___register_frame_info -u ___deregister_frame_info}" | |
111 | 108 #endif |
0 | 109 #else |
110 #define SHARED_LIBGCC_UNDEFS_SPEC "" | |
111 #endif | |
112 | |
113 #undef SUBTARGET_EXTRA_SPECS | |
114 #define SUBTARGET_EXTRA_SPECS \ | |
115 { "shared_libgcc_undefs", SHARED_LIBGCC_UNDEFS_SPEC } | |
116 | |
117 #define LINK_SPEC "%{mwindows:--subsystem windows} \ | |
118 %{mconsole:--subsystem console} \ | |
119 %{shared: %{mdll: %eshared and mdll are not compatible}} \ | |
120 %{shared: --shared} %{mdll:--dll} \ | |
121 %{static:-Bstatic} %{!static:-Bdynamic} \ | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
122 %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \ |
0 | 123 %(shared_libgcc_undefs)" |
124 | |
125 /* Include in the mingw32 libraries with libgcc */ | |
126 #ifdef ENABLE_SHARED_LIBGCC | |
111 | 127 #define SHARED_LIBGCC_SPEC " \ |
128 %{static|static-libgcc:-lgcc -lgcc_eh} \ | |
129 %{!static: \ | |
130 %{!static-libgcc: \ | |
131 %{!shared: \ | |
132 %{!shared-libgcc:-lgcc -lgcc_eh} \ | |
133 %{shared-libgcc:-lgcc_s -lgcc} \ | |
134 } \ | |
135 %{shared:-lgcc_s -lgcc} \ | |
136 } \ | |
137 } " | |
0 | 138 #else |
111 | 139 #define SHARED_LIBGCC_SPEC " -lgcc " |
0 | 140 #endif |
141 #undef REAL_LIBGCC_SPEC | |
142 #define REAL_LIBGCC_SPEC \ | |
143 "%{mthreads:-lmingwthrd} -lmingw32 \ | |
111 | 144 " SHARED_LIBGCC_SPEC " \ |
0 | 145 -lmoldname -lmingwex -lmsvcrt" |
146 | |
147 #undef STARTFILE_SPEC | |
148 #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \ | |
149 %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s} \ | |
111 | 150 crtbegin.o%s \ |
151 %{fvtable-verify=none:%s; \ | |
152 fvtable-verify=preinit:vtv_start.o%s; \ | |
153 fvtable-verify=std:vtv_start.o%s}" | |
0 | 154 |
155 #undef ENDFILE_SPEC | |
156 #define ENDFILE_SPEC \ | |
111 | 157 "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ |
158 %{!shared:%:if-exists(default-manifest.o%s)}\ | |
159 %{fvtable-verify=none:%s; \ | |
160 fvtable-verify=preinit:vtv_end.o%s; \ | |
161 fvtable-verify=std:vtv_end.o%s} \ | |
0 | 162 crtend.o%s" |
163 | |
164 /* Override startfile prefix defaults. */ | |
165 #ifndef STANDARD_STARTFILE_PREFIX_1 | |
166 #define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib/" | |
167 #endif | |
168 #ifndef STANDARD_STARTFILE_PREFIX_2 | |
169 #define STANDARD_STARTFILE_PREFIX_2 "" | |
170 #endif | |
171 | |
111 | 172 /* For native mingw-version we need to take care that NATIVE_SYSTEM_HEADER_DIR |
173 macro contains POSIX-style path. See bug 52947. */ | |
174 #undef NATIVE_SYSTEM_HEADER_DIR | |
175 #define NATIVE_SYSTEM_HEADER_DIR "/mingw/include" | |
176 | |
0 | 177 /* Output STRING, a string representing a filename, to FILE. |
178 We canonicalize it to be in Unix format (backslashes are replaced | |
179 forward slashes. */ | |
180 #undef OUTPUT_QUOTED_STRING | |
181 #define OUTPUT_QUOTED_STRING(FILE, STRING) \ | |
182 do { \ | |
111 | 183 const char *_string = (const char *) (STRING); \ |
0 | 184 char c; \ |
185 \ | |
111 | 186 putc ('\"', (FILE)); \ |
0 | 187 \ |
111 | 188 while ((c = *_string++) != 0) \ |
0 | 189 { \ |
190 if (c == '\\') \ | |
191 c = '/'; \ | |
192 \ | |
193 if (ISPRINT (c)) \ | |
194 { \ | |
195 if (c == '\"') \ | |
111 | 196 putc ('\\', (FILE)); \ |
197 putc (c, (FILE)); \ | |
0 | 198 } \ |
199 else \ | |
111 | 200 fprintf ((FILE), "\\%03o", (unsigned char) c); \ |
0 | 201 } \ |
202 \ | |
111 | 203 putc ('\"', (FILE)); \ |
0 | 204 } while (0) |
205 | |
206 /* Define as short unsigned for compatibility with MS runtime. */ | |
207 #undef WINT_TYPE | |
208 #define WINT_TYPE "short unsigned int" | |
209 | |
210 /* mingw32 uses the -mthreads option to enable thread support. */ | |
211 #undef GOMP_SELF_SPECS | |
111 | 212 #define GOMP_SELF_SPECS "%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): " \ |
213 "-mthreads -pthread}" | |
214 #undef GTM_SELF_SPECS | |
215 #define GTM_SELF_SPECS "%{fgnu-tm:-mthreads -pthread}" | |
0 | 216 |
217 /* mingw32 atexit function is safe to use in shared libraries. Use it | |
218 to register C++ static destructors. */ | |
219 #define TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT hook_bool_void_true | |
220 | |
221 /* Contains a pointer to type target_ovr_attr defining the target specific | |
222 overrides of format attributes. See c-format.h for structure | |
223 definition. */ | |
224 #undef TARGET_OVERRIDES_FORMAT_ATTRIBUTES | |
225 #define TARGET_OVERRIDES_FORMAT_ATTRIBUTES mingw_format_attribute_overrides | |
226 | |
227 /* Specify the count of elements in TARGET_OVERRIDES_ATTRIBUTE. */ | |
228 #undef TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT | |
229 #define TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT 3 | |
230 | |
231 /* Custom initialization for warning -Wpedantic-ms-format for c-format. */ | |
232 #undef TARGET_OVERRIDES_FORMAT_INIT | |
233 #define TARGET_OVERRIDES_FORMAT_INIT msformat_init | |
234 | |
235 /* MS specific format attributes for ms_printf, ms_scanf, ms_strftime. */ | |
236 #undef TARGET_FORMAT_TYPES | |
237 #define TARGET_FORMAT_TYPES mingw_format_attributes | |
238 | |
239 #undef TARGET_N_FORMAT_TYPES | |
240 #define TARGET_N_FORMAT_TYPES 3 | |
241 | |
111 | 242 #define HAVE_ENABLE_EXECUTE_STACK |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
243 #undef CHECK_EXECUTE_STACK_ENABLED |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
244 #define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable |
0 | 245 |
246 /* This matches SHLIB_SONAME and SHLIB_SOVERSION in t-cygming. */ | |
247 /* This matches SHLIB_SONAME and SHLIB_SOVERSION in t-cygwin. */ | |
248 #if DWARF2_UNWIND_INFO | |
249 #define LIBGCC_EH_EXTN "_dw2" | |
250 #else | |
251 #define LIBGCC_EH_EXTN "_sjlj" | |
252 #endif | |
253 #define LIBGCC_SONAME "libgcc_s" LIBGCC_EH_EXTN "-1.dll" | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
254 |