* tm.texi: Fix markup.
[official-gcc.git] / gcc / config / i386 / beos-elf.h
blobbe948a3759c5a3ac6aee0fc0b8ebdbbd3fccffdb
1 /* Definitions for Intel x86 running BeOS
2 Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 #include <i386/i386.h> /* Base i386 target machine definitions */
22 #include <i386/att.h> /* Use the i386 AT&T assembler syntax */
23 #include <svr4.h> /* some common stuff */
25 #undef TARGET_VERSION
26 #define TARGET_VERSION fprintf (stderr, " (i386 BeOS/ELF)");
28 /* Change debugging to Dwarf2. */
29 #undef PREFERRED_DEBUGGING_TYPE
30 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
32 /* The SVR4 ABI for the i386 says that records and unions are returned
33 in memory. */
34 #undef DEFAULT_PCC_STRUCT_RETURN
35 #define DEFAULT_PCC_STRUCT_RETURN 1
37 #undef ASM_COMMENT_START
38 #define ASM_COMMENT_START " #"
40 /* This is how to output an element of a case-vector that is relative.
41 This is only used for PIC code. See comments by the `casesi' insn in
42 i386.md for an explanation of the expression this outputs. */
43 #undef ASM_OUTPUT_ADDR_DIFF_ELT
44 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
45 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
47 /* Indicate that jump tables go in the text section. This is
48 necessary when compiling PIC code. */
49 #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
51 #undef DBX_REGISTER_NUMBER
52 #define DBX_REGISTER_NUMBER(n) \
53 (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
55 /* Output assembler code to FILE to increment profiler label # LABELNO
56 for profiling a function entry. */
58 #undef FUNCTION_PROFILER
59 #define FUNCTION_PROFILER(FILE, LABELNO) \
60 { \
61 if (flag_pic) \
62 { \
63 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
64 LPREFIX, (LABELNO)); \
65 fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
66 } \
67 else \
68 { \
69 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
70 fprintf (FILE, "\tcall mcount\n"); \
71 } \
74 #undef SIZE_TYPE
75 #define SIZE_TYPE "long unsigned int"
77 #undef PTRDIFF_TYPE
78 #define PTRDIFF_TYPE "long int"
80 #undef WCHAR_TYPE
81 #define WCHAR_TYPE "short unsigned int"
83 #undef WCHAR_UNSIGNED
84 #define WCHAR_UNSIGNED 1
86 #undef WCHAR_TYPE_SIZE
87 #define WCHAR_TYPE_SIZE 16
89 #undef CPP_PREDEFINES
90 #define CPP_PREDEFINES "-D__ELF__ -D__BEOS__ -D__INTEL__ -D_X86_=1 \
91 -D__stdcall=__attribute__((__stdcall__)) \
92 -D__cdecl=__attribute__((__cdecl__)) \
93 -D__declspec(x)=__attribute__((x)) \
94 -Asystem=beos"
96 #undef CPP_SPEC
97 #define CPP_SPEC "%(cpp_cpu) %{!no-fPIC:%{!no-fpic:-D__PIC__ -D__pic__}}"
99 /* BeOS uses lots of multichars, so don't warn about them unless the
100 user explicitly asks for the warnings with -Wmultichar. Note that
101 CC1_SPEC is used for both cc1 and cc1plus. */
103 #undef CC1_SPEC
104 #define CC1_SPEC "%{!no-fpic:%{!fPIC:-fpic}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}"
106 #undef CC1PLUS_SPEC
107 #define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}"
109 /* Provide a LINK_SPEC appropriate for BeOS. Here we provide support
110 for the special GCC options -static and -shared, which allow us to
111 link things in one of these three modes by applying the appropriate
112 combinations of options at link-time. */
114 /* If ELF is the default format, we should not use /lib/elf. */
116 #undef LINK_SPEC
117 #define LINK_SPEC "%{!o*:-o %b} -m elf_i386_be -shared -Bsymbolic %{nostart:-e 0}"
119 /* Provide start and end file specs appropriate to glibc. */
121 /* LIB_SPEC for BeOS */
122 #undef LIB_SPEC
123 #define LIB_SPEC "-lnet -lroot"
125 /* gcc runtime lib is built into libroot.so on BeOS */
126 /* ??? This is gonna be lovely when the next release of gcc has
127 some new symbol in, so that links start failing. */
128 #undef LIBGCC_SPEC
129 #define LIBGCC_SPEC ""
131 #undef STARTFILE_SPEC
132 #define STARTFILE_SPEC "crti.o%s crtbegin.o%s %{!nostart:start_dyn.o%s} init_term_dyn.o%s %{p:i386-mcount.o%s}"
134 #undef ENDFILE_SPEC
135 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
137 /* A C statement (sans semicolon) to output to the stdio stream
138 FILE the assembler definition of uninitialized global DECL named
139 NAME whose size is SIZE bytes and alignment is ALIGN bytes.
140 Try to use asm_output_aligned_bss to implement this macro. */
142 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
143 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
145 /* A C statement to output to the stdio stream FILE an assembler
146 command to advance the location counter to a multiple of 1<<LOG
147 bytes if it is within MAX_SKIP bytes.
149 This is used to align code labels according to Intel recommendations. */
151 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
152 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
153 if ((LOG)!=0) \
154 if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
155 else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
156 #endif
158 /* For native compiler, use standard BeOS include file search paths
159 rooted in /boot/develop/headers. For a cross compiler, don't
160 expect the host to use the BeOS directory scheme, and instead look
161 for the BeOS include files relative to TOOL_INCLUDE_DIR. Yes, we
162 use ANSI string concatenation here (FIXME) */
164 #ifndef CROSS_COMPILE
165 #undef INCLUDE_DEFAULTS
166 #define INCLUDE_DEFAULTS \
168 { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },\
169 { GCC_INCLUDE_DIR, "GCC", 0, 0 },\
170 { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1}, \
171 { "/boot/develop/headers/be/add-ons/graphics", 0, 0, 0 },\
172 { "/boot/develop/headers/be/devel", 0, 0, 0 },\
173 { "/boot/develop/headers/be/translation", 0, 0, 0 },\
174 { "/boot/develop/headers/be/mail", 0, 0, 0 },\
175 { "/boot/develop/headers/gnu", 0, 0, 0 },\
176 { "/boot/develop/headers/be/drivers", 0, 0, 0 },\
177 { "/boot/develop/headers/be/opengl", 0, 0, 0 },\
178 { "/boot/develop/headers/be/game", 0, 0, 0 },\
179 { "/boot/develop/headers/be/support", 0, 0, 0 },\
180 { "/boot/develop/headers/be/storage", 0, 0, 0 },\
181 { "/boot/develop/headers/be/kernel", 0, 0, 0 },\
182 { "/boot/develop/headers/be/net", 0, 0, 0 },\
183 { "/boot/develop/headers/be/midi", 0, 0, 0 },\
184 { "/boot/develop/headers/be/midi2", 0, 0, 0 },\
185 { "/boot/develop/headers/be/media", 0, 0, 0 },\
186 { "/boot/develop/headers/be/interface", 0, 0, 0 },\
187 { "/boot/develop/headers/be/device", 0, 0, 0 },\
188 { "/boot/develop/headers/be/app", 0, 0, 0 },\
189 { "/boot/develop/headers/be/precompiled", 0, 0, 0 },\
190 { "/boot/develop/headers/be/add-ons/input_server", 0, 0, 0 },\
191 { "/boot/develop/headers/be/add-ons/net_server", 0, 0, 0 },\
192 { "/boot/develop/headers/be/add-ons/screen_saver", 0, 0, 0 },\
193 { "/boot/develop/headers/be/add-ons/tracker", 0, 0, 0 },\
194 { "/boot/develop/headers/be/be_apps/Deskbar", 0, 0, 0 },\
195 { "/boot/develop/headers/be/be_apps/NetPositive", 0, 0, 0 },\
196 { "/boot/develop/headers/be/be_apps/Tracker", 0, 0, 0 },\
197 { "/boot/develop/headers/be/drivers/tty", 0, 0, 0 },\
198 { "/boot/develop/headers/be/net/netinet", 0, 0, 0 },\
199 { "/boot/develop/headers/be/storage", 0, 0, 0 },\
200 { "/boot/develop/headers/be", 0, 0, 0 },\
201 { "/boot/develop/headers/cpp", 0, 0, 0 },\
202 { "/boot/develop/headers/posix", 0, 0, 0 },\
203 { "/boot/develop/headers", 0, 0, 0 }, \
204 { 0, 0, 0, 0 } \
206 #else /* CROSS_COMPILE */
207 #undef INCLUDE_DEFAULTS
208 #define INCLUDE_DEFAULTS \
210 { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },\
211 { GCC_INCLUDE_DIR, "GCC", 0, 0 },\
212 { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1}, \
213 { CROSS_INCLUDE_DIR "/be/add-ons/graphics", 0, 0, 0 },\
214 { CROSS_INCLUDE_DIR "/be/devel", 0, 0, 0 },\
215 { CROSS_INCLUDE_DIR "/be/translation", 0, 0, 0 },\
216 { CROSS_INCLUDE_DIR "/be/mail", 0, 0, 0 },\
217 { CROSS_INCLUDE_DIR "/gnu", 0, 0, 0 },\
218 { CROSS_INCLUDE_DIR "/be/drivers", 0, 0, 0 },\
219 { CROSS_INCLUDE_DIR "/be/opengl", 0, 0, 0 },\
220 { CROSS_INCLUDE_DIR "/be/game", 0, 0, 0 },\
221 { CROSS_INCLUDE_DIR "/be/support", 0, 0, 0 },\
222 { CROSS_INCLUDE_DIR "/be/storage", 0, 0, 0 },\
223 { CROSS_INCLUDE_DIR "/be/kernel", 0, 0, 0 },\
224 { CROSS_INCLUDE_DIR "/be/net", 0, 0, 0 },\
225 { CROSS_INCLUDE_DIR "/be/midi", 0, 0, 0 },\
226 { CROSS_INCLUDE_DIR "/be/midi2", 0, 0, 0 },\
227 { CROSS_INCLUDE_DIR "/be/media", 0, 0, 0 },\
228 { CROSS_INCLUDE_DIR "/be/interface", 0, 0, 0 },\
229 { CROSS_INCLUDE_DIR "/be/device", 0, 0, 0 },\
230 { CROSS_INCLUDE_DIR "/be/app", 0, 0, 0 },\
231 { CROSS_INCLUDE_DIR "/be/precompiled", 0, 0, 0 },\
232 { CROSS_INCLUDE_DIR "/be/add-ons/input_server", 0, 0, 0 },\
233 { CROSS_INCLUDE_DIR "/be/add-ons/net_server", 0, 0, 0 },\
234 { CROSS_INCLUDE_DIR "/be/add-ons/screen_saver", 0, 0, 0 },\
235 { CROSS_INCLUDE_DIR "/be/add-ons/tracker", 0, 0, 0 },\
236 { CROSS_INCLUDE_DIR "/be/be_apps/Deskbar", 0, 0, 0 },\
237 { CROSS_INCLUDE_DIR "/be/be_apps/NetPositive", 0, 0, 0 },\
238 { CROSS_INCLUDE_DIR "/be/be_apps/Tracker", 0, 0, 0 },\
239 { CROSS_INCLUDE_DIR "/be/drivers/tty", 0, 0, 0 },\
240 { CROSS_INCLUDE_DIR "/be/net/netinet", 0, 0, 0 },\
241 { CROSS_INCLUDE_DIR "/be/storage", 0, 0, 0 },\
242 { CROSS_INCLUDE_DIR "/be", 0, 0, 0 },\
243 { CROSS_INCLUDE_DIR "/cpp", 0, 0, 0 },\
244 { CROSS_INCLUDE_DIR "/posix", 0, 0, 0 },\
245 { CROSS_INCLUDE_DIR , 0, 0, 0 }, \
246 { 0, 0, 0, 0 } \
248 #endif
250 /* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will
251 cause nasty problems if we override it. */
252 #define LIBRARY_PATH_ENV "BELIBRARIES"
254 /* BeOS doesn't have a separate math library. */
255 #define MATH_LIBRARY ""
257 /* BeOS headers are C++-aware (and often use C++). */
258 #define NO_IMPLICIT_EXTERN_C
260 /* Define this macro if in some cases global symbols from one translation
261 unit may not be bound to undefined symbols in another translation unit
262 without user intervention. For instance, under Microsoft Windows
263 symbols must be explicitly imported from shared libraries (DLLs). */
264 #define MULTIPLE_SYMBOL_SPACES