1 /* Configuration for an OpenBSD i386 target.
3 Copyright (C) 1999 Free Software Foundation, Inc.
5 This file is part of GNU CC.
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)
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.
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. */
22 /* $DragonFly: src/contrib/gcc/config/i386/Attic/openbsd.h,v 1.2 2003/11/09 02:34:00 dillon Exp $ */
24 /* This is tested by i386gas.h. */
25 #define YES_UNDERSCORES
27 #include <i386/gstabs.h>
29 /* Get perform_* macros to build libgcc.a. */
30 #include <i386/perform.h>
32 /* Get generic OpenBSD definitions. */
36 /* This goes away when the math-emulator is fixed */
38 #define TARGET_DEFAULT \
39 (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
41 /* Run-time target specifications */
42 #define CPP_PREDEFINES "-D__unix__ -D__i386__ -D__OpenBSD__ -Asystem(unix) -Asystem(OpenBSD) -Acpu(i386) -Amachine(i386)"
44 /* Layout of source language data types. */
46 /* This must agree with <machine/stdint.h> */
48 #define SIZE_TYPE "unsigned int"
51 #define PTRDIFF_TYPE "int"
54 #define WCHAR_TYPE "int"
56 #undef WCHAR_TYPE_SIZE
57 #define WCHAR_TYPE_SIZE 32
59 /* Assembler format: overall framework. */
62 #define ASM_APP_ON "#APP\n"
65 #define ASM_APP_OFF "#NO_APP\n"
67 /* The following macros were originally stolen from i386v4.h.
68 These have to be defined to get PIC code correct. */
70 /* Assembler format: dispatch tables. */
72 /* How to output an element of a case-vector that is relative.
73 This is only used for PIC code. See comments by the `casesi' insn in
74 i386.md for an explanation of the expression this outputs. */
75 #undef ASM_OUTPUT_ADDR_DIFF_ELT
76 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
77 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
79 /* Assembler format: sections. */
81 /* Indicate when jump tables go in the text section. This is
82 necessary when compiling PIC code. */
83 #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
85 /* Stack & calling: aggregate returns. */
87 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
88 we want to retain compatibility with older gcc versions. */
89 #define DEFAULT_PCC_STRUCT_RETURN 0
91 /* Assembler format: alignment output. */
93 /* Kludgy test: when gas is upgraded, it will have p2align, and no problems
95 #ifndef HAVE_GAS_MAX_SKIP_P2ALIGN
96 /* i386 OpenBSD still uses an older gas that doesn't insert nops by default
97 when the .align directive demands to insert extra space in the text
99 #undef ASM_OUTPUT_ALIGN
100 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
101 if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG))
104 /* Stack & calling: profiling. */
106 /* OpenBSD's profiler recovers all information from the stack pointer.
107 The icky part is not here, but in machine/profile.h. */
108 #undef FUNCTION_PROFILER
109 #define FUNCTION_PROFILER(FILE, LABELNO) \
110 fputs (flag_pic ? "\tcall mcount@PLT\n": "\tcall mcount\n", FILE);
112 /* Assembler format: exception region output. */
114 /* All configurations that don't use elf must be explicit about not using
115 dwarf unwind information. egcs doesn't try too hard to check internal
116 configuration files... */
117 #define DWARF2_UNWIND_INFO 0
119 /* Assembler format: alignment output. */
121 /* A C statement to output to the stdio stream FILE an assembler
122 command to advance the location counter to a multiple of 1<<LOG
123 bytes if it is within MAX_SKIP bytes.
125 This will be used to align code labels according to Intel
126 recommendations, in prevision of binutils upgrade. */
127 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
128 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
131 if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
132 else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
137 /* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */