* config/i386/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define.
[official-gcc.git] / gcc / config / i386 / beos-elf.h
blob5b1d1d3ff22be321984ddf1dfa8cdf43af1ae9c3
1 /* Definitions for Intel x86 running BeOS
2 Copyright (C) 1998, 1999, 2000, 2001, 2002 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. */
22 #define TARGET_VERSION fprintf (stderr, " (i386 BeOS/ELF)");
24 /* Change debugging to Dwarf2. */
25 #undef PREFERRED_DEBUGGING_TYPE
26 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
28 /* The SVR4 ABI for the i386 says that records and unions are returned
29 in memory. */
30 #undef DEFAULT_PCC_STRUCT_RETURN
31 #define DEFAULT_PCC_STRUCT_RETURN 1
33 #undef ASM_COMMENT_START
34 #define ASM_COMMENT_START " #"
36 #undef DBX_REGISTER_NUMBER
37 #define DBX_REGISTER_NUMBER(n) \
38 (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
40 /* Output assembler code to FILE to increment profiler label # LABELNO
41 for profiling a function entry. */
43 #undef FUNCTION_PROFILER
44 #define FUNCTION_PROFILER(FILE, LABELNO) \
45 { \
46 if (flag_pic) \
47 { \
48 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
49 LPREFIX, (LABELNO)); \
50 fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
51 } \
52 else \
53 { \
54 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
55 fprintf (FILE, "\tcall mcount\n"); \
56 } \
59 #undef SIZE_TYPE
60 #define SIZE_TYPE "long unsigned int"
62 #undef PTRDIFF_TYPE
63 #define PTRDIFF_TYPE "long int"
65 #undef WCHAR_TYPE
66 #define WCHAR_TYPE "short unsigned int"
68 #undef WCHAR_TYPE_SIZE
69 #define WCHAR_TYPE_SIZE 16
71 #undef CPP_PREDEFINES
72 #define CPP_PREDEFINES "-D__ELF__ -D__BEOS__ -D__INTEL__ -D_X86_=1 \
73 -D__stdcall=__attribute__((__stdcall__)) \
74 -D__cdecl=__attribute__((__cdecl__)) \
75 -D__declspec(x)=__attribute__((x)) \
76 -Asystem=beos"
78 #undef CPP_SPEC
79 #define CPP_SPEC "%(cpp_cpu) %{!no-fPIC:%{!no-fpic:-D__PIC__ -D__pic__}}"
81 /* BeOS uses lots of multichars, so don't warn about them unless the
82 user explicitly asks for the warnings with -Wmultichar. Note that
83 CC1_SPEC is used for both cc1 and cc1plus. */
85 #undef CC1_SPEC
86 #define CC1_SPEC "%{!no-fpic:%{!fPIC:-fpic}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}"
88 #undef CC1PLUS_SPEC
89 #define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}"
91 /* Provide a LINK_SPEC appropriate for BeOS. Here we provide support
92 for the special GCC options -static and -shared, which allow us to
93 link things in one of these three modes by applying the appropriate
94 combinations of options at link-time. */
96 /* If ELF is the default format, we should not use /lib/elf. */
98 #undef LINK_SPEC
99 #define LINK_SPEC "%{!o*:-o %b} -m elf_i386_be -shared -Bsymbolic %{nostart:-e 0}"
101 /* Provide start and end file specs appropriate to glibc. */
103 /* LIB_SPEC for BeOS */
104 #undef LIB_SPEC
105 #define LIB_SPEC "-lnet -lroot"
107 /* gcc runtime lib is built into libroot.so on BeOS */
108 /* ??? This is gonna be lovely when the next release of gcc has
109 some new symbol in, so that links start failing. */
110 #undef LIBGCC_SPEC
111 #define LIBGCC_SPEC ""
113 #undef STARTFILE_SPEC
114 #define STARTFILE_SPEC "crti.o%s crtbegin.o%s %{!nostart:start_dyn.o%s} init_term_dyn.o%s %{p:i386-mcount.o%s}"
116 #undef ENDFILE_SPEC
117 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
119 /* A C statement (sans semicolon) to output to the stdio stream
120 FILE the assembler definition of uninitialized global DECL named
121 NAME whose size is SIZE bytes and alignment is ALIGN bytes.
122 Try to use asm_output_aligned_bss to implement this macro. */
124 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
125 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
127 /* A C statement to output to the stdio stream FILE an assembler
128 command to advance the location counter to a multiple of 1<<LOG
129 bytes if it is within MAX_SKIP bytes.
131 This is used to align code labels according to Intel recommendations. */
133 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
134 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
135 if ((LOG)!=0) \
136 if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
137 else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
138 #endif
140 /* For native compiler, use standard BeOS include file search paths
141 rooted in /boot/develop/headers. For a cross compiler, don't
142 expect the host to use the BeOS directory scheme, and instead look
143 for the BeOS include files relative to TOOL_INCLUDE_DIR. Yes, we
144 use ANSI string concatenation here (FIXME) */
146 #ifndef CROSS_COMPILE
147 #undef INCLUDE_DEFAULTS
148 #define INCLUDE_DEFAULTS \
150 { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },\
151 { GCC_INCLUDE_DIR, "GCC", 0, 0 },\
152 { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1}, \
153 { "/boot/develop/headers/be/add-ons/graphics", 0, 0, 0 },\
154 { "/boot/develop/headers/be/devel", 0, 0, 0 },\
155 { "/boot/develop/headers/be/translation", 0, 0, 0 },\
156 { "/boot/develop/headers/be/mail", 0, 0, 0 },\
157 { "/boot/develop/headers/gnu", 0, 0, 0 },\
158 { "/boot/develop/headers/be/drivers", 0, 0, 0 },\
159 { "/boot/develop/headers/be/opengl", 0, 0, 0 },\
160 { "/boot/develop/headers/be/game", 0, 0, 0 },\
161 { "/boot/develop/headers/be/support", 0, 0, 0 },\
162 { "/boot/develop/headers/be/storage", 0, 0, 0 },\
163 { "/boot/develop/headers/be/kernel", 0, 0, 0 },\
164 { "/boot/develop/headers/be/net", 0, 0, 0 },\
165 { "/boot/develop/headers/be/midi", 0, 0, 0 },\
166 { "/boot/develop/headers/be/midi2", 0, 0, 0 },\
167 { "/boot/develop/headers/be/media", 0, 0, 0 },\
168 { "/boot/develop/headers/be/interface", 0, 0, 0 },\
169 { "/boot/develop/headers/be/device", 0, 0, 0 },\
170 { "/boot/develop/headers/be/app", 0, 0, 0 },\
171 { "/boot/develop/headers/be/precompiled", 0, 0, 0 },\
172 { "/boot/develop/headers/be/add-ons/input_server", 0, 0, 0 },\
173 { "/boot/develop/headers/be/add-ons/net_server", 0, 0, 0 },\
174 { "/boot/develop/headers/be/add-ons/screen_saver", 0, 0, 0 },\
175 { "/boot/develop/headers/be/add-ons/tracker", 0, 0, 0 },\
176 { "/boot/develop/headers/be/be_apps/Deskbar", 0, 0, 0 },\
177 { "/boot/develop/headers/be/be_apps/NetPositive", 0, 0, 0 },\
178 { "/boot/develop/headers/be/be_apps/Tracker", 0, 0, 0 },\
179 { "/boot/develop/headers/be/drivers/tty", 0, 0, 0 },\
180 { "/boot/develop/headers/be/net/netinet", 0, 0, 0 },\
181 { "/boot/develop/headers/be/storage", 0, 0, 0 },\
182 { "/boot/develop/headers/be", 0, 0, 0 },\
183 { "/boot/develop/headers/cpp", 0, 0, 0 },\
184 { "/boot/develop/headers/posix", 0, 0, 0 },\
185 { "/boot/develop/headers", 0, 0, 0 }, \
186 { 0, 0, 0, 0 } \
188 #else /* CROSS_COMPILE */
189 #undef INCLUDE_DEFAULTS
190 #define INCLUDE_DEFAULTS \
192 { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },\
193 { GCC_INCLUDE_DIR, "GCC", 0, 0 },\
194 { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1}, \
195 { CROSS_INCLUDE_DIR "/be/add-ons/graphics", 0, 0, 0 },\
196 { CROSS_INCLUDE_DIR "/be/devel", 0, 0, 0 },\
197 { CROSS_INCLUDE_DIR "/be/translation", 0, 0, 0 },\
198 { CROSS_INCLUDE_DIR "/be/mail", 0, 0, 0 },\
199 { CROSS_INCLUDE_DIR "/gnu", 0, 0, 0 },\
200 { CROSS_INCLUDE_DIR "/be/drivers", 0, 0, 0 },\
201 { CROSS_INCLUDE_DIR "/be/opengl", 0, 0, 0 },\
202 { CROSS_INCLUDE_DIR "/be/game", 0, 0, 0 },\
203 { CROSS_INCLUDE_DIR "/be/support", 0, 0, 0 },\
204 { CROSS_INCLUDE_DIR "/be/storage", 0, 0, 0 },\
205 { CROSS_INCLUDE_DIR "/be/kernel", 0, 0, 0 },\
206 { CROSS_INCLUDE_DIR "/be/net", 0, 0, 0 },\
207 { CROSS_INCLUDE_DIR "/be/midi", 0, 0, 0 },\
208 { CROSS_INCLUDE_DIR "/be/midi2", 0, 0, 0 },\
209 { CROSS_INCLUDE_DIR "/be/media", 0, 0, 0 },\
210 { CROSS_INCLUDE_DIR "/be/interface", 0, 0, 0 },\
211 { CROSS_INCLUDE_DIR "/be/device", 0, 0, 0 },\
212 { CROSS_INCLUDE_DIR "/be/app", 0, 0, 0 },\
213 { CROSS_INCLUDE_DIR "/be/precompiled", 0, 0, 0 },\
214 { CROSS_INCLUDE_DIR "/be/add-ons/input_server", 0, 0, 0 },\
215 { CROSS_INCLUDE_DIR "/be/add-ons/net_server", 0, 0, 0 },\
216 { CROSS_INCLUDE_DIR "/be/add-ons/screen_saver", 0, 0, 0 },\
217 { CROSS_INCLUDE_DIR "/be/add-ons/tracker", 0, 0, 0 },\
218 { CROSS_INCLUDE_DIR "/be/be_apps/Deskbar", 0, 0, 0 },\
219 { CROSS_INCLUDE_DIR "/be/be_apps/NetPositive", 0, 0, 0 },\
220 { CROSS_INCLUDE_DIR "/be/be_apps/Tracker", 0, 0, 0 },\
221 { CROSS_INCLUDE_DIR "/be/drivers/tty", 0, 0, 0 },\
222 { CROSS_INCLUDE_DIR "/be/net/netinet", 0, 0, 0 },\
223 { CROSS_INCLUDE_DIR "/be/storage", 0, 0, 0 },\
224 { CROSS_INCLUDE_DIR "/be", 0, 0, 0 },\
225 { CROSS_INCLUDE_DIR "/cpp", 0, 0, 0 },\
226 { CROSS_INCLUDE_DIR "/posix", 0, 0, 0 },\
227 { CROSS_INCLUDE_DIR , 0, 0, 0 }, \
228 { 0, 0, 0, 0 } \
230 #endif
232 /* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will
233 cause nasty problems if we override it. */
234 #define LIBRARY_PATH_ENV "BELIBRARIES"
236 /* BeOS doesn't have a separate math library. */
237 #define MATH_LIBRARY ""
239 /* BeOS headers are C++-aware (and often use C++). */
240 #define NO_IMPLICIT_EXTERN_C
242 /* Define this macro if in some cases global symbols from one translation
243 unit may not be bound to undefined symbols in another translation unit
244 without user intervention. For instance, under Microsoft Windows
245 symbols must be explicitly imported from shared libraries (DLLs). */
246 #define MULTIPLE_SYMBOL_SPACES