1 /* Definitions of target machine for GNU compiler for Intel 80386
3 Copyright (C) 1988, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
4 Contributed by Poul-Henning Kamp <phk@login.dkuug.dk>
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* This goes away when the math-emulator is fixed */
24 #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
26 /* This is tested by i386gas.h. */
27 #define YES_UNDERSCORES
29 /* Don't assume anything about the header files. */
30 #define NO_IMPLICIT_EXTERN_C
32 #include "i386/gstabs.h"
34 /* Get perform_* macros to build libgcc.a. */
35 #include "i386/perform.h"
38 #define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
40 /* Like the default, except no -lg. */
41 #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
44 #define SIZE_TYPE "unsigned int"
47 #define PTRDIFF_TYPE "int"
50 #define WCHAR_TYPE "short unsigned int"
52 #define WCHAR_UNSIGNED 1
54 #undef WCHAR_TYPE_SIZE
55 #define WCHAR_TYPE_SIZE 16
59 /* Override the default comment-starter of "/". */
61 #undef ASM_COMMENT_START
62 #define ASM_COMMENT_START "#"
65 #define ASM_APP_ON "#APP\n"
68 #define ASM_APP_OFF "#NO_APP\n"
70 /* FreeBSD using a.out does not support DWARF2 unwinding mechanisms. */
71 #define DWARF2_UNWIND_INFO 0
73 /* The following macros are stolen from i386v4.h */
74 /* These have to be defined to get PIC code correct */
76 /* This is how to output an element of a case-vector that is relative.
77 This is only used for PIC code. See comments by the `casesi' insn in
78 i386.md for an explanation of the expression this outputs. */
80 #undef ASM_OUTPUT_ADDR_DIFF_ELT
81 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
82 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
84 /* Indicate that jump tables go in the text section. This is
85 necessary when compiling PIC code. */
87 #define JUMP_TABLES_IN_TEXT_SECTION
89 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
90 we want to retain compatibility with older gcc versions. */
91 #define DEFAULT_PCC_STRUCT_RETURN 0
93 /* i386 freebsd still uses old binutils that don't insert nops by default
94 when the .align directive demands to insert extra space in the text
96 #undef ASM_OUTPUT_ALIGN
97 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
98 if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG))
100 /* Profiling routines, partially copied from i386/osfrose.h. */
102 /* Redefine this to use %eax instead of %edx. */
103 #undef FUNCTION_PROFILER
104 #define FUNCTION_PROFILER(FILE, LABELNO) \
108 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%eax\n", \
109 LPREFIX, (LABELNO)); \
110 fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
114 fprintf (FILE, "\tmovl $%sP%d,%%eax\n", LPREFIX, (LABELNO)); \
115 fprintf (FILE, "\tcall mcount\n"); \
120 * Some imports from svr4.h in support of shared libraries.
121 * Currently, we need the DECLARE_OBJECT_SIZE stuff.
124 /* Define the strings used for the special svr4 .type and .size directives.
125 These strings generally do not vary from one system running svr4 to
126 another, but if a given system (e.g. m88k running svr) needs to use
127 different pseudo-op names for these, they may be overridden in the
128 file which includes this one. */
130 #define TYPE_ASM_OP ".type"
131 #define SIZE_ASM_OP ".size"
133 /* The following macro defines the format used to output the second
134 operand of the .type assembler directive. Different svr4 assemblers
135 expect various different forms for this operand. The one given here
136 is just a default. You may need to override it in your machine-
137 specific tm.h file (depending upon the particulars of your assembler). */
139 #define TYPE_OPERAND_FMT "@%s"
141 /* Write the extra assembler code needed to declare a function's result.
142 Most svr4 assemblers don't require any special declaration of the
143 result value, but there are exceptions. */
145 #ifndef ASM_DECLARE_RESULT
146 #define ASM_DECLARE_RESULT(FILE, RESULT)
149 /* These macros generate the special .type and .size directives which
150 are used to set the corresponding fields of the linker symbol table
151 entries in an ELF object file under SVR4. These macros also output
152 the starting labels for the relevant functions/objects. */
154 /* Write the extra assembler code needed to declare a function properly.
155 Some svr4 assemblers need to also have something extra said about the
156 function's return value. We allow for that here. */
158 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
160 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
161 assemble_name (FILE, NAME); \
163 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
165 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
166 ASM_OUTPUT_LABEL(FILE, NAME); \
169 /* Write the extra assembler code needed to declare an object properly. */
171 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
173 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
174 assemble_name (FILE, NAME); \
176 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
178 size_directive_output = 0; \
179 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
181 size_directive_output = 1; \
182 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
183 assemble_name (FILE, NAME); \
184 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
186 ASM_OUTPUT_LABEL(FILE, NAME); \
189 /* Output the size directive for a decl in rest_of_decl_compilation
190 in the case where we did not do so before the initializer.
191 Once we find the error_mark_node, we know that the value of
192 size_directive_output was set
193 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
195 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
197 char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
198 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
199 && ! AT_END && TOP_LEVEL \
200 && DECL_INITIAL (DECL) == error_mark_node \
201 && !size_directive_output) \
203 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
204 assemble_name (FILE, name); \
205 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL)));\
210 /* This is how to declare the size of a function. */
212 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
214 if (!flag_inhibit_size_directive) \
217 static int labelno; \
219 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
220 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
221 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
222 assemble_name (FILE, (FNAME)); \
223 fprintf (FILE, ","); \
224 assemble_name (FILE, label); \
225 fprintf (FILE, "-"); \
226 assemble_name (FILE, (FNAME)); \
231 #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
233 "%{p:%e`-p' not supported; use `-pg' and gprof(1)} \
234 %{shared:-Bshareable} \
235 %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \
236 %{pg:-Bstatic} %{Z}} \
239 #define STARTFILE_SPEC \
240 "%{shared:c++rt0.o%s} \
241 %{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
243 /* This is defined when gcc is compiled in the BSD-directory-tree, and must
244 * make up for the gap to all the stuff done in the GNU-makefiles.
247 #ifdef FREEBSD_NATIVE
249 #define INCLUDE_DEFAULTS { \
250 { "/usr/include", 0, 0, 0 }, \
251 { "/usr/include/g++", "G++", 1, 1 }, \
255 #undef MD_EXEC_PREFIX
256 #define MD_EXEC_PREFIX "/usr/libexec/"
258 #undef STANDARD_STARTFILE_PREFIX
259 #define STANDARD_STARTFILE_PREFIX "/usr/lib"
261 #if 0 /* This is very wrong!!! */
262 #define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
263 #define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
264 #define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
265 #define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
268 #endif /* FREEBSD_NATIVE */