OSDN Git Service

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