Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/gnu-user.h @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | 561a7518be6b |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* Definitions for systems using, at least optionally, a GNU | 1 /* Definitions for systems using, at least optionally, a GNU |
2 (glibc-based) userspace or other userspace with libc derived from | 2 (glibc-based) userspace or other userspace with libc derived from |
3 glibc (e.g. uClibc) or for which similar specs are appropriate. | 3 glibc (e.g. uClibc) or for which similar specs are appropriate. |
4 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006, | 4 Copyright (C) 1995-2017 Free Software Foundation, Inc. |
5 2007, 2009, 2010, 2011 Free Software Foundation, Inc. | |
6 Contributed by Eric Youngdale. | 5 Contributed by Eric Youngdale. |
7 Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org). | 6 Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org). |
8 | 7 |
9 This file is part of GCC. | 8 This file is part of GCC. |
10 | 9 |
34 #define ASM_APP_ON "#APP\n" | 33 #define ASM_APP_ON "#APP\n" |
35 | 34 |
36 #undef ASM_APP_OFF | 35 #undef ASM_APP_OFF |
37 #define ASM_APP_OFF "#NO_APP\n" | 36 #define ASM_APP_OFF "#NO_APP\n" |
38 | 37 |
38 #if ENABLE_OFFLOADING == 1 | |
39 #define CRTOFFLOADBEGIN "%{fopenacc|fopenmp:crtoffloadbegin%O%s}" | |
40 #define CRTOFFLOADEND "%{fopenacc|fopenmp:crtoffloadend%O%s}" | |
41 #else | |
42 #define CRTOFFLOADBEGIN "" | |
43 #define CRTOFFLOADEND "" | |
44 #endif | |
45 | |
39 /* Provide a STARTFILE_SPEC appropriate for GNU userspace. Here we add | 46 /* Provide a STARTFILE_SPEC appropriate for GNU userspace. Here we add |
40 the GNU userspace magical crtbegin.o file (see crtstuff.c) which | 47 the GNU userspace magical crtbegin.o file (see crtstuff.c) which |
41 provides part of the support for getting C++ file-scope static | 48 provides part of the support for getting C++ file-scope static |
42 object constructed before entering `main'. */ | 49 object constructed before entering `main'. */ |
43 | 50 |
44 #if defined HAVE_LD_PIE | 51 #if defined HAVE_LD_PIE |
45 #define GNU_USER_TARGET_STARTFILE_SPEC \ | 52 #define GNU_USER_TARGET_STARTFILE_SPEC \ |
46 "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ | 53 "%{shared:; \ |
47 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" | 54 pg|p|profile:gcrt1.o%s; \ |
55 static:crt1.o%s; \ | |
56 static-pie|" PIE_SPEC ":Scrt1.o%s; \ | |
57 :crt1.o%s} \ | |
58 crti.o%s \ | |
59 %{static:crtbeginT.o%s; \ | |
60 shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \ | |
61 :crtbegin.o%s} \ | |
62 %{fvtable-verify=none:%s; \ | |
63 fvtable-verify=preinit:vtv_start_preinit.o%s; \ | |
64 fvtable-verify=std:vtv_start.o%s} \ | |
65 " CRTOFFLOADBEGIN | |
48 #else | 66 #else |
49 #define GNU_USER_TARGET_STARTFILE_SPEC \ | 67 #define GNU_USER_TARGET_STARTFILE_SPEC \ |
50 "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \ | 68 "%{shared:; \ |
51 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" | 69 pg|p|profile:gcrt1.o%s; \ |
70 :crt1.o%s} \ | |
71 crti.o%s \ | |
72 %{static:crtbeginT.o%s; \ | |
73 shared|pie|static-pie:crtbeginS.o%s; \ | |
74 :crtbegin.o%s} \ | |
75 %{fvtable-verify=none:%s; \ | |
76 fvtable-verify=preinit:vtv_start_preinit.o%s; \ | |
77 fvtable-verify=std:vtv_start.o%s} \ | |
78 " CRTOFFLOADBEGIN | |
52 #endif | 79 #endif |
53 #undef STARTFILE_SPEC | 80 #undef STARTFILE_SPEC |
54 #define STARTFILE_SPEC GNU_USER_TARGET_STARTFILE_SPEC | 81 #define STARTFILE_SPEC GNU_USER_TARGET_STARTFILE_SPEC |
55 | 82 |
56 /* Provide a ENDFILE_SPEC appropriate for GNU userspace. Here we tack on | 83 /* Provide a ENDFILE_SPEC appropriate for GNU userspace. Here we tack on |
57 the GNU userspace magical crtend.o file (see crtstuff.c) which | 84 the GNU userspace magical crtend.o file (see crtstuff.c) which |
58 provides part of the support for getting C++ file-scope static | 85 provides part of the support for getting C++ file-scope static |
59 object constructed before entering `main', followed by a normal | 86 object constructed before entering `main', followed by a normal |
60 GNU userspace "finalizer" file, `crtn.o'. */ | 87 GNU userspace "finalizer" file, `crtn.o'. */ |
61 | 88 |
89 #if defined HAVE_LD_PIE | |
62 #define GNU_USER_TARGET_ENDFILE_SPEC \ | 90 #define GNU_USER_TARGET_ENDFILE_SPEC \ |
63 "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" | 91 "%{fvtable-verify=none:%s; \ |
92 fvtable-verify=preinit:vtv_end_preinit.o%s; \ | |
93 fvtable-verify=std:vtv_end.o%s} \ | |
94 %{static:crtend.o%s; \ | |
95 shared|static-pie|" PIE_SPEC ":crtendS.o%s; \ | |
96 :crtend.o%s} \ | |
97 crtn.o%s \ | |
98 " CRTOFFLOADEND | |
99 #else | |
100 #define GNU_USER_TARGET_ENDFILE_SPEC \ | |
101 "%{fvtable-verify=none:%s; \ | |
102 fvtable-verify=preinit:vtv_end_preinit.o%s; \ | |
103 fvtable-verify=std:vtv_end.o%s} \ | |
104 %{static:crtend.o%s; \ | |
105 shared|pie|static-pie:crtendS.o%s; \ | |
106 :crtend.o%s} \ | |
107 crtn.o%s \ | |
108 " CRTOFFLOADEND | |
109 #endif | |
64 #undef ENDFILE_SPEC | 110 #undef ENDFILE_SPEC |
65 #define ENDFILE_SPEC GNU_USER_TARGET_ENDFILE_SPEC | 111 #define ENDFILE_SPEC GNU_USER_TARGET_ENDFILE_SPEC |
66 | 112 |
67 /* This is for -profile to use -lc_p instead of -lc. */ | 113 /* This is for -profile to use -lc_p instead of -lc. */ |
68 #define GNU_USER_TARGET_CC1_SPEC "%{profile:-p}" | 114 #define GNU_USER_TARGET_CC1_SPEC "%{profile:-p}" |
72 | 118 |
73 /* The GNU C++ standard library requires that these macros be defined. */ | 119 /* The GNU C++ standard library requires that these macros be defined. */ |
74 #undef CPLUSPLUS_CPP_SPEC | 120 #undef CPLUSPLUS_CPP_SPEC |
75 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" | 121 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" |
76 | 122 |
123 #define GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC \ | |
124 "%{shared:-lc} \ | |
125 %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}" | |
126 | |
77 #define GNU_USER_TARGET_LIB_SPEC \ | 127 #define GNU_USER_TARGET_LIB_SPEC \ |
78 "%{pthread:-lpthread} \ | 128 "%{pthread:-lpthread} " \ |
79 %{shared:-lc} \ | 129 GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC |
80 %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}" | 130 |
81 #undef LIB_SPEC | 131 #undef LIB_SPEC |
82 #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC | 132 #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC |
83 | 133 |
84 #if defined(HAVE_LD_EH_FRAME_HDR) | 134 #if defined(HAVE_LD_EH_FRAME_HDR) |
85 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " | 135 #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " |
86 #endif | 136 #endif |
87 | 137 |
88 #undef LINK_GCC_C_SEQUENCE_SPEC | 138 #undef LINK_GCC_C_SEQUENCE_SPEC |
89 #define LINK_GCC_C_SEQUENCE_SPEC \ | 139 #define LINK_GCC_C_SEQUENCE_SPEC \ |
90 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" | 140 "%{static|static-pie:--start-group} %G %L \ |
141 %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" | |
91 | 142 |
92 /* Use --as-needed -lgcc_s for eh support. */ | 143 /* Use --as-needed -lgcc_s for eh support. */ |
93 #ifdef HAVE_LD_AS_NEEDED | 144 #ifdef HAVE_LD_AS_NEEDED |
94 #define USE_LD_AS_NEEDED 1 | 145 #define USE_LD_AS_NEEDED 1 |
95 #endif | 146 #endif |
96 | 147 |
97 #define TARGET_POSIX_IO | 148 #define TARGET_POSIX_IO |
149 | |
150 #undef TARGET_LIBC_HAS_FUNCTION | |
151 #define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function | |
152 | |
153 /* Link -lasan early on the command line. For -static-libasan, don't link | |
154 it for -shared link, the executable should be compiled with -static-libasan | |
155 in that case, and for executable link with --{,no-}whole-archive around | |
156 it to force everything into the executable. And similarly for -ltsan | |
157 and -llsan. */ | |
158 #if defined(HAVE_LD_STATIC_DYNAMIC) | |
159 #undef LIBASAN_EARLY_SPEC | |
160 #define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \ | |
161 "%{static-libasan:%{!shared:" \ | |
162 LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \ | |
163 LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}" | |
164 #undef LIBTSAN_EARLY_SPEC | |
165 #define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \ | |
166 "%{static-libtsan:%{!shared:" \ | |
167 LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \ | |
168 LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}" | |
169 #undef LIBLSAN_EARLY_SPEC | |
170 #define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \ | |
171 "%{static-liblsan:%{!shared:" \ | |
172 LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \ | |
173 LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}" | |
174 #endif |