]>
Commit | Line | Data |
---|---|---|
72f432d4 | 1 | /* Operating system specific defines to be used when targeting GCC for |
2 | hosting on Windows 32/64 via mingw-w64 runtime, using GNU tools and | |
3 | the Windows API Library. | |
fbd26352 | 4 | Copyright (C) 2009-2019 Free Software Foundation, Inc. |
72f432d4 | 5 | |
6 | This file is part of GCC. | |
7 | ||
8 | GCC is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 3, or (at your option) | |
11 | any later version. | |
12 | ||
13 | GCC is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with GCC; see the file COPYING3. If not see | |
20 | <http://www.gnu.org/licenses/>. */ | |
21 | ||
b550f036 | 22 | /* Enable -municode feature and support optional pthread support. */ |
72f432d4 | 23 | |
24 | #undef CPP_SPEC | |
b550f036 | 25 | #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} " \ |
26 | "%{municode:-DUNICODE} " \ | |
8d8f03b6 | 27 | "%{" SPEC_PTHREAD1 ":-D_REENTRANT} " \ |
28 | "%{" SPEC_PTHREAD2 ":-U_REENTRANT} " | |
72f432d4 | 29 | |
30 | #undef STARTFILE_SPEC | |
31 | #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \ | |
32 | %{!shared:%{!mdll:%{!municode:crt2%O%s}}} \ | |
33 | %{!shared:%{!mdll:%{municode:crt2u%O%s}}} \ | |
34 | %{pg:gcrt2%O%s} \ | |
5be42fa9 | 35 | crtbegin.o%s \ |
36 | %{fvtable-verify=none:%s; \ | |
37 | fvtable-verify=preinit:vtv_start.o%s; \ | |
38 | fvtable-verify=std:vtv_start.o%s}" | |
4d63ce54 | 39 | |
4d63ce54 | 40 | /* Enable multilib. */ |
41 | ||
42 | #undef ASM_SPEC | |
570d39ec | 43 | #define ASM_SPEC "%{m32:--32} %{m64:--64}" |
4d63ce54 | 44 | |
b550f036 | 45 | #undef LIB_SPEC |
46 | #define LIB_SPEC "%{pg:-lgmon} %{" SPEC_PTHREAD1 ":-lpthread} " \ | |
47 | "%{" SPEC_PTHREAD2 ": } " \ | |
48 | "%{mwindows:-lgdi32 -lcomdlg32} " \ | |
5be42fa9 | 49 | "%{fvtable-verify=preinit:-lvtv -lpsapi; \ |
50 | fvtable-verify=std:-lvtv -lpsapi} " \ | |
b550f036 | 51 | "-ladvapi32 -lshell32 -luser32 -lkernel32" |
52 | ||
a2beb429 | 53 | #undef SPEC_32 |
54 | #undef SPEC_64 | |
4d63ce54 | 55 | #if TARGET_64BIT_DEFAULT |
56 | #define SPEC_32 "m32" | |
57 | #define SPEC_64 "!m32" | |
58 | #else | |
59 | #define SPEC_32 "!m64" | |
60 | #define SPEC_64 "m64" | |
61 | #endif | |
62 | ||
a2beb429 | 63 | #undef SUB_LINK_ENTRY32 |
64 | #undef SUB_LINK_ENTRY64 | |
65 | #define SUB_LINK_ENTRY32 "-e _DllMainCRTStartup@12" | |
66 | #if defined(USE_MINGW64_LEADING_UNDERSCORES) | |
67 | #define SUB_LINK_ENTRY64 "-e _DllMainCRTStartup" | |
68 | #else | |
69 | #define SUB_LINK_ENTRY64 "-e DllMainCRTStartup" | |
70 | #endif | |
71 | ||
72 | #undef SUB_LINK_SPEC | |
73 | #undef SUB_LINK_ENTRY | |
4d63ce54 | 74 | #define SUB_LINK_SPEC "%{" SPEC_64 ":-m i386pep} %{" SPEC_32 ":-m i386pe}" |
a2beb429 | 75 | #define SUB_LINK_ENTRY "%{" SPEC_64 ":" SUB_LINK_ENTRY64 "} %{" SPEC_32 ":" SUB_LINK_ENTRY32 "}" |
4d63ce54 | 76 | |
a2beb429 | 77 | #undef MULTILIB_DEFAULTS |
4d63ce54 | 78 | #if TARGET_64BIT_DEFAULT |
79 | #define MULTILIB_DEFAULTS { "m64" } | |
80 | #else | |
81 | #define MULTILIB_DEFAULTS { "m32" } | |
82 | #endif | |
83 | ||
ee018eb1 | 84 | #undef LINK_SPEC_LARGE_ADDR_AWARE |
85 | #if MINGW_DEFAULT_LARGE_ADDR_AWARE | |
86 | # define LINK_SPEC_LARGE_ADDR_AWARE \ | |
87 | "%{!shared:%{!mdll:%{" SPEC_32 ":--large-address-aware}}}" | |
88 | #else | |
89 | # define LINK_SPEC_LARGE_ADDR_AWARE "" | |
90 | #endif | |
91 | ||
4d63ce54 | 92 | #undef LINK_SPEC |
a37c5284 | 93 | #define LINK_SPEC SUB_LINK_SPEC " %{mwindows:--subsystem windows} \ |
4d63ce54 | 94 | %{mconsole:--subsystem console} \ |
95 | %{shared: %{mdll: %eshared and mdll are not compatible}} \ | |
96 | %{shared: --shared} %{mdll:--dll} \ | |
97 | %{static:-Bstatic} %{!static:-Bdynamic} \ | |
a2beb429 | 98 | %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \ |
ee018eb1 | 99 | " LINK_SPEC_LARGE_ADDR_AWARE "\ |
4d63ce54 | 100 | %(shared_libgcc_undefs)" |