xref: /openbsd-src/gnu/gcc/gcc/config/i386/openbsd64.h (revision 1107cbef0eaf8f4f0f082368a3652533a380231c)
1 /* Configuration for an OpenBSD x86-64 target.
2 
3    Copyright (C) 2003 Free Software Foundation, Inc.
4 
5 This file is part of GNU CC.
6 
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11 
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21 
22 #undef TARGET_VERSION
23 #define TARGET_VERSION fprintf (stderr, " (OpenBSD/x86-64 ELF)")
24 
25 /* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
26    libraries compiled with the native cc, so undef it. */
27 #undef NO_DOLLAR_IN_LABEL
28 
29 /* Override the default comment-starter of "/".  */
30 #undef ASM_COMMENT_START
31 #define ASM_COMMENT_START "#"
32 
33 /* Run-time target specifications */
34 
35 #define TARGET_OS_CPP_BUILTINS()		\
36   do						\
37     {						\
38     	OPENBSD_OS_CPP_BUILTINS_ELF();		\
39 	if (TARGET_64BIT)			\
40 		OPENBSD_OS_CPP_BUILTINS_LP64();	\
41     }						\
42   while (0)
43 
44 /* As an elf system, we need crtbegin/crtend stuff.  */
45 #undef STARTFILE_SPEC
46 #define STARTFILE_SPEC "\
47 	%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} \
48 	%{!p:%{!static:crt0%O%s} %{static:%{nopie:crt0%O%s} \
49 	%{!nopie:rcrt0%O%s}}}} crtbegin%O%s} %{shared:crtbeginS%O%s}"
50 #undef ENDFILE_SPEC
51 #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
52 
53 /* Layout of source language data types.  */
54 
55 /* This must agree with <machine/_types.h> */
56 #undef SIZE_TYPE
57 #define SIZE_TYPE "long unsigned int"
58 
59 #undef PTRDIFF_TYPE
60 #define PTRDIFF_TYPE "long int"
61 
62 #undef WCHAR_TYPE
63 #define WCHAR_TYPE "int"
64 
65 #undef WCHAR_TYPE_SIZE
66 #define WCHAR_TYPE_SIZE 32
67 
68 #undef INTMAX_TYPE
69 #define INTMAX_TYPE "long long int"
70 
71 #undef UINTMAX_TYPE
72 #define UINTMAX_TYPE "long long unsigned int"
73 
74 /* Assembler format: overall framework.  */
75 
76 #undef ASM_APP_ON
77 #define ASM_APP_ON "#APP\n"
78 
79 #undef ASM_APP_OFF
80 #define ASM_APP_OFF "#NO_APP\n"
81 
82 #undef SET_ASM_OP
83 #define SET_ASM_OP	"\t.set\t"
84 
85 /* The following macros were originally stolen from i386v4.h.
86    These have to be defined to get PIC code correct.  */
87 
88 /* Assembler format: dispatch tables.  */
89 
90 /* Assembler format: sections.  */
91 
92 /* Stack & calling: aggregate returns.  */
93 
94 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
95    we want to retain compatibility with older gcc versions.  */
96 #define DEFAULT_PCC_STRUCT_RETURN 0
97 
98 /* Assembler format: alignment output.  */
99 
100 /* Stack & calling: profiling.  */
101 
102 /* OpenBSD's profiler recovers all information from the stack pointer.
103    The icky part is not here, but in machine/profile.h.  */
104 #undef FUNCTION_PROFILER
105 #define FUNCTION_PROFILER(FILE, LABELNO)  \
106   fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
107 
108 /* Assembler format: exception region output.  */
109 
110 /* Assembler format: alignment output.  */
111 
112 /* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
113 
114 /* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h.  */
115 
116 #undef LINK_SPEC
117 #define LINK_SPEC \
118   "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
119    %{shared:-shared} %{R*} \
120    %{static:-Bstatic} \
121    %{!static:-Bdynamic} \
122    %{rdynamic:-export-dynamic} \
123    %{assert*} \
124    %{!static:%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}} \
125    %{!nostdlib:-L/usr/lib}"
126 
127 #define OBSD_HAS_CORRECT_SPECS
128 
129 #undef JUMP_TABLES_IN_TEXT_SECTION
130 #define JUMP_TABLES_IN_TEXT_SECTION 0
131