]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/sparc/linux64.h
stdarg.h: Undo BeOS changes, they break hpux.
[thirdparty/gcc.git] / gcc / config / sparc / linux64.h
CommitLineData
956d6950 1/* Definitions for 64-bit SPARC running Linux-based GNU systems with ELF.
bfe87013
DE
2 Copyright 1996, 1997 Free Software Foundation, Inc.
3 Contributed by David S. Miller (davem@caip.rutgers.edu)
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
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
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
a0a301fc
DE
22/* ??? bi-architecture support will require changes to the linker
23 related specs, among perhaps other things (multilibs). */
24/* #define SPARC_BI_ARCH */
bfe87013 25
a0a301fc 26#define LINUX_DEFAULT_ELF
bfe87013
DE
27
28/* Don't assume anything about the header files. */
29#define NO_IMPLICIT_EXTERN_C
30
31#undef HAVE_ATEXIT
32#define HAVE_ATEXIT
33
34#include <sparc/sysv4.h>
35
36#undef MD_EXEC_PREFIX
37#undef MD_STARTFILE_PREFIX
38
39/* Output at beginning of assembler file. */
40/* The .file command should always begin the output. */
41#undef ASM_FILE_START
42#define ASM_FILE_START(FILE) \
43 do { \
44 output_file_directive (FILE, main_input_filename); \
45 fprintf (FILE, "\t.version\t\"01.01\"\n"); \
46 } while (0)
47
a0a301fc
DE
48#undef ASM_CPU_DEFAULT_SPEC
49#define ASM_CPU_DEFAULT_SPEC "-Av9a"
bfe87013
DE
50
51#undef LIBGCC_SPEC
52#define LIBGCC_SPEC \
53 "%{!shared:-lgcc}"
54
956d6950
JL
55/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
56 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
bfe87013
DE
57 provides part of the support for getting C++ file-scope static
58 object constructed before entering `main'. */
59
60#undef STARTFILE_SPEC
61#define STARTFILE_SPEC \
62 "%{!shared: \
63 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
64 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
65
956d6950
JL
66/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
67 the GNU/Linux magical crtend.o file (see crtstuff.c) which
bfe87013
DE
68 provides part of the support for getting C++ file-scope static
69 object constructed before entering `main', followed by a normal
956d6950 70 GNU/Linux "finalizer" file, `crtn.o'. */
bfe87013
DE
71
72#undef ENDFILE_SPEC
73#define ENDFILE_SPEC \
74 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
75
76#undef TARGET_VERSION
956d6950 77#define TARGET_VERSION fprintf (stderr, " (sparc64 GNU/Linux with ELF)");
bfe87013 78
a0a301fc
DE
79/* A 64 bit v9 compiler with stack-bias,
80 in a Medium/Anywhere code model environment. */
bfe87013
DE
81
82#undef TARGET_DEFAULT
83#define TARGET_DEFAULT \
a0a301fc
DE
84 (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \
85 + MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU)
86
87/* The default code model. */
88#undef SPARC_DEFAULT_CMODEL
89#define SPARC_DEFAULT_CMODEL CM_MEDANY
bfe87013
DE
90
91#undef SIZE_TYPE
92#define SIZE_TYPE "long long unsigned int"
93
94#undef PTRDIFF_TYPE
95#define PTRDIFF_TYPE "long long int"
96
97#undef WCHAR_TYPE
98#define WCHAR_TYPE "long int"
99
100#undef WCHAR_TYPE_SIZE
101#define WCHAR_TYPE_SIZE BITS_PER_WORD
a0a301fc
DE
102
103#undef LONG_DOUBLE_TYPE_SIZE
104#define LONG_DOUBLE_TYPE_SIZE 128
bfe87013
DE
105
106#undef CPP_PREDEFINES
a0a301fc 107#define CPP_PREDEFINES "-D__ELF__ -Dunix -Dsparc -Dlinux -Asystem(unix) -Asystem(posix)"
bfe87013 108
a0a301fc
DE
109#undef CPP_SUBTARGET_SPEC
110#define CPP_SUBTARGET_SPEC "\
bfe87013
DE
111%{fPIC:-D__PIC__ -D__pic__} \
112%{fpic:-D__PIC__ -D__pic__} \
bfe87013
DE
113%{posix:-D_POSIX_SOURCE} \
114"
115/* We no longer link with libc_p.a or libg.a by default. If you
956d6950
JL
116 want to profile or debug the GNU/Linux C library, please add
117 -lc_p or -ggdb to LDFLAGS at the link time, respectively. */
bfe87013
DE
118#undef LIB_SPEC
119#define LIB_SPEC \
120 "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
121 %{!ggdb:-lc} %{ggdb:-lg}}"
122
956d6950 123/* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support
bfe87013
DE
124 for the special GCC options -static and -shared, which allow us to
125 link things in one of these three modes by applying the appropriate
126 combinations of options at link-time. We like to support here for
127 as many of the other GNU linker options as possible. But I don't
128 have the time to search for those flags. I am sure how to add
129 support for -soname shared_object_name. H.J.
130
131 I took out %{v:%{!V:-V}}. It is too much :-(. They can use
132 -Wl,-V.
133
134 When the -shared link option is used a final link is not being
135 done. */
136
137/* If ELF is the default format, we should not use /lib/elf. */
138
139#undef LINK_SPEC
140#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib %{shared:-shared} \
141 %{!shared: \
142 %{!ibcs: \
143 %{!static: \
144 %{rdynamic:-export-dynamic} \
bf2a2c6b 145 %{!dynamic-linker:-dynamic-linker /lib/ld-linux64.so.2}} \
bfe87013
DE
146 %{static:-static}}} \
147%{mlittle-endian:-EL} \
148"
149
150/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
151 It's safe to pass -s always, even if -g is not used. */
152#undef ASM_SPEC
153#define ASM_SPEC "\
154%{V} \
155%{v:%{!V:-V}} \
156%{!Qn:-Qy} \
157%{n} \
158%{T} \
159%{Ym,*} \
160%{Wa,*:%*} \
161-s %{fpic:-K PIC} %{fPIC:-K PIC} \
162%{mlittle-endian:-EL} \
a0a301fc 163%(asm_cpu) %(asm_arch) \
bfe87013
DE
164"
165
166/* Same as sparc.h */
167#undef DBX_REGISTER_NUMBER
168#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
169
170/* System V Release 4 uses DWARF debugging info. Buf DWARF1 doesn't do
171 64-bit anything, so we use DWARF2. */
172
173#undef DWARF2_DEBUGGING_INFO
174#undef DWARF_DEBUGGING_INFO
175#undef DBX_DEBUGGING_INFO
176#define DWARF2_DEBUGGING_INFO
177#define DBX_DEBUGGING_INFO
178
179#undef PREFERRED_DEBUGGING_TYPE
180#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
181
182#undef ASM_OUTPUT_ALIGNED_LOCAL
183#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
184do { \
185 fputs ("\t.local\t", (FILE)); \
186 assemble_name ((FILE), (NAME)); \
187 putc ('\n', (FILE)); \
188 ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
189} while (0)
190
191#undef COMMON_ASM_OP
192#define COMMON_ASM_OP "\t.common"
193
194/* This is how to output a definition of an internal numbered label where
195 PREFIX is the class of label and NUM is the number within the class. */
196
197#undef ASM_OUTPUT_INTERNAL_LABEL
198#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
199 fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
200
201/* This is how to output a reference to an internal numbered label where
202 PREFIX is the class of label and NUM is the number within the class. */
203
204#undef ASM_OUTPUT_INTERNAL_LABELREF
205#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \
206 fprintf (FILE, ".L%s%d", PREFIX, NUM)
207
208/* This is how to store into the string LABEL
209 the symbol_ref name of an internal numbered label where
210 PREFIX is the class of label and NUM is the number within the class.
211 This is suitable for output with `assemble_name'. */
212
213#undef ASM_GENERATE_INTERNAL_LABEL
214#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
215 sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
216
217/* Stabs doesn't use this, and it confuses a simulator. */
218/* ??? Need to see what DWARF needs, if anything. */
219#undef ASM_IDENTIFY_GCC
220#define ASM_IDENTIFY_GCC(FILE)
221
222/* Define the names of various pseudo-ops used by the Sparc/svr4 assembler.
223 ??? If ints are 64 bits then UNALIGNED_INT_ASM_OP (defined elsewhere) is
224 misnamed. These should all refer to explicit sizes (half/word/xword?),
225 anything other than short/int/long/etc. */
226
227#define UNALIGNED_DOUBLE_INT_ASM_OP ".uaxword"
228
229/* DWARF bits. */
230
231/* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets.
232 Obviously the Dwarf2 folks havn't tried to actually build systems
233 with their spec. On a 64-bit system, only 64-bit relocs become
234 RELATIVE relocations. */
235
236/* #define DWARF_OFFSET_SIZE PTR_SIZE */