Deleted Added
full compact
freebsd.h (73243) freebsd.h (73304)
1/* Base configuration file for all FreeBSD targets.
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)

--- 9 unchanged lines hidden (view full) ---

18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
20
21/* Common FreeBSD configuration.
22 All FreeBSD architectures should include this file, which will specify
23 their commonalities.
24 Adapted from /usr/src/contrib/gcc/config/i386/freebsd.h,
25 /usr/src/contrib/gcc/config/svr4.h &
1/* Base configuration file for all FreeBSD targets.
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)

--- 9 unchanged lines hidden (view full) ---

18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
20
21/* Common FreeBSD configuration.
22 All FreeBSD architectures should include this file, which will specify
23 their commonalities.
24 Adapted from /usr/src/contrib/gcc/config/i386/freebsd.h,
25 /usr/src/contrib/gcc/config/svr4.h &
26 egcs/gcc/config/i386/freebsd-elf.h version by David O'Brien */
26 egcs/gcc/config/i386/freebsd-elf.h by
27 David O'Brien <obrien@FreeBSD.org>. */
27
28
28/* $FreeBSD: head/contrib/gcc/config/freebsd.h 73243 2001-02-28 22:37:32Z obrien $ */
29/* $FreeBSD: head/contrib/gcc/config/freebsd.h 73304 2001-03-02 02:42:42Z obrien $ */
29
30
31/* Cpp, assembler, linker, library, and startfile spec's. */
32
33/* This defines which switch letters take arguments. On FreeBSD, most of
34 the normal cases (defined in gcc.c) apply, and we also have -h* and
35 -z* options (for the linker) (coming from SVR4).
36 We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
37
30
31
32/* Cpp, assembler, linker, library, and startfile spec's. */
33
34/* This defines which switch letters take arguments. On FreeBSD, most of
35 the normal cases (defined in gcc.c) apply, and we also have -h* and
36 -z* options (for the linker) (coming from SVR4).
37 We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
38
38#define FBSD_SWITCH_TAKES_ARG(CHAR) \
39 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
40 || (CHAR) == 'h' \
41 || (CHAR) == 'z' /* ignored by ld */ \
42 || (CHAR) == 'R')
39#define FBSD_SWITCH_TAKES_ARG(CHAR) \
40 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
41 || (CHAR) == 'h' \
42 || (CHAR) == 'z' /* ignored by ld */ \
43 || (CHAR) == 'R')
43
44#undef SWITCH_TAKES_ARG
44
45#undef SWITCH_TAKES_ARG
45#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR))
46#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR))
46
47/* This defines which multi-letter switches take arguments. */
48
49#define FBSD_WORD_SWITCH_TAKES_ARG(STR) \
50 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
51 || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \
52 || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \
53 || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
54
55#undef WORD_SWITCH_TAKES_ARG
47
48/* This defines which multi-letter switches take arguments. */
49
50#define FBSD_WORD_SWITCH_TAKES_ARG(STR) \
51 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
52 || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \
53 || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \
54 || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
55
56#undef WORD_SWITCH_TAKES_ARG
56#define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR))
57#define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR))
57
58/* Place spaces around this string. We depend on string splicing to produce
59 the final CPP_PREDEFINES value. */
58
59/* Place spaces around this string. We depend on string splicing to produce
60 the final CPP_PREDEFINES value. */
60#define FBSD_CPP_PREDEFINES " -Dunix -D__FreeBSD__=5 -D__FreeBSD_cc_version=500002 -Asystem(unix) -Asystem(FreeBSD) "
61
61
62#define FBSD_CPP_PREDEFINES \
63 " -D__FreeBSD__=5 -D__FreeBSD_cc_version=500002 -Dunix -Asystem(unix) -Asystem(FreeBSD) "
64
62#define FBSD_CPP_SPEC " \
63 %(cpp_cpu) \
64 %{!maout: -D__ELF__} \
65 %{munderscores: -D__UNDERSCORES__} \
66 %{maout: %{!mno-underscores: -D__UNDERSCORES__}} \
67 %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
68 %{posix:-D_POSIX_SOURCE}"
69
70#undef CPP_SPEC
71#define CPP_SPEC FBSD_CPP_SPEC
72
73/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
65#define FBSD_CPP_SPEC " \
66 %(cpp_cpu) \
67 %{!maout: -D__ELF__} \
68 %{munderscores: -D__UNDERSCORES__} \
69 %{maout: %{!mno-underscores: -D__UNDERSCORES__}} \
70 %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
71 %{posix:-D_POSIX_SOURCE}"
72
73#undef CPP_SPEC
74#define CPP_SPEC FBSD_CPP_SPEC
75
76/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
74 libc, depending on whether we're doing profiling. Add the appropriate
75 libc_r if supporting threads.
76 (like the default, except no -lg, and no -p). */
77 libc, depending on whether we're doing profiling or need threads support.
78 (simular to the default, except no -lg, and no -p). */
79
77#undef LIB_SPEC
78#define LIB_SPEC " \
79 %{!shared: \
80 %{!pg: %{pthread:-lc_r} -lc} \
81 %{pg: %{pthread:-lc_r_p} -lc_p} \
82 }"
83
84

--- 43 unchanged lines hidden (view full) ---

128
129#undef USER_LABEL_PREFIX
130#define USER_LABEL_PREFIX ""
131
132/* Handle #pragma weak and #pragma pack. */
133#undef HANDLE_SYSV_PRAGMA
134#define HANDLE_SYSV_PRAGMA
135
80#undef LIB_SPEC
81#define LIB_SPEC " \
82 %{!shared: \
83 %{!pg: %{pthread:-lc_r} -lc} \
84 %{pg: %{pthread:-lc_r_p} -lc_p} \
85 }"
86
87

--- 43 unchanged lines hidden (view full) ---

131
132#undef USER_LABEL_PREFIX
133#define USER_LABEL_PREFIX ""
134
135/* Handle #pragma weak and #pragma pack. */
136#undef HANDLE_SYSV_PRAGMA
137#define HANDLE_SYSV_PRAGMA
138
136/* FreeBSD ELF using our home-grown crtbegin.o/crtend.o does not support the
137 DWARF2 unwinding mechanisms. Once `make world' bootstraping problems with
138 the EGCS crtstuff.c is overcome, we will switch to the non-sjlj-exceptions
139 type exception machanism. */
139/* FreeBSD ELF uses across the board will now use DWARF2 unwinding as the IA-64
140 psABI requires it. */
140#define DWARF2_UNWIND_INFO 0
141
142/* Do not use ``thunks'' to implement C++ vtables. This method still has
143 fatal bugs. Also, GCC 3.0 will have a new C++ ABI that may not even
144 support `thunks'. */
145#undef DEFAULT_VTABLE_THUNKS
146
147
148/************************[ Assembler stuff ]********************************/
149
150/* Override the default comment-starter of "/". */
151#undef ASM_COMMENT_START
152#define ASM_COMMENT_START "#"
153
154/* Attach a special .ident directive to the end of the file to identify
141#define DWARF2_UNWIND_INFO 0
142
143/* Do not use ``thunks'' to implement C++ vtables. This method still has
144 fatal bugs. Also, GCC 3.0 will have a new C++ ABI that may not even
145 support `thunks'. */
146#undef DEFAULT_VTABLE_THUNKS
147
148
149/************************[ Assembler stuff ]********************************/
150
151/* Override the default comment-starter of "/". */
152#undef ASM_COMMENT_START
153#define ASM_COMMENT_START "#"
154
155/* Attach a special .ident directive to the end of the file to identify
155 the version of GCC which compiled this code. The format of the
156 .ident string is patterned after the ones produced by native SVR4
157 C compilers. */
156 the version of GCC which compiled this code. The format of the .ident
157 string is patterned after the ones produced by native SVR4 C compilers. */
158
159#undef IDENT_ASM_OP
160#define IDENT_ASM_OP "\t.ident\t"
161
162/* Output #ident as a .ident. */
163
164#undef ASM_OUTPUT_IDENT
158
159#undef IDENT_ASM_OP
160#define IDENT_ASM_OP "\t.ident\t"
161
162/* Output #ident as a .ident. */
163
164#undef ASM_OUTPUT_IDENT
165#define ASM_OUTPUT_IDENT(FILE, NAME) \
165#define ASM_OUTPUT_IDENT(FILE, NAME) \
166 fprintf ((FILE), "%s\"%s\"\n", IDENT_ASM_OP, (NAME));
167
168/* Identify the front-end which produced this file. To keep symbol
169 space down, and not confuse kdb, only do this if the language is
170 not C. (svr4.h defines ASM_IDENTIFY_GCC but neglects this) */
171
172#undef ASM_IDENTIFY_LANGUAGE
173#define ASM_IDENTIFY_LANGUAGE(FILE) \

--- 21 unchanged lines hidden (view full) ---

195#define ASM_BYTE_OP "\t.byte\t"
196
197/* This is how to allocate empty space in some section. The .zero
198 pseudo-op is used for this on most ELF assemblers. */
199
200#undef SKIP_ASM_OP
201#define SKIP_ASM_OP "\t.zero\t"
202
166 fprintf ((FILE), "%s\"%s\"\n", IDENT_ASM_OP, (NAME));
167
168/* Identify the front-end which produced this file. To keep symbol
169 space down, and not confuse kdb, only do this if the language is
170 not C. (svr4.h defines ASM_IDENTIFY_GCC but neglects this) */
171
172#undef ASM_IDENTIFY_LANGUAGE
173#define ASM_IDENTIFY_LANGUAGE(FILE) \

--- 21 unchanged lines hidden (view full) ---

195#define ASM_BYTE_OP "\t.byte\t"
196
197/* This is how to allocate empty space in some section. The .zero
198 pseudo-op is used for this on most ELF assemblers. */
199
200#undef SKIP_ASM_OP
201#define SKIP_ASM_OP "\t.zero\t"
202
203/* How to output some space. The rules are different depending on the
204 object format. */
205#undef ASM_OUTPUT_SKIP
206#define ASM_OUTPUT_SKIP(FILE, SIZE) \
207 do { \
208 if (TARGET_ELF) \
209 { \
210 fprintf ((FILE), "%s%u\n", SKIP_ASM_OP, (SIZE)); \
211 } \
212 else \
213 { \
214 fprintf ((FILE), "\t.space\t%u\n", (SIZE)); \
215 } \
216 } while (0)
217
218/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
219 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
220 corresponds to a particular byte value [0..255]. For any
221 given byte value, if the value in the corresponding table
222 position is zero, the given character can be output directly.
223 If the table value is 1, the byte must be output as a \ooo
224 octal escape. If the tables value is anything else, then the
225 byte value should be output as a \ followed by the value

--- 45 unchanged lines hidden (view full) ---

271/* This says how to output assembler code to declare an
272 uninitialized external linkage data object. Under SVR4/ELF,
273 the linker seems to want the alignment of data objects
274 to depend on their types. We do exactly that here. */
275
276#undef COMMON_ASM_OP
277#define COMMON_ASM_OP "\t.comm\t"
278
203/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
204 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
205 corresponds to a particular byte value [0..255]. For any
206 given byte value, if the value in the corresponding table
207 position is zero, the given character can be output directly.
208 If the table value is 1, the byte must be output as a \ooo
209 octal escape. If the tables value is anything else, then the
210 byte value should be output as a \ followed by the value

--- 45 unchanged lines hidden (view full) ---

256/* This says how to output assembler code to declare an
257 uninitialized external linkage data object. Under SVR4/ELF,
258 the linker seems to want the alignment of data objects
259 to depend on their types. We do exactly that here. */
260
261#undef COMMON_ASM_OP
262#define COMMON_ASM_OP "\t.comm\t"
263
279#undef ASM_OUTPUT_ALIGNED_COMMON
280#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
281 do { \
282 if (TARGET_ELF) \
283 { \
284 fprintf ((FILE), "%s", COMMON_ASM_OP); \
285 assemble_name ((FILE), (NAME)); \
286 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
287 } \
288 else \
289 { \
290 int rounded = (SIZE); \
291 if (rounded == 0) rounded = 1; \
292 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \
293 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \
294 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \
295 fprintf ((FILE), "%s ", COMMON_ASM_OP); \
296 assemble_name ((FILE), (NAME)); \
297 fprintf ((FILE), ",%u\n", (rounded)); \
298 } \
299 } while (0)
300
301/* This says how to output assembler code to declare an
302 uninitialized internal linkage data object. Under SVR4/ELF,
303 the linker seems to want the alignment of data objects
304 to depend on their types. We do exactly that here. */
305
306#undef LOCAL_ASM_OP
307#define LOCAL_ASM_OP "\t.local\t"
308
264/* This says how to output assembler code to declare an
265 uninitialized internal linkage data object. Under SVR4/ELF,
266 the linker seems to want the alignment of data objects
267 to depend on their types. We do exactly that here. */
268
269#undef LOCAL_ASM_OP
270#define LOCAL_ASM_OP "\t.local\t"
271
309/* This says how to output assembler code to declare an
310 uninitialized internal linkage data object. Under SVR4,
311 the linker seems to want the alignment of data objects
312 to depend on their types. We do exactly that here. */
313
314#undef ASM_OUTPUT_ALIGNED_LOCAL
315#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
316 do { \
317 if (TARGET_ELF) \
318 { \
319 fprintf ((FILE), "%s", LOCAL_ASM_OP); \
320 assemble_name ((FILE), (NAME)); \
321 fprintf ((FILE), "\n"); \
322 ASM_OUTPUT_ALIGNED_COMMON ((FILE), (NAME), (SIZE), (ALIGN)); \
323 } \
324 else \
325 { \
326 int rounded = (SIZE); \
327 if (rounded == 0) rounded = 1; \
328 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \
329 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \
330 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \
331 fputs ("\t.lcomm\t", (FILE)); \
332 assemble_name ((FILE), (NAME)); \
333 fprintf ((FILE), ",%u\n", (rounded)); \
334 } \
335 } while (0)
336
337#undef ASM_OUTPUT_BEFORE_CASE_LABEL
338#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
339 ASM_OUTPUT_ALIGN ((FILE), 2);
340
341#undef ASM_OUTPUT_CASE_LABEL
342#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
343 do { \
344 ASM_OUTPUT_BEFORE_CASE_LABEL ((FILE), (PREFIX), (NUM), (JUMPTABLE)) \

--- 111 unchanged lines hidden (view full) ---

456 { \
457 if (in_section != in_dtors) \
458 { \
459 fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
460 in_section = in_dtors; \
461 } \
462 }
463
272#undef ASM_OUTPUT_BEFORE_CASE_LABEL
273#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
274 ASM_OUTPUT_ALIGN ((FILE), 2);
275
276#undef ASM_OUTPUT_CASE_LABEL
277#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
278 do { \
279 ASM_OUTPUT_BEFORE_CASE_LABEL ((FILE), (PREFIX), (NUM), (JUMPTABLE)) \

--- 111 unchanged lines hidden (view full) ---

391 { \
392 if (in_section != in_dtors) \
393 { \
394 fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
395 in_section = in_dtors; \
396 } \
397 }
398
464/* A C statement (sans semicolon) to output an element in the table of
465 global constructors. */
466#undef ASM_OUTPUT_CONSTRUCTOR
467#define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) \
468 do { \
469 if (TARGET_ELF) \
470 { \
471 ctors_section (); \
472 fprintf ((FILE), "%s ", INT_ASM_OP); \
473 assemble_name ((FILE), (NAME)); \
474 fprintf ((FILE), "\n"); \
475 } \
476 else \
477 { \
478 fprintf (asm_out_file, "%s \"%s__CTOR_LIST__\",22,0,0,", \
479 ASM_STABS_OP, (TARGET_UNDERSCORES) ? "_" : ""); \
480 assemble_name (asm_out_file, name); \
481 fputc ('\n', asm_out_file); \
482 } \
483 } while (0)
484
485/* A C statement (sans semicolon) to output an element in the table of
486 global destructors. */
487#undef ASM_OUTPUT_DESTRUCTOR
488#define ASM_OUTPUT_DESTRUCTOR(FILE, NAME) \
489 do { \
490 if (TARGET_ELF) \
491 { \
492 dtors_section (); \
493 fprintf ((FILE), "%s ", INT_ASM_OP); \
494 assemble_name ((FILE), (NAME)); \
495 fprintf ((FILE), "\n"); \
496 } \
497 else \
498 { \
499 fprintf (asm_out_file, "%s \"%s__DTOR_LIST__\",22,0,0,", \
500 ASM_STABS_OP, (TARGET_UNDERSCORES) ? "_" : ""); \
501 assemble_name (asm_out_file, name); \
502 fputc ('\n', asm_out_file); \
503 } \
504 } while (0)
505
506/* A C statement or statements to switch to the appropriate
507 section for output of RTX in mode MODE. RTX is some kind
508 of constant in RTL. The argument MODE is redundant except
509 in the case of a `const_int' rtx. Currently, these always
510 go into the const section. */
511
512#undef SELECT_RTX_SECTION
513#define SELECT_RTX_SECTION(MODE, RTX) const_section()

--- 91 unchanged lines hidden (view full) ---

605/* All ELF targets can support DWARF-2. */
606#undef DWARF2_DEBUGGING_INFO
607#define DWARF2_DEBUGGING_INFO
608
609/* This is BSD, so we want the DBX format. */
610#undef DBX_DEBUGGING_INFO
611#define DBX_DEBUGGING_INFO
612
399/* A C statement or statements to switch to the appropriate
400 section for output of RTX in mode MODE. RTX is some kind
401 of constant in RTL. The argument MODE is redundant except
402 in the case of a `const_int' rtx. Currently, these always
403 go into the const section. */
404
405#undef SELECT_RTX_SECTION
406#define SELECT_RTX_SECTION(MODE, RTX) const_section()

--- 91 unchanged lines hidden (view full) ---

498/* All ELF targets can support DWARF-2. */
499#undef DWARF2_DEBUGGING_INFO
500#define DWARF2_DEBUGGING_INFO
501
502/* This is BSD, so we want the DBX format. */
503#undef DBX_DEBUGGING_INFO
504#define DBX_DEBUGGING_INFO
505
613/* Use stabs instead of DWARF debug format. */
506/* This is BSD, so use stabs instead of DWARF debug format. */
614#undef PREFERRED_DEBUGGING_TYPE
615#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
616
617/* But allow STABS to be supported as well.
618 Note that we want to override some definition settings done for some
619 architecture's native OS's tools that don't apply to us. */
620#undef ASM_IDENTIFY_GCC
621#undef ASM_IDENTIFY_LANGUAGE
507#undef PREFERRED_DEBUGGING_TYPE
508#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
509
510/* But allow STABS to be supported as well.
511 Note that we want to override some definition settings done for some
512 architecture's native OS's tools that don't apply to us. */
513#undef ASM_IDENTIFY_GCC
514#undef ASM_IDENTIFY_LANGUAGE
622
623#include "dbxelf.h"