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