annotate gcc/config/rs6000/linux.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
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /* Definitions of target machine for GNU compiler,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 for PowerPC machines running Linux.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3 Copyright (C) 1996-2020 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 Contributed by Michael Meissner (meissner@cygnus.com).
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 GCC is free software; you can redistribute it and/or modify it
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 under the terms of the GNU General Public License as published
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 by the Free Software Foundation; either version 3, or (at your
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 option) any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 GCC is distributed in the hope that it will be useful, but WITHOUT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 process. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 #define OS_MISSING_POWERPC64 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 /* We use glibc _mcount for profiling. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 #define NO_PROFILE_COUNTERS 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
29 #ifdef SINGLE_LIBC
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
30 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
111
kono
parents: 67
diff changeset
31 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
kono
parents: 67
diff changeset
32 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
kono
parents: 67
diff changeset
33 #undef OPTION_MUSL
kono
parents: 67
diff changeset
34 #define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
35 #else
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
36 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
111
kono
parents: 67
diff changeset
37 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
kono
parents: 67
diff changeset
38 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
kono
parents: 67
diff changeset
39 #undef OPTION_MUSL
kono
parents: 67
diff changeset
40 #define OPTION_MUSL (linux_libc == LIBC_MUSL)
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
41 #endif
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
42
111
kono
parents: 67
diff changeset
43 /* Determine what functions are present at the runtime;
kono
parents: 67
diff changeset
44 this includes full c99 runtime and sincos. */
kono
parents: 67
diff changeset
45 #undef TARGET_LIBC_HAS_FUNCTION
kono
parents: 67
diff changeset
46 #define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 #undef TARGET_OS_CPP_BUILTINS
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
49 #define TARGET_OS_CPP_BUILTINS() \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
50 do \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
51 { \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
52 if (strcmp (rs6000_abi_name, "linux") == 0) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
53 GNU_USER_TARGET_OS_CPP_BUILTINS(); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
54 builtin_define_std ("PPC"); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
55 builtin_define_std ("powerpc"); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
56 builtin_assert ("cpu=powerpc"); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
57 builtin_assert ("machine=powerpc"); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
58 TARGET_OS_SYSV_CPP_BUILTINS (); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
59 } \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 while (0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 #undef CPP_OS_DEFAULT_SPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 #undef LINK_SHLIB_SPEC
111
kono
parents: 67
diff changeset
66 #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \
kono
parents: 67
diff changeset
67 %{static-pie:-static -pie --no-dynamic-linker -z text}"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 #undef LIB_DEFAULT_SPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 #define LIB_DEFAULT_SPEC "%(lib_linux)"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 #undef STARTFILE_DEFAULT_SPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 #define STARTFILE_DEFAULT_SPEC "%(startfile_linux)"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 #undef ENDFILE_DEFAULT_SPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 #define ENDFILE_DEFAULT_SPEC "%(endfile_linux)"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 #undef LINK_START_DEFAULT_SPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 #undef LINK_OS_DEFAULT_SPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83
111
kono
parents: 67
diff changeset
84 #undef DEFAULT_ASM_ENDIAN
kono
parents: 67
diff changeset
85 #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
kono
parents: 67
diff changeset
86 #define DEFAULT_ASM_ENDIAN " -mlittle"
kono
parents: 67
diff changeset
87 #define LINK_OS_LINUX_EMUL ENDIAN_SELECT(" -m elf32ppclinux", \
kono
parents: 67
diff changeset
88 " -m elf32lppclinux", \
kono
parents: 67
diff changeset
89 " -m elf32lppclinux")
kono
parents: 67
diff changeset
90 #else
kono
parents: 67
diff changeset
91 #define DEFAULT_ASM_ENDIAN " -mbig"
kono
parents: 67
diff changeset
92 #define LINK_OS_LINUX_EMUL ENDIAN_SELECT(" -m elf32ppclinux", \
kono
parents: 67
diff changeset
93 " -m elf32lppclinux", \
kono
parents: 67
diff changeset
94 " -m elf32ppclinux")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96
111
kono
parents: 67
diff changeset
97 #undef LINK_OS_LINUX_SPEC
kono
parents: 67
diff changeset
98 #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \
kono
parents: 67
diff changeset
99 %{!static-pie: \
kono
parents: 67
diff changeset
100 %{rdynamic:-export-dynamic} \
kono
parents: 67
diff changeset
101 -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}}"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 /* For backward compatibility, we must continue to use the AIX
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 structure return convention. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 #undef DRAFT_V4_STRUCT_RET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 #define DRAFT_V4_STRUCT_RET 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 /* We are 32-bit all the time, so optimize a little. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 #undef TARGET_64BIT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 #define TARGET_64BIT 0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 /* We don't need to generate entries in .fixup, except when
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 -mrelocatable or -mrelocatable-lib is given. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 #undef RELOCATABLE_NEEDS_FIXUP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 #define RELOCATABLE_NEEDS_FIXUP \
111
kono
parents: 67
diff changeset
116 (rs6000_isa_flags & rs6000_isa_flags_explicit & OPTION_MASK_RELOCATABLE)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
118 #undef RS6000_ABI_NAME
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
119 #define RS6000_ABI_NAME "linux"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
120
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 #ifdef TARGET_LIBC_PROVIDES_SSP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 /* ppc32 glibc provides __stack_chk_guard in -0x7008(2). */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 #define TARGET_THREAD_SSP_OFFSET -0x7008
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 #define POWERPC_LINUX
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 /* ppc linux has 128-bit long double support in glibc 2.4 and later. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 #endif
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
132
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
133 /* Static stack checking is supported by means of probes. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
134 #define STACK_CHECK_STATIC_BUILTIN 1
111
kono
parents: 67
diff changeset
135
kono
parents: 67
diff changeset
136 /* Software floating point support for exceptions and rounding modes
kono
parents: 67
diff changeset
137 depends on the C library in use. */
kono
parents: 67
diff changeset
138 #undef TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P
kono
parents: 67
diff changeset
139 #define TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P \
kono
parents: 67
diff changeset
140 rs6000_linux_float_exceptions_rounding_supported_p
kono
parents: 67
diff changeset
141
kono
parents: 67
diff changeset
142 /* Support for TARGET_ATOMIC_ASSIGN_EXPAND_FENV without FPRs depends
kono
parents: 67
diff changeset
143 on glibc 2.19 or greater. */
kono
parents: 67
diff changeset
144 #if TARGET_GLIBC_MAJOR > 2 \
kono
parents: 67
diff changeset
145 || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 19)
kono
parents: 67
diff changeset
146 #define RS6000_GLIBC_ATOMIC_FENV 1
kono
parents: 67
diff changeset
147 #endif