1 /* Definitions of target machine for GNU compiler for Intel 80386
3 Copyright (C) 1988, 1992, 1994, 1996, 1997, 1999, 2000 Free Software
5 Contributed by Poul-Henning Kamp <phk@login.dkuug.dk>
7 This file is part of GNU CC.
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
24 /* This is tested by i386gas.h. */
25 #define YES_UNDERSCORES
27 /* Don't assume anything about the header files. */
28 #define NO_IMPLICIT_EXTERN_C
30 #include "i386/gstabs.h"
32 /* This goes away when the math-emulator is fixed */
33 #undef TARGET_SUBTARGET_DEFAULT
34 #define TARGET_SUBTARGET_DEFAULT \
35 (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
37 /* The macro defined in i386.h doesn't work with the old gas of
38 FreeBSD 2.x. The definition in sco.h and sol2.h appears to work,
39 but it turns out that, even though the assembler doesn't complain,
40 we get incorrect results. Fortunately, the definition in
42 #undef ASM_PREFERRED_EH_DATA_FORMAT
45 #define CPP_PREDEFINES "-Dunix -D__FreeBSD__\
46 -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
48 /* Like the default, except no -lg. */
49 #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
52 #define SIZE_TYPE "unsigned int"
55 #define PTRDIFF_TYPE "int"
58 #define WCHAR_TYPE "int"
60 #define WCHAR_UNSIGNED 0
62 #undef WCHAR_TYPE_SIZE
63 #define WCHAR_TYPE_SIZE BITS_PER_WORD
65 /* Override the default comment-starter of "/". */
67 #undef ASM_COMMENT_START
68 #define ASM_COMMENT_START "#"
71 #define ASM_APP_ON "#APP\n"
74 #define ASM_APP_OFF "#NO_APP\n"
76 /* FreeBSD using a.out does not support DWARF2 unwinding mechanisms. */
77 #define DWARF2_UNWIND_INFO 0
79 /* Don't default to pcc-struct-return, because in FreeBSD we prefer the
80 superior nature of the older gcc way. */
81 #define DEFAULT_PCC_STRUCT_RETURN 0
83 /* Ensure we the configuration knows our system correctly so we can link with
84 libraries compiled with the native cc. */
85 #undef NO_DOLLAR_IN_LABEL
87 /* i386 freebsd still uses old binutils that don't insert nops by default
88 when the .align directive demands to insert extra space in the text
90 #undef ASM_OUTPUT_ALIGN
91 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
92 if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG))
94 /* Profiling routines, partially copied from i386/osfrose.h. */
96 /* Redefine this to use %eax instead of %edx. */
97 #undef FUNCTION_PROFILER
98 #define FUNCTION_PROFILER(FILE, LABELNO) \
102 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%eax\n", \
103 LPREFIX, (LABELNO)); \
104 fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
108 fprintf (FILE, "\tmovl $%sP%d,%%eax\n", LPREFIX, (LABELNO)); \
109 fprintf (FILE, "\tcall mcount\n"); \
114 * Some imports from svr4.h in support of shared libraries.
115 * Currently, we need the DECLARE_OBJECT_SIZE stuff.
118 /* Define the strings used for the special svr4 .type and .size directives.
119 These strings generally do not vary from one system running svr4 to
120 another, but if a given system (e.g. m88k running svr) needs to use
121 different pseudo-op names for these, they may be overridden in the
122 file which includes this one. */
124 #define TYPE_ASM_OP "\t.type\t"
125 #define SIZE_ASM_OP "\t.size\t"
127 /* The following macro defines the format used to output the second
128 operand of the .type assembler directive. Different svr4 assemblers
129 expect various different forms for this operand. The one given here
130 is just a default. You may need to override it in your machine-
131 specific tm.h file (depending upon the particulars of your assembler). */
133 #define TYPE_OPERAND_FMT "@%s"
135 /* Write the extra assembler code needed to declare a function's result.
136 Most svr4 assemblers don't require any special declaration of the
137 result value, but there are exceptions. */
139 #ifndef ASM_DECLARE_RESULT
140 #define ASM_DECLARE_RESULT(FILE, RESULT)
143 /* These macros generate the special .type and .size directives which
144 are used to set the corresponding fields of the linker symbol table
145 entries in an ELF object file under SVR4. These macros also output
146 the starting labels for the relevant functions/objects. */
148 /* Write the extra assembler code needed to declare a function properly.
149 Some svr4 assemblers need to also have something extra said about the
150 function's return value. We allow for that here. */
152 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
154 fprintf (FILE, "%s", TYPE_ASM_OP); \
155 assemble_name (FILE, NAME); \
157 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
159 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
160 ASM_OUTPUT_LABEL(FILE, NAME); \
163 /* Write the extra assembler code needed to declare an object properly. */
165 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
167 fprintf (FILE, "%s", TYPE_ASM_OP); \
168 assemble_name (FILE, NAME); \
170 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
172 size_directive_output = 0; \
173 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
175 size_directive_output = 1; \
176 fprintf (FILE, "%s", SIZE_ASM_OP); \
177 assemble_name (FILE, NAME); \
178 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
180 ASM_OUTPUT_LABEL(FILE, NAME); \
183 /* Output the size directive for a decl in rest_of_decl_compilation
184 in the case where we did not do so before the initializer.
185 Once we find the error_mark_node, we know that the value of
186 size_directive_output was set
187 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
189 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
191 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
192 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
193 && ! AT_END && TOP_LEVEL \
194 && DECL_INITIAL (DECL) == error_mark_node \
195 && !size_directive_output) \
197 fprintf (FILE, "%s", SIZE_ASM_OP); \
198 assemble_name (FILE, name); \
199 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL)));\
204 /* This is how to declare the size of a function. */
206 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
208 if (!flag_inhibit_size_directive) \
211 static int labelno; \
213 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
214 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
215 fprintf (FILE, "%s", SIZE_ASM_OP); \
216 assemble_name (FILE, (FNAME)); \
217 fprintf (FILE, ","); \
218 assemble_name (FILE, label); \
219 fprintf (FILE, "-"); \
220 assemble_name (FILE, (FNAME)); \
225 #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
227 "%{p:%e`-p' not supported; use `-pg' and gprof(1)} \
228 %{shared:-Bshareable} \
229 %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \
230 %{pg:-Bstatic} %{Z}} \
233 #define STARTFILE_SPEC \
234 "%{shared:c++rt0.o%s} \
235 %{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
237 /* Define this so we can compile MS code for use with WINE. */
238 #define HANDLE_PRAGMA_PACK_PUSH_POP