openbsd.h revision 50397
1/* Configuration for an OpenBSD i386 target.
2
3   Copyright (C) 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING.  If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, 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/* Run-time target specifications */
35#define CPP_PREDEFINES "-D__unix__ -D__i386__ -D__OpenBSD__ -Asystem(unix) -Asystem(OpenBSD) -Acpu(i386) -Amachine(i386)"
36
37/* Layout of source language data types.  */
38
39/* This must agree with <machine/ansi.h> */
40#undef SIZE_TYPE
41#define SIZE_TYPE "unsigned int"
42
43#undef PTRDIFF_TYPE
44#define PTRDIFF_TYPE "int"
45
46#undef WCHAR_TYPE
47#define WCHAR_TYPE "int"
48
49#undef WCHAR_TYPE_SIZE
50#define WCHAR_TYPE_SIZE 32
51
52/* Assembler format: overall framework.  */
53
54#undef ASM_APP_ON
55#define ASM_APP_ON "#APP\n"
56
57#undef ASM_APP_OFF
58#define ASM_APP_OFF "#NO_APP\n"
59
60/* The following macros were originally stolen from i386v4.h.
61   These have to be defined to get PIC code correct.  */
62
63/* Assembler format: dispatch tables.  */
64
65/* How to output an element of a case-vector that is relative.
66   This is only used for PIC code.  See comments by the `casesi' insn in
67   i386.md for an explanation of the expression this outputs.  */
68#undef ASM_OUTPUT_ADDR_DIFF_ELT
69#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
70  fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
71
72/* Assembler format: sections.  */
73
74/* Indicate when jump tables go in the text section.  This is
75   necessary when compiling PIC code.  */
76#define JUMP_TABLES_IN_TEXT_SECTION  (flag_pic)
77
78/* Stack & calling: aggregate returns.  */
79
80/* Don't default to pcc-struct-return, because gcc is the only compiler, and
81   we want to retain compatibility with older gcc versions.  */
82#define DEFAULT_PCC_STRUCT_RETURN 0
83
84/* Assembler format: alignment output.  */
85
86/* Kludgy test: when gas is upgraded, it will have p2align, and no problems
87   with nops.  */
88#ifndef HAVE_GAS_MAX_SKIP_P2ALIGN
89/* i386 OpenBSD still uses an older gas that doesn't insert nops by default
90   when the .align directive demands to insert extra space in the text
91   segment.  */
92#undef ASM_OUTPUT_ALIGN
93#define ASM_OUTPUT_ALIGN(FILE,LOG) \
94  if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG))
95#endif
96
97/* Stack & calling: profiling.  */
98
99/* OpenBSD's profiler recovers all information from the stack pointer.
100   The icky part is not here, but in machine/profile.h.  */
101#undef FUNCTION_PROFILER
102#define FUNCTION_PROFILER(FILE, LABELNO)  \
103  fputs (flag_pic ? "\tcall mcount@PLT\n": "\tcall mcount\n", FILE);
104
105/* Assembler format: exception region output.  */
106
107/* All configurations that don't use elf must be explicit about not using
108   dwarf unwind information. egcs doesn't try too hard to check internal
109   configuration files...  */
110#define DWARF2_UNWIND_INFO 0
111
112/* Assembler format: alignment output.  */
113
114/* A C statement to output to the stdio stream FILE an assembler
115   command to advance the location counter to a multiple of 1<<LOG
116   bytes if it is within MAX_SKIP bytes.
117
118   This will be used to align code labels according to Intel
119   recommendations, in prevision of binutils upgrade.  */
120#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
121#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)			\
122  do {									\
123    if ((LOG) != 0)							\
124      if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));	\
125      else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));	\
126  } while (0)
127#endif
128
129/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h.  */
130
131