annotate gcc/config/gnu-user.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /* Definitions for systems using, at least optionally, a GNU
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 (glibc-based) userspace or other userspace with libc derived from
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 glibc (e.g. uClibc) or for which similar specs are appropriate.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
4 Copyright (C) 1995-2020 Free Software Foundation, Inc.
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 Contributed by Eric Youngdale.
561a7518be6b update gcc-4.6
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).
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 This file is part of GCC.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 GCC is free software; you can redistribute it and/or modify
561a7518be6b update gcc-4.6
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
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 the Free Software Foundation; either version 3, or (at your option)
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 any later version.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 GCC is distributed in the hope that it will be useful,
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 GNU General Public License for more details.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 Under Section 7 of GPL version 3, you are granted additional
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 permissions described in the GCC Runtime Library Exception, version
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 3.1, as published by the Free Software Foundation.
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
561a7518be6b update gcc-4.6
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
561a7518be6b update gcc-4.6
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;
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 <http://www.gnu.org/licenses/>. */
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 #undef ASM_APP_ON
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 #define ASM_APP_ON "#APP\n"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 #undef ASM_APP_OFF
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 #define ASM_APP_OFF "#NO_APP\n"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
111
kono
parents: 68
diff changeset
35 #if ENABLE_OFFLOADING == 1
kono
parents: 68
diff changeset
36 #define CRTOFFLOADBEGIN "%{fopenacc|fopenmp:crtoffloadbegin%O%s}"
kono
parents: 68
diff changeset
37 #define CRTOFFLOADEND "%{fopenacc|fopenmp:crtoffloadend%O%s}"
kono
parents: 68
diff changeset
38 #else
kono
parents: 68
diff changeset
39 #define CRTOFFLOADBEGIN ""
kono
parents: 68
diff changeset
40 #define CRTOFFLOADEND ""
kono
parents: 68
diff changeset
41 #endif
kono
parents: 68
diff changeset
42
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
43 #define GNU_USER_TARGET_CRTI "crti.o%s"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
44 #define GNU_USER_TARGET_CRTN "crtn.o%s"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
45
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 /* Provide a STARTFILE_SPEC appropriate for GNU userspace. Here we add
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 the GNU userspace magical crtbegin.o file (see crtstuff.c) which
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 provides part of the support for getting C++ file-scope static
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 object constructed before entering `main'. */
111
kono
parents: 68
diff changeset
50
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 #define GNU_USER_TARGET_STARTFILE_SPEC \
111
kono
parents: 68
diff changeset
52 "%{shared:; \
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
53 pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \
111
kono
parents: 68
diff changeset
54 static:crt1.o%s; \
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
55 static-pie:rcrt1.o%s; \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
56 " PIE_SPEC ":Scrt1.o%s; \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
57 :crt1.o%s} " \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
58 GNU_USER_TARGET_CRTI " \
111
kono
parents: 68
diff changeset
59 %{static:crtbeginT.o%s; \
kono
parents: 68
diff changeset
60 shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \
kono
parents: 68
diff changeset
61 :crtbegin.o%s} \
kono
parents: 68
diff changeset
62 %{fvtable-verify=none:%s; \
kono
parents: 68
diff changeset
63 fvtable-verify=preinit:vtv_start_preinit.o%s; \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
64 fvtable-verify=std:vtv_start.o%s} " \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
65 CRTOFFLOADBEGIN
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 #undef STARTFILE_SPEC
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 #define STARTFILE_SPEC GNU_USER_TARGET_STARTFILE_SPEC
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 /* Provide a ENDFILE_SPEC appropriate for GNU userspace. Here we tack on
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 the GNU userspace magical crtend.o file (see crtstuff.c) which
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 provides part of the support for getting C++ file-scope static
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 object constructed before entering `main', followed by a normal
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 GNU userspace "finalizer" file, `crtn.o'. */
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 #define GNU_USER_TARGET_ENDFILE_SPEC \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
76 "%{!static:%{fvtable-verify=none:%s; \
111
kono
parents: 68
diff changeset
77 fvtable-verify=preinit:vtv_end_preinit.o%s; \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
78 fvtable-verify=std:vtv_end.o%s}} \
111
kono
parents: 68
diff changeset
79 %{static:crtend.o%s; \
kono
parents: 68
diff changeset
80 shared|static-pie|" PIE_SPEC ":crtendS.o%s; \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
81 :crtend.o%s} " \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
82 GNU_USER_TARGET_CRTN " " \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
83 CRTOFFLOADEND
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 #undef ENDFILE_SPEC
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 #define ENDFILE_SPEC GNU_USER_TARGET_ENDFILE_SPEC
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 /* This is for -profile to use -lc_p instead of -lc. */
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 #define GNU_USER_TARGET_CC1_SPEC "%{profile:-p}"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 #ifndef CC1_SPEC
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 #define CC1_SPEC GNU_USER_TARGET_CC1_SPEC
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 #endif
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 /* The GNU C++ standard library requires that these macros be defined. */
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 #undef CPLUSPLUS_CPP_SPEC
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96
111
kono
parents: 68
diff changeset
97 #define GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC \
kono
parents: 68
diff changeset
98 "%{shared:-lc} \
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
99 %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
111
kono
parents: 68
diff changeset
100
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 #define GNU_USER_TARGET_LIB_SPEC \
111
kono
parents: 68
diff changeset
102 "%{pthread:-lpthread} " \
kono
parents: 68
diff changeset
103 GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC
kono
parents: 68
diff changeset
104
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 #undef LIB_SPEC
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 #if defined(HAVE_LD_EH_FRAME_HDR)
111
kono
parents: 68
diff changeset
109 #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 #endif
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
112 #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
113 "%{static|static-pie:--start-group} %G %{!nolibc:%L} \
111
kono
parents: 68
diff changeset
114 %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}"
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
116 #undef LINK_GCC_C_SEQUENCE_SPEC
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
117 #define LINK_GCC_C_SEQUENCE_SPEC GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
118
68
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 /* Use --as-needed -lgcc_s for eh support. */
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 #ifdef HAVE_LD_AS_NEEDED
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 #define USE_LD_AS_NEEDED 1
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 #endif
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123
561a7518be6b update gcc-4.6
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 #define TARGET_POSIX_IO
111
kono
parents: 68
diff changeset
125
kono
parents: 68
diff changeset
126 #undef TARGET_LIBC_HAS_FUNCTION
kono
parents: 68
diff changeset
127 #define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function
kono
parents: 68
diff changeset
128
kono
parents: 68
diff changeset
129 /* Link -lasan early on the command line. For -static-libasan, don't link
kono
parents: 68
diff changeset
130 it for -shared link, the executable should be compiled with -static-libasan
kono
parents: 68
diff changeset
131 in that case, and for executable link with --{,no-}whole-archive around
kono
parents: 68
diff changeset
132 it to force everything into the executable. And similarly for -ltsan
kono
parents: 68
diff changeset
133 and -llsan. */
kono
parents: 68
diff changeset
134 #if defined(HAVE_LD_STATIC_DYNAMIC)
kono
parents: 68
diff changeset
135 #undef LIBASAN_EARLY_SPEC
kono
parents: 68
diff changeset
136 #define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
kono
parents: 68
diff changeset
137 "%{static-libasan:%{!shared:" \
kono
parents: 68
diff changeset
138 LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
kono
parents: 68
diff changeset
139 LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
kono
parents: 68
diff changeset
140 #undef LIBTSAN_EARLY_SPEC
kono
parents: 68
diff changeset
141 #define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
kono
parents: 68
diff changeset
142 "%{static-libtsan:%{!shared:" \
kono
parents: 68
diff changeset
143 LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
kono
parents: 68
diff changeset
144 LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
kono
parents: 68
diff changeset
145 #undef LIBLSAN_EARLY_SPEC
kono
parents: 68
diff changeset
146 #define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \
kono
parents: 68
diff changeset
147 "%{static-liblsan:%{!shared:" \
kono
parents: 68
diff changeset
148 LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
kono
parents: 68
diff changeset
149 LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}"
kono
parents: 68
diff changeset
150 #endif
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
151
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
152 #undef TARGET_F951_OPTIONS
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
153 #define TARGET_F951_OPTIONS "%{!nostdinc:\
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
154 %:fortran-preinclude-file(-fpre-include= math-vector-fortran.h finclude%s/)}"