1 /* Base configuration file for all DragonFly targets.
2 Copyright (C) 1999, 2000, 2001, 2007, 2008 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC 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 3, or (at your option)
11 GCC 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 GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 /* Common DragonFly configuration.
21 All DragonFly architectures should include this file, which will specify
24 Adapted from gcc/config/freebsd.h by
25 Joerg Sonnenberger <joerg@bec.de>
27 Adapted from gcc/config/i386/freebsd-elf.h by
28 David O'Brien <obrien@FreeBSD.org>.
29 Further work by David O'Brien <obrien@FreeBSD.org> and
30 Loren J. Rittle <ljrittle@acm.org>. */
33 /* This defines which switch letters take arguments. On DragonFly, 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. */
38 #undef SWITCH_TAKES_ARG
39 #define SWITCH_TAKES_ARG(CHAR) \
40 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
42 || (CHAR) == 'z' /* ignored by ld */ \
46 #undef WORD_SWITCH_TAKES_ARG
47 #define WORD_SWITCH_TAKES_ARG(STR) \
48 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
49 || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \
50 || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \
51 || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
54 #undef TARGET_OS_CPP_BUILTINS
55 #define TARGET_OS_CPP_BUILTINS() \
58 builtin_define ("__DragonFly__"); \
59 builtin_define_std ("unix"); \
60 builtin_assert ("system=unix"); \
61 builtin_assert ("system=bsd"); \
62 builtin_assert ("system=DragonFly"); \
70 %{posix:-D_POSIX_SOURCE}"
73 #define STARTFILE_SPEC \
75 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
76 %{!p:%{profile:gcrt1.o%s} \
77 %{!profile:crt1.o%s}}}} \
78 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
81 #define ENDFILE_SPEC \
82 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
86 %{pthread:-lpthread} \
90 /* Provide a LINK_SPEC appropriate for DragonFly. Here we provide support
91 for the special GCC options -static and -shared, which allow us to
92 link things in one of these three modes by applying the appropriate
93 combinations of options at link-time. We like to support here for
94 as many of the other GNU linker options as possible. But I don't
95 have the time to search for those flags. I am sure how to add
96 support for -soname shared_object_name. H.J.
98 I took out %{v:%{!V:-V}}. It is too much :-(. They can use
101 When the -shared link option is used a final link is not being
104 #define DFBSD_LINK_SPEC "\
105 %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
107 %{assert*} %{R*} %{rpath*} %{defsym*} \
108 %{shared:-Bshareable %{h*} %{soname*}} \
111 %{rdynamic:-export-dynamic} \
112 %{!dynamic-linker:-dynamic-linker %(dfbsd_dynamic_linker) }} \
113 %{static:-Bstatic}} \
114 %{symbolic:-Bsymbolic}"
117 #define LINK_SPEC DFBSD_LINK_SPEC
119 /* Define this so we can compile MS code for use with WINE. */
120 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
122 #define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
124 #if defined(HAVE_LD_EH_FRAME_HDR)
125 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
128 /* Use --as-needed -lgcc_s for eh support. */
129 #ifdef HAVE_LD_AS_NEEDED
130 #define USE_LD_AS_NEEDED 1
133 /************************[ Target stuff ]***********************************/
135 /* All DragonFly Architectures support the ELF object file format. */
136 #undef OBJECT_FORMAT_ELF
137 #define OBJECT_FORMAT_ELF
139 /* Don't assume anything about the header files. */
140 #undef NO_IMPLICIT_EXTERN_C
141 #define NO_IMPLICIT_EXTERN_C 1
143 /* Make gcc agree with DragonFly's standard headers (<machine/stdint.h>, etc...) */
146 #define WCHAR_TYPE "int"
148 /* Code generation parameters. */
150 /* Use periods rather than dollar signs in special g++ assembler names.
151 This ensures the configuration knows our system correctly so we can link
152 with libraries compiled with the native cc. */
153 #undef NO_DOLLAR_IN_LABEL
155 /* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW.
156 This enables the test coverage code to use file locking when exiting a
157 program, which avoids race conditions if the program has forked. */
158 #define TARGET_POSIX_IO