Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/i386/cygwin.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
rev | line source |
---|---|
0 | 1 /* Operating system specific defines to be used when targeting GCC for |
2 hosting on Windows32, using a Unix style C library and tools. | |
145 | 3 Copyright (C) 1995-2020 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 #define EXTRA_OS_CPP_BUILTINS() \ |
22 do \ | |
23 { \ | |
24 builtin_define ("__CYGWIN__"); \ | |
25 if (!TARGET_64BIT) \ | |
26 builtin_define ("__CYGWIN32__"); \ | |
27 builtin_define ("__unix__"); \ | |
28 builtin_define ("__unix"); \ | |
29 } \ | |
30 while (0) | |
0 | 31 |
32 #undef CPP_SPEC | |
33 #define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \ | |
111 | 34 %{!ansi:-Dunix} \ |
35 %{pthread:-D_REENTRANT} \ | |
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
|
36 %{mwin32:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}} \ |
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
|
37 %{!nostdinc:%{!mno-win32:-idirafter ../include/w32api%s -idirafter ../../include/w32api%s}}\ |
0 | 38 " |
39 | |
40 #undef STARTFILE_SPEC | |
41 #define STARTFILE_SPEC "\ | |
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
|
42 %{!shared: %{!mdll: crt0%O%s \ |
0 | 43 %{pg:gcrt0%O%s}}}\ |
111 | 44 %{shared:crtbeginS.o%s;:crtbegin.o%s} \ |
45 %{fvtable-verify=none:%s; \ | |
46 fvtable-verify=preinit:vtv_start.o%s; \ | |
47 fvtable-verify=std:vtv_start.o%s}" | |
0 | 48 |
49 #undef ENDFILE_SPEC | |
50 #define ENDFILE_SPEC \ | |
111 | 51 "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}\ |
52 %{!shared:%:if-exists(default-manifest.o%s)}\ | |
53 %{fvtable-verify=none:%s; \ | |
54 fvtable-verify=preinit:vtv_end.o%s; \ | |
55 fvtable-verify=std:vtv_end.o%s} \ | |
0 | 56 crtend.o%s" |
57 | |
58 /* Normally, -lgcc is not needed since everything in it is in the DLL, but we | |
59 want to allow things to be added to it when installing new versions of | |
60 GCC without making a new CYGWIN.DLL, so we leave it. Profiling is handled | |
61 by calling the init function from main. */ | |
62 | |
63 #ifdef ENABLE_SHARED_LIBGCC | |
64 #define SHARED_LIBGCC_SPEC " \ | |
65 %{static|static-libgcc:-lgcc -lgcc_eh} \ | |
66 %{!static: \ | |
67 %{!static-libgcc: \ | |
111 | 68 -lgcc_s -lgcc \ |
0 | 69 } \ |
70 } " | |
71 #else | |
72 #define SHARED_LIBGCC_SPEC " -lgcc " | |
73 #endif | |
74 | |
75 #undef REAL_LIBGCC_SPEC | |
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
|
76 #define REAL_LIBGCC_SPEC SHARED_LIBGCC_SPEC |
0 | 77 |
78 /* We have to dynamic link to get to the system DLLs. All of libc, libm and | |
79 the Unix stuff is in cygwin.dll. The import library is called | |
80 'libcygwin.a'. For Windows applications, include more libraries, but | |
81 always include kernel32. We'd like to specific subsystem windows to | |
82 ld, but that doesn't work just yet. */ | |
83 | |
84 #undef LIB_SPEC | |
85 #define LIB_SPEC "\ | |
86 %{pg:-lgmon} \ | |
111 | 87 %{pthread: } \ |
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
|
88 -lcygwin \ |
0 | 89 %{mwindows:-lgdi32 -lcomdlg32} \ |
111 | 90 %{fvtable-verify=preinit:-lvtv -lpsapi; \ |
91 fvtable-verify=std:-lvtv -lpsapi} \ | |
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
|
92 -ladvapi32 -lshell32 -luser32 -lkernel32" |
0 | 93 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
94 /* To implement C++ function replacement we always wrap the cxx |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
95 malloc-like operators. See N2800 #17.6.4.6 [replacement.functions] */ |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
96 #define CXX_WRAP_SPEC_LIST " \ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
97 --wrap _Znwj \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
98 --wrap _Znaj \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
99 --wrap _ZdlPv \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
100 --wrap _ZdaPv \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
101 --wrap _ZnwjRKSt9nothrow_t \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
102 --wrap _ZnajRKSt9nothrow_t \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
103 --wrap _ZdlPvRKSt9nothrow_t \ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
104 --wrap _ZdaPvRKSt9nothrow_t \ |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
105 " |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
106 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
107 #if defined (USE_CYGWIN_LIBSTDCXX_WRAPPERS) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
108 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
109 #if USE_CYGWIN_LIBSTDCXX_WRAPPERS |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
110 /* Default on, only explict -mno disables. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
111 #define CXX_WRAP_SPEC_OPT "!mno-use-libstdc-wrappers" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
112 #else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
113 /* Default off, only explict -m enables. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
114 #define CXX_WRAP_SPEC_OPT "muse-libstdc-wrappers" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
115 #endif |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
116 |
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
|
117 #define CXX_WRAP_SPEC "%{" CXX_WRAP_SPEC_OPT ":" CXX_WRAP_SPEC_LIST "}" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
118 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
119 #else /* !defined (USE_CYGWIN_LIBSTDCXX_WRAPPERS) */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
120 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
121 #define CXX_WRAP_SPEC "" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
122 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
123 #endif /* ?defined (USE_CYGWIN_LIBSTDCXX_WRAPPERS) */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
124 |
0 | 125 #define LINK_SPEC "\ |
126 %{mwindows:--subsystem windows} \ | |
127 %{mconsole:--subsystem console} \ | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
128 " CXX_WRAP_SPEC " \ |
0 | 129 %{shared: %{mdll: %eshared and mdll are not compatible}} \ |
130 %{shared: --shared} %{mdll:--dll} \ | |
131 %{static:-Bstatic} %{!static:-Bdynamic} \ | |
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
|
132 %{shared|mdll: --enable-auto-image-base -e __cygwin_dll_entry@12} \ |
111 | 133 --dll-search-prefix=cyg \ |
134 %{!shared: %{!mdll: --large-address-aware --tsaware}}" | |
0 | 135 |
136 /* Binutils does not handle weak symbols from dlls correctly. For now, | |
137 do not use them unnecessarily in gthr-posix.h. */ | |
138 #define GTHREAD_USE_WEAK 0 | |
139 | |
140 /* Every program on cygwin links against cygwin1.dll which contains | |
141 the pthread routines. There is no need to explicitly link them | |
111 | 142 and the -pthread flag is accepted only for compatibility. */ |
0 | 143 #undef GOMP_SELF_SPECS |
144 #define GOMP_SELF_SPECS "" | |
111 | 145 #undef GTM_SELF_SPECS |
146 #define GTM_SELF_SPECS "" | |
0 | 147 |
148 /* This matches SHLIB_SONAME and SHLIB_SOVERSION in t-cygwin. */ | |
149 #if DWARF2_UNWIND_INFO | |
150 #define LIBGCC_EH_EXTN "" | |
151 #else | |
152 #define LIBGCC_EH_EXTN "-sjlj" | |
153 #endif | |
154 #define LIBGCC_SONAME "cyggcc_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:
47
diff
changeset
|
155 |
111 | 156 /* Make stack executable to avoid DEP problems with trampolines. */ |
157 #define HAVE_ENABLE_EXECUTE_STACK | |
158 #undef CHECK_EXECUTE_STACK_ENABLED | |
159 #define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable |