]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/sparc/linux.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / sparc / linux.h
CommitLineData
956d6950 1/* Definitions for SPARC running Linux-based GNU systems with ELF.
8d9254fc 2 Copyright (C) 1996-2020 Free Software Foundation, Inc.
1583720a
DE
3 Contributed by Eddie C. Dost (ecd@skynet.be)
4
de0a398e 5This file is part of GCC.
1583720a 6
de0a398e 7GCC is free software; you can redistribute it and/or modify
1583720a 8it under the terms of the GNU General Public License as published by
2f83c7d6 9the Free Software Foundation; either version 3, or (at your option)
1583720a
DE
10any later version.
11
de0a398e 12GCC is distributed in the hope that it will be useful,
1583720a
DE
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
2f83c7d6
NC
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
1583720a 20
9b8466f4
NB
21#define TARGET_OS_CPP_BUILTINS() \
22 do \
23 { \
107fd1c1 24 GNU_USER_TARGET_OS_CPP_BUILTINS(); \
fbf2ca7b
JJ
25 if (TARGET_LONG_DOUBLE_128) \
26 builtin_define ("__LONG_DOUBLE_128__"); \
9b8466f4
NB
27 } \
28 while (0)
29
956d6950
JL
30/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
31 the GNU/Linux magical crtend.o file (see crtstuff.c) which
1583720a
DE
32 provides part of the support for getting C++ file-scope static
33 object constructed before entering `main', followed by a normal
956d6950 34 GNU/Linux "finalizer" file, `crtn.o'. */
1583720a
DE
35
36#undef ENDFILE_SPEC
37#define ENDFILE_SPEC \
5f7ca34b 38 "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
0691dde9 39 %{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
1583720a 40
0913b2d6
DM
41/* -mcpu=native handling only makes sense with compiler running on
42 a SPARC chip. */
a0bd60d1 43#if defined(__sparc__) && defined(__linux__)
0913b2d6
DM
44extern const char *host_detect_local_cpu (int argc, const char **argv);
45# define EXTRA_SPEC_FUNCTIONS \
46 { "local_cpu_detect", host_detect_local_cpu },
47
48# define MCPU_MTUNE_NATIVE_SPECS \
49 " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \
50 " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
51#else
52# define MCPU_MTUNE_NATIVE_SPECS ""
53#endif
54
55#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
56
34c5627c
EB
57#undef ASAN_CC1_SPEC
58#define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
59
60#undef CC1_SPEC
61#define CC1_SPEC GNU_USER_TARGET_CC1_SPEC ASAN_CC1_SPEC
985c5e5b 62
1583720a
DE
63#undef SIZE_TYPE
64#define SIZE_TYPE "unsigned int"
65
66#undef PTRDIFF_TYPE
67#define PTRDIFF_TYPE "int"
68
69#undef WCHAR_TYPE
247cfc5c 70#define WCHAR_TYPE "int"
1583720a
DE
71
72#undef WCHAR_TYPE_SIZE
247cfc5c
JJ
73#define WCHAR_TYPE_SIZE 32
74
a0a301fc 75#undef CPP_SUBTARGET_SPEC
a0a301fc 76#define CPP_SUBTARGET_SPEC \
fbf2ca7b 77"%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
1583720a 78
956d6950 79/* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support
1583720a
DE
80 for the special GCC options -static and -shared, which allow us to
81 link things in one of these three modes by applying the appropriate
83c2a9ef 82 combinations of options at link-time.
1583720a
DE
83
84 When the -shared link option is used a final link is not being
85 done. */
86
7bd85ce0 87#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
7bd85ce0 88
1583720a 89#undef LINK_SPEC
36e0c0a5 90#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
e95b1e6a 91 %{!mno-relax:%{!r:-relax}} \
985c5e5b 92 %{!shared: \
dabadc52
JM
93 %{!static: \
94 %{rdynamic:-export-dynamic} \
107fd1c1 95 -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
dabadc52 96 %{static:-static}}"
1583720a 97
12eb1a9c 98/* It's safe to pass -s always, even if -g is not used. */
1583720a 99#undef ASM_SPEC
1141be7e 100#define ASM_SPEC "\
1141be7e 101-s \
428b3812 102%{" FPIE_OR_FPIC_SPEC ":-K PIC} \
40ea67af 103%{!.c:%{findirect-dispatch:-K PIC}} \
1141be7e 104%(asm_cpu) %(asm_relax)"
1583720a 105
1583720a
DE
106#undef ASM_OUTPUT_ALIGNED_LOCAL
107#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
108do { \
109 fputs ("\t.local\t", (FILE)); \
110 assemble_name ((FILE), (NAME)); \
111 putc ('\n', (FILE)); \
112 ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
113} while (0)
114
115#undef COMMON_ASM_OP
471b6f1b 116#define COMMON_ASM_OP "\t.common\t"
1583720a 117
59f96879
RH
118#undef LOCAL_LABEL_PREFIX
119#define LOCAL_LABEL_PREFIX "."
120
1583720a 121\f
ba31d94e 122/* Define for support of TFmode long double.
56149abc 123 SPARC ABI says that long double is 4 words. */
4710d3eb
JJ
124#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
125
45dcc026
JJ
126#undef DITF_CONVERSION_LIBFUNCS
127#define DITF_CONVERSION_LIBFUNCS 1
f7e0e539 128\f
5751a10b
JJ
129#ifdef HAVE_AS_TLS
130#undef TARGET_SUN_TLS
131#undef TARGET_GNU_TLS
132#define TARGET_SUN_TLS 0
133#define TARGET_GNU_TLS 1
134#endif
135\f
7a31a340
DM
136/* We use GNU ld so undefine this so that attribute((init_priority)) works. */
137#undef CTORS_SECTION_ASM_OP
138#undef DTORS_SECTION_ASM_OP
db430d26 139
260c8ba3
EB
140/* Static stack checking is supported by means of probes. */
141#define STACK_CHECK_STATIC_BUILTIN 1
142
5e77eb53
EB
143#undef NEED_INDICATE_EXEC_STACK
144#define NEED_INDICATE_EXEC_STACK 1
8ec11fe9
JJ
145
146#ifdef TARGET_LIBC_PROVIDES_SSP
147/* sparc glibc provides __stack_chk_guard in [%g7 + 0x14]. */
148#define TARGET_THREAD_SSP_OFFSET 0x14
149#endif
7269aee7
AH
150
151/* Define if long doubles should be mangled as 'g'. */
152#define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
cc44abe6
DM
153
154/* We use glibc _mcount for profiling. */
b61eacd6 155#undef NO_PROFILE_COUNTERS
cc44abe6 156#define NO_PROFILE_COUNTERS 1