]>
Commit | Line | Data |
---|---|---|
c714f03d RH |
1 | /* Definitions of target machine for GNU compiler, |
2 | for Alpha Linux-based GNU systems. | |
a945c346 | 3 | Copyright (C) 1996-2024 Free Software Foundation, Inc. |
c714f03d | 4 | Contributed by Richard Henderson. |
ff352cea | 5 | |
7ec022b2 | 6 | This file is part of GCC. |
ff352cea | 7 | |
7ec022b2 | 8 | GCC is free software; you can redistribute it and/or modify |
ff352cea | 9 | it under the terms of the GNU General Public License as published by |
2f83c7d6 | 10 | the Free Software Foundation; either version 3, or (at your option) |
ff352cea RK |
11 | any later version. |
12 | ||
7ec022b2 | 13 | GCC is distributed in the hope that it will be useful, |
ff352cea RK |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
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/>. */ | |
ff352cea | 21 | |
12a41c22 NB |
22 | #define TARGET_OS_CPP_BUILTINS() \ |
23 | do { \ | |
24 | builtin_define ("__gnu_linux__"); \ | |
25 | builtin_define ("_LONGLONG"); \ | |
26 | builtin_define_std ("linux"); \ | |
27 | builtin_define_std ("unix"); \ | |
28 | builtin_assert ("system=linux"); \ | |
26b0ad13 KG |
29 | builtin_assert ("system=unix"); \ |
30 | builtin_assert ("system=posix"); \ | |
e0322d5c | 31 | /* The GNU C++ standard library requires this. */ \ |
04df6730 | 32 | if (c_dialect_cxx ()) \ |
e0322d5c | 33 | builtin_define ("_GNU_SOURCE"); \ |
12a41c22 | 34 | } while (0) |
ff352cea RK |
35 | |
36 | #undef LIB_SPEC | |
dbe0297b | 37 | #define LIB_SPEC \ |
17772b2a JJ |
38 | "%{pthread:-lpthread} \ |
39 | %{shared:-lc} \ | |
40 | %{!shared: %{profile:-lc_p}%{!profile:-lc}}" | |
ff352cea | 41 | |
f326fd7a | 42 | #undef CPP_SPEC |
bdede2ac MK |
43 | #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" |
44 | ||
ff352cea | 45 | /* Show that we need a GP when profiling. */ |
4f1c5cce | 46 | #undef TARGET_PROFILING_NEEDS_GP |
9c0e94a5 RH |
47 | #define TARGET_PROFILING_NEEDS_GP 1 |
48 | ||
49 | /* Don't care about faults in the prologue. */ | |
50 | #undef TARGET_CAN_FAULT_IN_PROLOGUE | |
51 | #define TARGET_CAN_FAULT_IN_PROLOGUE 1 | |
4ed442c9 | 52 | |
14291bc7 RH |
53 | /* OS fixes up EV5 data fault on prefetch. */ |
54 | #undef TARGET_FIXUP_EV5_PREFETCH | |
55 | #define TARGET_FIXUP_EV5_PREFETCH 1 | |
56 | ||
4ed442c9 BK |
57 | #undef WCHAR_TYPE |
58 | #define WCHAR_TYPE "int" | |
377b6fce | 59 | |
b5a54c03 | 60 | #ifdef SINGLE_LIBC |
2c31a8be JJ |
61 | #define OPTION_GLIBC_P(opts) (DEFAULT_LIBC == LIBC_GLIBC) |
62 | #define OPTION_UCLIBC_P(opts) (DEFAULT_LIBC == LIBC_UCLIBC) | |
63 | #define OPTION_BIONIC_P(opts) (DEFAULT_LIBC == LIBC_BIONIC) | |
64 | #undef OPTION_MUSL_P | |
65 | #define OPTION_MUSL_P(opts) (DEFAULT_LIBC == LIBC_MUSL) | |
b5a54c03 | 66 | #else |
2c31a8be JJ |
67 | #define OPTION_GLIBC_P(opts) ((opts)->x_linux_libc == LIBC_GLIBC) |
68 | #define OPTION_UCLIBC_P(opts) ((opts)->x_linux_libc == LIBC_UCLIBC) | |
69 | #define OPTION_BIONIC_P(opts) ((opts)->x_linux_libc == LIBC_BIONIC) | |
70 | #undef OPTION_MUSL_P | |
71 | #define OPTION_MUSL_P(opts) ((opts)->x_linux_libc == LIBC_MUSL) | |
b5a54c03 | 72 | #endif |
2c31a8be JJ |
73 | #define OPTION_GLIBC OPTION_GLIBC_P (&global_options) |
74 | #define OPTION_UCLIBC OPTION_UCLIBC_P (&global_options) | |
75 | #define OPTION_BIONIC OPTION_BIONIC_P (&global_options) | |
76 | #undef OPTION_MUSL | |
77 | #define OPTION_MUSL OPTION_MUSL_P (&global_options) | |
47089d42 | 78 | |
d33d9e47 AI |
79 | /* Determine what functions are present at the runtime; |
80 | this includes full c99 runtime and sincos. */ | |
81 | #undef TARGET_LIBC_HAS_FUNCTION | |
1e9da8f6 | 82 | #define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function |
006339cd | 83 | |
4969c0d8 | 84 | #define TARGET_POSIX_IO |
90b8be73 | 85 | |
4f9eae9f MR |
86 | /* Provide a STARTFILE_SPEC appropriate for ELF. Here we add the |
87 | (even more) magical crtbegin.o file which provides part of the | |
88 | support for getting C++ file-scope static object constructed | |
89 | before entering `main'. */ | |
90 | ||
91 | #undef STARTFILE_SPEC | |
92 | #ifdef HAVE_LD_PIE | |
93 | #define STARTFILE_SPEC \ | |
94 | "%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\ | |
95 | crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" | |
96 | #else | |
97 | #define STARTFILE_SPEC \ | |
98 | "%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\ | |
99 | crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" | |
100 | #endif | |
101 | ||
102 | /* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the | |
103 | magical crtend.o file which provides part of the support for | |
104 | getting C++ file-scope static object constructed before entering | |
105 | `main', followed by a normal ELF "finalizer" file, `crtn.o'. */ | |
106 | ||
107 | #undef ENDFILE_SPEC | |
108 | #define ENDFILE_SPEC \ | |
31949fba | 109 | "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}} \ |
4f9eae9f MR |
110 | %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" |
111 | ||
42df2193 | 112 | #define LINK_GCC_C_SEQUENCE_SPEC \ |
f37866e8 | 113 | "%{static|static-pie:--start-group} %G %{!nolibc:%L} \ |
8c6562e1 | 114 | %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" |
42df2193 | 115 | |
8efcd34f AM |
116 | /* Use --as-needed -lgcc_s for eh support. */ |
117 | #ifdef HAVE_LD_AS_NEEDED | |
118 | #define USE_LD_AS_NEEDED 1 | |
119 | #endif | |
120 | ||
7269aee7 AH |
121 | /* Define if long doubles should be mangled as 'g'. */ |
122 | #define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING | |
d94a427e AL |
123 | |
124 | /* -mcpu=native handling only makes sense with compiler running on | |
125 | an Alpha chip. */ | |
126 | #if defined(__alpha__) || defined(__alpha) | |
127 | extern const char *host_detect_local_cpu (int argc, const char **argv); | |
128 | # define EXTRA_SPEC_FUNCTIONS \ | |
129 | { "local_cpu_detect", host_detect_local_cpu }, | |
130 | ||
131 | # define MCPU_MTUNE_NATIVE_SPECS \ | |
132 | " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \ | |
133 | " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" | |
134 | #else | |
135 | # define MCPU_MTUNE_NATIVE_SPECS "" | |
136 | #endif | |
137 | ||
138 | #define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS |