1 /* Base configuration file for all DragonFly targets.
2 Copyright (C) 1999, 2000, 2001 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)
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 * $FreeBSD: src/contrib/gcc/config/freebsd-spec.h,v 1.15 2003/11/10 18:52:57 deischen Exp $
23 * $DragonFly: src/gnu/usr.bin/cc3/config/Attic/dragonfly-spec.h,v 1.1 2004/02/02 23:35:11 dillon Exp $
26 /* Common DragonFly configuration.
27 All DragonFly architectures should include this file, which will specify
29 Adapted from gcc/config/freebsd.h by
30 David O'Brien <obrien@FreeBSD.org>
31 Loren J. Rittle <ljrittle@acm.org>.
32 Adapted for Dragonfly by Matthew Dillon <dillon@backplane.com>
36 /* In case we need to know. */
37 #define USING_CONFIG_FREEBSD_SPEC 1
39 /* This defines which switch letters take arguments. On DragonFly, most of
40 the normal cases (defined in gcc.c) apply, and we also have -h* and
41 -z* options (for the linker) (coming from SVR4).
42 We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
44 #define FBSD_SWITCH_TAKES_ARG(CHAR) \
45 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
47 || (CHAR) == 'z' /* ignored by ld */ \
50 /* This defines which multi-letter switches take arguments. */
52 #define FBSD_WORD_SWITCH_TAKES_ARG(STR) \
53 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
54 || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \
55 || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \
56 || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
58 #define FBSD_TARGET_OS_CPP_BUILTINS() \
61 builtin_define ("__DragonFly__=1"); \
62 builtin_define ("__DragonFly_cc_version=100001"); \
63 builtin_define_std ("unix"); \
64 builtin_define ("__ELF__"); \
65 builtin_define ("__KPRINTF_ATTRIBUTE__"); \
66 builtin_assert ("system=unix"); \
67 builtin_assert ("system=bsd"); \
68 builtin_assert ("system=DragonFly"); \
69 FBSD_NATIVE_TARGET_OS_CPP_BUILTINS(); \
70 FBSD_TARGET_CPU_CPP_BUILTINS(); \
74 /* Define the default DragonFly-specific per-CPU hook code. */
75 #define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0)
78 #define FBSD_NATIVE_TARGET_OS_CPP_BUILTINS() \
82 #define FBSD_NATIVE_TARGET_OS_CPP_BUILTINS() \
86 /* Provide a CPP_SPEC appropriate for DragonFly. We just deal with the GCC
87 option `-posix', and PIC issues. Try to detect support for the
88 `long long' type. Unfortunately the GCC spec parser will not allow us
89 to properly detect the "iso9899:1990" and "iso9899:199409" forms of
90 -std=c89. Because of the ':' in the -std argument. :-( I have left
91 them in the spec as a place holder in hopes someone knows a way to make
92 the detection of them work. */
94 #define FBSD_CPP_SPEC " \
96 %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
97 %{!ansi:%{!std=c89:%{!std=iso9899.1990:%{!std=iso9899.199409:-D_LONGLONG}}}} \
98 %{posix:-D_POSIX_SOURCE}"
100 /* Provide a STARTFILE_SPEC appropriate for DragonFly. Here we add the magical
101 crtbegin.o file (see crtstuff.c) which provides part of the support for
102 getting C++ file-scope static object constructed before entering `main'. */
104 #define FBSD_STARTFILE_SPEC "\
110 %{profile:gcrt1.o%s} \
111 %{!profile:crt1.o%s}}}} \
113 %{!shared:crtbegin.o%s} \
114 %{shared:crtbeginS.o%s}"
116 /* Provide an ENDFILE_SPEC appropriate for DragonFly/i386. Here we tack on
117 our own magical crtend.o file (see crtstuff.c) which provides part of
118 the support for getting C++ file-scope static object constructed before
119 entering `main', followed by the normal "finalizer" file, `crtn.o'. */
121 #define FBSD_ENDFILE_SPEC "\
122 %{!shared:crtend.o%s} \
123 %{shared:crtendS.o%s} \
127 /* Provide a LIB_SPEC appropriate for DragonFly as configured and as
128 required by the user-land thread model. Before __FreeBSD_version
129 500016, select the appropriate libc, depending on whether we're
130 doing profiling or need threads support. At __FreeBSD_version
131 500016 and later, thread libraries can be linked with libc. To
132 make matters interesting, we can't actually use __FreeBSD_version
133 provided by <osreldate.h> directly since it breaks cross-compiling.
134 As a final twist, make it a hard error if -pthread is provided on
135 the command line and gcc was configured with --disable-threads
136 (this will help avoid bug reports from users complaining about
137 threading when they misconfigured the gcc bootstrap but are later
138 consulting FreeBSD manual pages that refer to the mythical -pthread
141 /* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
142 libc, depending on whether we're doing profiling or need threads support.
143 (simular to the default, except no -lg, and no -p). */
145 #ifdef FBSD_NO_THREADS
146 #define FBSD_LIB_SPEC " \
147 %{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \
148 is built with the --enable-threads configure-time option.} \
154 #include <sys/param.h>
155 #if __FreeBSD_version >= 500016
156 #define FBSD_LIB_SPEC " \
158 %{!pg: %{pthread:-lc_r} -lc} \
159 %{pg: %{pthread:-lc_r_p} -lc_p} \
162 #define FBSD_LIB_SPEC " \
169 %{pthread:-lc_r_p}} \