OSDN Git Service

2000-12-29 Robert Lipe <robertl@sco.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / openbsd.h
1 /* Configuration for an OpenBSD i386 target.
2    Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC 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 GNU CC 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 GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* This is tested by i386gas.h.  */
22 #define YES_UNDERSCORES
23
24 #include <i386/gstabs.h>
25
26 /* Get perform_* macros to build libgcc.a.  */
27 #include <i386/perform.h>
28
29 /* Get generic OpenBSD definitions.  */
30 #define OBSD_OLD_GAS
31 #include <openbsd.h>
32
33 /* This goes away when the math-emulator is fixed */
34 #undef TARGET_DEFAULT
35 #define TARGET_DEFAULT \
36   (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
37
38 /* Run-time target specifications */
39 #define CPP_PREDEFINES "-D__unix__ -D__OpenBSD__ \
40  -Asystem=unix -Asystem=bsd -Asystem=OpenBSD"
41
42 /* Layout of source language data types.  */
43
44 /* This must agree with <machine/ansi.h> */
45 #undef SIZE_TYPE
46 #define SIZE_TYPE "unsigned int"
47
48 #undef PTRDIFF_TYPE
49 #define PTRDIFF_TYPE "int"
50
51 #undef WCHAR_TYPE
52 #define WCHAR_TYPE "int"
53
54 #undef WCHAR_TYPE_SIZE
55 #define WCHAR_TYPE_SIZE 32
56
57 /* Assembler format: overall framework.  */
58
59 #undef ASM_APP_ON
60 #define ASM_APP_ON "#APP\n"
61
62 #undef ASM_APP_OFF
63 #define ASM_APP_OFF "#NO_APP\n"
64
65 /* The following macros were originally stolen from i386v4.h.
66    These have to be defined to get PIC code correct.  */
67
68 /* Assembler format: dispatch tables.  */
69
70 /* How to output an element of a case-vector that is relative.
71    This is only used for PIC code.  See comments by the `casesi' insn in
72    i386.md for an explanation of the expression this outputs.  */
73 #undef ASM_OUTPUT_ADDR_DIFF_ELT
74 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
75   fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
76
77 /* Assembler format: sections.  */
78
79 /* Indicate when jump tables go in the text section.  This is
80    necessary when compiling PIC code.  */
81 #define JUMP_TABLES_IN_TEXT_SECTION  (flag_pic)
82
83 /* Stack & calling: aggregate returns.  */
84
85 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
86    we want to retain compatibility with older gcc versions.  */
87 #define DEFAULT_PCC_STRUCT_RETURN 0
88
89 /* Assembler format: alignment output.  */
90
91 /* Kludgy test: when gas is upgraded, it will have p2align, and no problems
92    with nops.  */
93 #ifndef HAVE_GAS_MAX_SKIP_P2ALIGN
94 /* i386 OpenBSD still uses an older gas that doesn't insert nops by default
95    when the .align directive demands to insert extra space in the text
96    segment.  */
97 #undef ASM_OUTPUT_ALIGN
98 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
99   if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG))
100 #endif
101
102 /* Stack & calling: profiling.  */
103
104 /* OpenBSD's profiler recovers all information from the stack pointer.
105    The icky part is not here, but in machine/profile.h.  */
106 #undef FUNCTION_PROFILER
107 #define FUNCTION_PROFILER(FILE, LABELNO)  \
108   fputs (flag_pic ? "\tcall mcount@PLT\n": "\tcall mcount\n", FILE);
109
110 /* Assembler format: exception region output.  */
111
112 /* All configurations that don't use elf must be explicit about not using
113    dwarf unwind information. egcs doesn't try too hard to check internal
114    configuration files...  */
115 #define DWARF2_UNWIND_INFO 0
116
117 /* Assembler format: alignment output.  */
118
119 /* A C statement to output to the stdio stream FILE an assembler
120    command to advance the location counter to a multiple of 1<<LOG
121    bytes if it is within MAX_SKIP bytes.
122
123    This will be used to align code labels according to Intel 
124    recommendations, in prevision of binutils upgrade.  */
125 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
126 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                    \
127   do {                                                                  \
128     if ((LOG) != 0) {                                                   \
129       if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));  \
130       else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));  \
131     }                                                                   \
132   } while (0)
133 #endif
134
135 /* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h.  */
136
137 /* This is the pseudo-op used to generate a 32-bit word of data with a
138    specific value in some section.  */
139
140 #define INT_ASM_OP "\t.long\t"