68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 /* Definitions for systems using, at least optionally, a GNU
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 (glibc-based) userspace or other userspace with libc derived from
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 glibc (e.g. uClibc) or for which similar specs are appropriate.
|
111
|
4 Copyright (C) 1995-2017 Free Software Foundation, Inc.
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 Contributed by Eric Youngdale.
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org).
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 This file is part of GCC.
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 GCC is free software; you can redistribute it and/or modify
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 it under the terms of the GNU General Public License as published by
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 the Free Software Foundation; either version 3, or (at your option)
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 any later version.
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 GCC is distributed in the hope that it will be useful,
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 GNU General Public License for more details.
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 Under Section 7 of GPL version 3, you are granted additional
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 permissions described in the GCC Runtime Library Exception, version
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 3.1, as published by the Free Software Foundation.
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 You should have received a copy of the GNU General Public License and
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 a copy of the GCC Runtime Library Exception along with this program;
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 <http://www.gnu.org/licenses/>. */
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 /* Don't assume anything about the header files. */
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 #define NO_IMPLICIT_EXTERN_C
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 #undef ASM_APP_ON
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 #define ASM_APP_ON "#APP\n"
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 #undef ASM_APP_OFF
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 #define ASM_APP_OFF "#NO_APP\n"
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37
|
111
|
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
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 /* Provide a STARTFILE_SPEC appropriate for GNU userspace. Here we add
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 the GNU userspace magical crtbegin.o file (see crtstuff.c) which
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 provides part of the support for getting C++ file-scope static
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 object constructed before entering `main'. */
|
111
|
50
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 #if defined HAVE_LD_PIE
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 #define GNU_USER_TARGET_STARTFILE_SPEC \
|
111
|
53 "%{shared:; \
|
|
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
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 #else
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 #define GNU_USER_TARGET_STARTFILE_SPEC \
|
111
|
68 "%{shared:; \
|
|
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
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 #endif
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 #undef STARTFILE_SPEC
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 #define STARTFILE_SPEC GNU_USER_TARGET_STARTFILE_SPEC
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 /* Provide a ENDFILE_SPEC appropriate for GNU userspace. Here we tack on
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 the GNU userspace magical crtend.o file (see crtstuff.c) which
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 provides part of the support for getting C++ file-scope static
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 object constructed before entering `main', followed by a normal
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 GNU userspace "finalizer" file, `crtn.o'. */
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88
|
111
|
89 #if defined HAVE_LD_PIE
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 #define GNU_USER_TARGET_ENDFILE_SPEC \
|
111
|
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
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 #undef ENDFILE_SPEC
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 #define ENDFILE_SPEC GNU_USER_TARGET_ENDFILE_SPEC
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 /* This is for -profile to use -lc_p instead of -lc. */
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 #define GNU_USER_TARGET_CC1_SPEC "%{profile:-p}"
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 #ifndef CC1_SPEC
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 #define CC1_SPEC GNU_USER_TARGET_CC1_SPEC
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 #endif
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 /* The GNU C++ standard library requires that these macros be defined. */
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 #undef CPLUSPLUS_CPP_SPEC
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122
|
111
|
123 #define GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC \
|
|
124 "%{shared:-lc} \
|
|
125 %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
|
|
126
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 #define GNU_USER_TARGET_LIB_SPEC \
|
111
|
128 "%{pthread:-lpthread} " \
|
|
129 GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC
|
|
130
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
131 #undef LIB_SPEC
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
132 #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
133
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 #if defined(HAVE_LD_EH_FRAME_HDR)
|
111
|
135 #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
136 #endif
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
138 #undef LINK_GCC_C_SEQUENCE_SPEC
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
139 #define LINK_GCC_C_SEQUENCE_SPEC \
|
111
|
140 "%{static|static-pie:--start-group} %G %L \
|
|
141 %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}"
|
68
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
142
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
143 /* Use --as-needed -lgcc_s for eh support. */
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 #ifdef HAVE_LD_AS_NEEDED
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 #define USE_LD_AS_NEEDED 1
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 #endif
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147
|
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
148 #define TARGET_POSIX_IO
|
111
|
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
|