xref: /openbsd-src/gnu/gcc/gcc/config/sparc/openbsd64.h (revision 5e90ddee5841df9dec448ef72efd792dc9ce537c)
1 /* Configuration file for sparc64 OpenBSD target.
2    Copyright (C) 1999, 2005 Free Software Foundation, Inc.
3 
4 This file is part of GCC.
5 
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10 
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.  */
20 
21 #undef TARGET_VERSION
22 #define TARGET_VERSION fprintf (stderr, " (sparc64 OpenBSD ELF)")
23 
24 /* XXX - do we really want HARD_QUAD? */
25 #undef TARGET_DEFAULT
26 #define TARGET_DEFAULT \
27 (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \
28  + MASK_APP_REGS + MASK_FPU + MASK_STACK_BIAS + MASK_LONG_DOUBLE_128)
29 
30 #undef SPARC_DEFAULT_CMODEL
31 #define SPARC_DEFAULT_CMODEL CM_MEDMID
32 
33 /* Target OS builtins.  */
34 #define TARGET_OS_CPP_BUILTINS()		\
35   do						\
36     {						\
37 	OPENBSD_OS_CPP_BUILTINS();		\
38 	builtin_define ("__sparc64__");		\
39 	builtin_define ("__sparcv9__");		\
40 	builtin_define ("__sparc_v9__");	\
41 	builtin_define ("__arch64__");		\
42     }						\
43   while (0)
44 
45 #undef CPP_SUBTARGET_SPEC
46 #define CPP_SUBTARGET_SPEC ""
47 
48 #undef MD_EXEC_PREFIX
49 #undef MD_STARTFILE_PREFIX
50 
51 #undef ASM_SPEC
52 #ifdef PIE_DEFAULT
53 #define ASM_SPEC "\
54 %{v:-V} -s %{fpic|fPIC:-K PIC} %{!fno-pie: %{!p: %{!pg: -K PIC}}} \
55 %{mlittle-endian:-EL} \
56 %(asm_cpu) %(asm_arch) \
57 "
58 #else
59 #define ASM_SPEC "\
60 %{v:-V} -s %{fpic|fPIC|fpie|fPIE:-K PIC} \
61 %{mlittle-endian:-EL} \
62 %(asm_cpu) %(asm_arch) \
63 "
64 #endif
65 
66 /* Layout of source language data types.  */
67 #undef WCHAR_TYPE
68 #define WCHAR_TYPE "int"
69 
70 #undef WCHAR_TYPE_SIZE
71 #define WCHAR_TYPE_SIZE 32
72 
73 #undef WINT_TYPE
74 #define WINT_TYPE "int"
75 
76 #undef INTMAX_TYPE
77 #define INTMAX_TYPE "long long int"
78 
79 #undef UINTMAX_TYPE
80 #define UINTMAX_TYPE "long long unsigned int"
81 
82 #undef LONG_DOUBLE_TYPE_SIZE
83 #define LONG_DOUBLE_TYPE_SIZE 128
84 
85 #undef JUMP_TABLES_DEFAULT
86 #define JUMP_TABLES_DEFAULT 0	/* incompatible with --executable-text */
87 
88 #undef LINK_SPEC
89 #define LINK_SPEC \
90   "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
91    %{shared:-shared} %{R*} \
92    %{static:-Bstatic} \
93    %{!static:-Bdynamic} \
94    %{rdynamic:-export-dynamic} \
95    %{assert*} \
96    %{!static:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}}"
97 
98 /* As an elf system, we need crtbegin/crtend stuff.  */
99 #undef STARTFILE_SPEC
100 #define STARTFILE_SPEC "\
101 	%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} \
102 	%{!p:%{!static:crt0%O%s} %{static:%{nopie:crt0%O%s} \
103 	%{!nopie:rcrt0%O%s}}}} crtbegin%O%s} %{shared:crtbeginS%O%s}"
104 #undef ENDFILE_SPEC
105 #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
106 
107 /* We use GNU ld so undefine this so that attribute((init_priority)) works.  */
108 #undef CTORS_SECTION_ASM_OP
109 #undef DTORS_SECTION_ASM_OP
110