xref: /openbsd-src/gnu/usr.bin/gcc/gcc/config/i386/openbsd64.h (revision 49573e758a87660d157bdef3c02e0eda60ad64ec)
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} %{!p:crt0%O%s}} \
48 	crtbegin%O%s} %{shared:crtbeginS%O%s}"
49 #undef ENDFILE_SPEC
50 #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
51 
52 /* Layout of source language data types.  */
53 
54 /* This must agree with <machine/_types.h> */
55 #undef SIZE_TYPE
56 #define SIZE_TYPE "long unsigned int"
57 
58 #undef PTRDIFF_TYPE
59 #define PTRDIFF_TYPE "long int"
60 
61 #undef INTMAX_TYPE
62 #define INTMAX_TYPE "long long int"
63 
64 #undef UINTMAX_TYPE
65 #define UINTMAX_TYPE "long long unsigned int"
66 
67 #undef WCHAR_TYPE
68 #define WCHAR_TYPE "int"
69 
70 #undef WCHAR_TYPE_SIZE
71 #define WCHAR_TYPE_SIZE 32
72 
73 /* Assembler format: overall framework.  */
74 
75 #undef ASM_APP_ON
76 #define ASM_APP_ON "#APP\n"
77 
78 #undef ASM_APP_OFF
79 #define ASM_APP_OFF "#NO_APP\n"
80 
81 #undef SET_ASM_OP
82 #define SET_ASM_OP	"\t.set\t"
83 
84 /* The following macros were originally stolen from i386v4.h.
85    These have to be defined to get PIC code correct.  */
86 
87 /* Assembler format: dispatch tables.  */
88 
89 /* Assembler format: sections.  */
90 
91 /* Stack & calling: aggregate returns.  */
92 
93 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
94    we want to retain compatibility with older gcc versions.  */
95 #define DEFAULT_PCC_STRUCT_RETURN 0
96 
97 /* Assembler format: alignment output.  */
98 
99 /* Stack & calling: profiling.  */
100 
101 /* OpenBSD's profiler recovers all information from the stack pointer.
102    The icky part is not here, but in machine/profile.h.  */
103 #undef FUNCTION_PROFILER
104 #define FUNCTION_PROFILER(FILE, LABELNO)  \
105   fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
106 
107 /* Assembler format: exception region output.  */
108 
109 /* Assembler format: alignment output.  */
110 
111 /* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
112 
113 /* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h.  */
114 
115 #undef LINK_SPEC
116 #define LINK_SPEC \
117   "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
118    %{shared:-shared} %{R*} \
119    %{static:-Bstatic} \
120    %{!static:-Bdynamic} \
121    %{assert*} \
122    %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
123 
124 #define OBSD_HAS_CORRECT_SPECS
125 
126 #undef JUMP_TABLES_IN_TEXT_SECTION
127 #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
128