xref: /NextBSD/contrib/gcc/config/i386/openbsd.h (revision eb1a5f8de9f7ea602c373a710f531abbf81141c4)
1 /* Configuration for an OpenBSD i386 target.
2    Copyright (C) 1999, 2000, 2002, 2004 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 
22 #define TARGET_VERSION fprintf (stderr, " (OpenBSD/i386)");
23 
24 /* This goes away when the math-emulator is fixed */
25 #undef TARGET_SUBTARGET_DEFAULT
26 #define TARGET_SUBTARGET_DEFAULT \
27   (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
28 
29 #define TARGET_OS_CPP_BUILTINS()		\
30   do						\
31     {						\
32 	builtin_define ("__unix__");		\
33 	builtin_define ("__OpenBSD__");		\
34 	builtin_assert ("system=unix");		\
35 	builtin_assert ("system=bsd");		\
36 	builtin_assert ("system=OpenBSD");	\
37     }						\
38   while (0)
39 
40 /* Layout of source language data types.  */
41 
42 /* This must agree with <machine/ansi.h> */
43 #undef SIZE_TYPE
44 #define SIZE_TYPE "unsigned int"
45 
46 #undef PTRDIFF_TYPE
47 #define PTRDIFF_TYPE "int"
48 
49 #undef WCHAR_TYPE
50 #define WCHAR_TYPE "int"
51 
52 #undef WCHAR_TYPE_SIZE
53 #define WCHAR_TYPE_SIZE 32
54 
55 /* Assembler format: overall framework.  */
56 
57 #undef ASM_APP_ON
58 #define ASM_APP_ON "#APP\n"
59 
60 #undef ASM_APP_OFF
61 #define ASM_APP_OFF "#NO_APP\n"
62 
63 /* Stack & calling: aggregate returns.  */
64 
65 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
66    we want to retain compatibility with older gcc versions.  */
67 #define DEFAULT_PCC_STRUCT_RETURN 0
68 
69 /* Assembler format: alignment output.  */
70 
71 /* Kludgy test: when gas is upgraded, it will have p2align, and no problems
72    with nops.  */
73 #ifndef HAVE_GAS_MAX_SKIP_P2ALIGN
74 /* i386 OpenBSD still uses an older gas that doesn't insert nops by default
75    when the .align directive demands to insert extra space in the text
76    segment.  */
77 #undef ASM_OUTPUT_ALIGN
78 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
79   if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG))
80 #endif
81 
82 /* Stack & calling: profiling.  */
83 
84 /* OpenBSD's profiler recovers all information from the stack pointer.
85    The icky part is not here, but in machine/profile.h.  */
86 #undef FUNCTION_PROFILER
87 #define FUNCTION_PROFILER(FILE, LABELNO)  \
88   fputs (flag_pic ? "\tcall mcount@PLT\n": "\tcall mcount\n", FILE);
89 
90 /* Assembler format: exception region output.  */
91 
92 /* All configurations that don't use elf must be explicit about not using
93    dwarf unwind information.  */
94 #define DWARF2_UNWIND_INFO 0
95 
96 #undef ASM_PREFERRED_EH_DATA_FORMAT
97 
98 #undef ASM_COMMENT_START
99 #define ASM_COMMENT_START ";#"
100 
101 /* OpenBSD gas currently does not support quad, so do not use it.  */
102 #undef ASM_QUAD
103