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 is tested by i386gas.h. */
24 #define YES_UNDERSCORES
26 /* Don't assume anything about the header files. */
27 #define NO_IMPLICIT_EXTERN_C
29 #include "i386/gstabs.h"
31 /* Get perform_* macros to build libgcc.a. */
32 #include "i386/perform.h"
34 /* This goes away when the math-emulator is fixed */
36 #define TARGET_DEFAULT 0701 /* TARGET_NO_FANCY_MATH_387 | ... */
39 #define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
41 /* Like the default, except no -lg. */
42 #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}"
45 #define SIZE_TYPE "unsigned int"
48 #define PTRDIFF_TYPE "int"
51 #define WCHAR_TYPE "int"
53 #define WCHAR_UNSIGNED 0
55 #undef WCHAR_TYPE_SIZE
56 #define WCHAR_TYPE_SIZE BITS_PER_WORD
60 /* Override the default comment-starter of "/". */
62 #undef ASM_COMMENT_START
63 #define ASM_COMMENT_START "#"
66 #define ASM_APP_ON "#APP\n"
69 #define ASM_APP_OFF "#NO_APP\n"
71 /* FreeBSD using a.out does not support DWARF2 unwinding mechanisms. */
72 #define DWARF2_UNWIND_INFO 0
74 /* The following macros are stolen from i386v4.h */
75 /* These have to be defined to get PIC code correct */
77 /* This is how to output an element of a case-vector that is relative.
78 This is only used for PIC code. See comments by the `casesi' insn in
79 i386.md for an explanation of the expression this outputs. */
81 #undef ASM_OUTPUT_ADDR_DIFF_ELT
82 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
83 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
85 /* Indicate that jump tables go in the text section. This is
86 necessary when compiling PIC code. */
88 #define JUMP_TABLES_IN_TEXT_SECTION 1
90 /* Don't default to pcc-struct-return, because in FreeBSD we prefer the
91 superior nature of the older gcc way. */
92 #define DEFAULT_PCC_STRUCT_RETURN 0
94 /* Ensure we the configuration knows our system correctly so we can link with
95 libraries compiled with the native cc. */
96 #undef NO_DOLLAR_IN_LABEL
98 /* i386 freebsd still uses old binutils that don't insert nops by default
99 when the .align directive demands to insert extra space in the text
101 #undef ASM_OUTPUT_ALIGN
102 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
103 if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG))
105 /* Profiling routines, partially copied from i386/osfrose.h. */
107 /* Redefine this to use %eax instead of %edx. */
108 #undef FUNCTION_PROFILER
109 #define FUNCTION_PROFILER(FILE, LABELNO) \
113 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%eax\n", \
114 LPREFIX, (LABELNO)); \
115 fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
119 fprintf (FILE, "\tmovl $%sP%d,%%eax\n", LPREFIX, (LABELNO)); \
120 fprintf (FILE, "\tcall mcount\n"); \
125 * Some imports from svr4.h in support of shared libraries.
126 * Currently, we need the DECLARE_OBJECT_SIZE stuff.
129 /* Define the strings used for the special svr4 .type and .size directives.
130 These strings generally do not vary from one system running svr4 to
131 another, but if a given system (e.g. m88k running svr) needs to use
132 different pseudo-op names for these, they may be overridden in the
133 file which includes this one. */
135 #define TYPE_ASM_OP ".type"
136 #define SIZE_ASM_OP ".size"
138 /* The following macro defines the format used to output the second
139 operand of the .type assembler directive. Different svr4 assemblers
140 expect various different forms for this operand. The one given here
141 is just a default. You may need to override it in your machine-
142 specific tm.h file (depending upon the particulars of your assembler). */
144 #define TYPE_OPERAND_FMT "@%s"
146 /* Write the extra assembler code needed to declare a function's result.
147 Most svr4 assemblers don't require any special declaration of the
148 result value, but there are exceptions. */
150 #ifndef ASM_DECLARE_RESULT
151 #define ASM_DECLARE_RESULT(FILE, RESULT)
154 /* These macros generate the special .type and .size directives which
155 are used to set the corresponding fields of the linker symbol table
156 entries in an ELF object file under SVR4. These macros also output
157 the starting labels for the relevant functions/objects. */
159 /* Write the extra assembler code needed to declare a function properly.
160 Some svr4 assemblers need to also have something extra said about the
161 function's return value. We allow for that here. */
163 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
165 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
166 assemble_name (FILE, NAME); \
168 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
170 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
171 ASM_OUTPUT_LABEL(FILE, NAME); \
174 /* Write the extra assembler code needed to declare an object properly. */
176 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
178 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
179 assemble_name (FILE, NAME); \
181 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
183 size_directive_output = 0; \
184 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
186 size_directive_output = 1; \
187 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
188 assemble_name (FILE, NAME); \
189 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
191 ASM_OUTPUT_LABEL(FILE, NAME); \
194 /* Output the size directive for a decl in rest_of_decl_compilation
195 in the case where we did not do so before the initializer.
196 Once we find the error_mark_node, we know that the value of
197 size_directive_output was set
198 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
200 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
202 char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
203 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
204 && ! AT_END && TOP_LEVEL \
205 && DECL_INITIAL (DECL) == error_mark_node \
206 && !size_directive_output) \
208 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
209 assemble_name (FILE, name); \
210 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL)));\
215 /* This is how to declare the size of a function. */
217 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
219 if (!flag_inhibit_size_directive) \
222 static int labelno; \
224 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
225 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
226 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
227 assemble_name (FILE, (FNAME)); \
228 fprintf (FILE, ","); \
229 assemble_name (FILE, label); \
230 fprintf (FILE, "-"); \
231 assemble_name (FILE, (FNAME)); \
236 #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
238 "%{p:%e`-p' not supported; use `-pg' and gprof(1)} \
239 %{shared:-Bshareable} \
240 %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \
241 %{pg:-Bstatic} %{Z}} \
244 #define STARTFILE_SPEC \
245 "%{shared:c++rt0.o%s} \
246 %{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"
248 /* This is defined when gcc is compiled in the BSD-directory-tree, and must
249 * make up for the gap to all the stuff done in the GNU-makefiles.
252 #ifdef FREEBSD_NATIVE
254 #define INCLUDE_DEFAULTS { \
255 { "/usr/include", 0, 0, 0 }, \
256 { "/usr/include/g++", "G++", 1, 1 }, \
260 #undef MD_EXEC_PREFIX
261 #define MD_EXEC_PREFIX "/usr/libexec/"
263 #undef STANDARD_STARTFILE_PREFIX
264 #define STANDARD_STARTFILE_PREFIX "/usr/lib"
266 #if 0 /* This is very wrong!!! */
267 #define DEFAULT_TARGET_MACHINE "i386-unknown-freebsd_1.0"
268 #define GPLUSPLUS_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
269 #define TOOL_INCLUDE_DIR "/usr/local/i386-unknown-freebsd_1.0/include"
270 #define GCC_INCLUDE_DIR "/usr/local/lib/gcc-lib/i386-unknown-freebsd_1.0/2.5.8/include"
273 #endif /* FREEBSD_NATIVE */