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.2 2004/02/03 03:47:12 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>
35 /* In case we need to know. */
36 #define USING_CONFIG_FREEBSD_SPEC 1
38 /* This defines which switch letters take arguments. On DragonFly, most of
39 the normal cases (defined in gcc.c) apply, and we also have -h* and
40 -z* options (for the linker) (coming from SVR4).
41 We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
43 #define FBSD_SWITCH_TAKES_ARG(CHAR) \
44 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
46 || (CHAR) == 'z' /* ignored by ld */ \
49 /* This defines which multi-letter switches take arguments. */
51 #define FBSD_WORD_SWITCH_TAKES_ARG(STR) \
52 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
53 || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \
54 || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \
55 || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
57 #define FBSD_TARGET_OS_CPP_BUILTINS() \
60 builtin_define ("__DragonFly__=1"); \
61 builtin_define ("__DragonFly_cc_version=100001"); \
62 builtin_define_std ("unix"); \
63 builtin_define ("__ELF__"); \
64 builtin_define ("__KPRINTF_ATTRIBUTE__"); \
65 builtin_assert ("system=unix"); \
66 builtin_assert ("system=bsd"); \
67 builtin_assert ("system=DragonFly"); \
68 FBSD_NATIVE_TARGET_OS_CPP_BUILTINS(); \
69 FBSD_TARGET_CPU_CPP_BUILTINS(); \
73 /* Define the default DragonFly-specific per-CPU hook code. */
74 #define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0)
77 #define FBSD_NATIVE_TARGET_OS_CPP_BUILTINS() \
81 #define FBSD_NATIVE_TARGET_OS_CPP_BUILTINS() \
85 /* Provide a CPP_SPEC appropriate for DragonFly. We just deal with the GCC
86 option `-posix', and PIC issues. Try to detect support for the
87 `long long' type. Unfortunately the GCC spec parser will not allow us
88 to properly detect the "iso9899:1990" and "iso9899:199409" forms of
89 -std=c89. Because of the ':' in the -std argument. :-( I have left
90 them in the spec as a place holder in hopes someone knows a way to make
91 the detection of them work. */
93 #define FBSD_CPP_SPEC " \
95 %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
96 %{!ansi:%{!std=c89:%{!std=iso9899.1990:%{!std=iso9899.199409:-D_LONGLONG}}}} \
97 %{posix:-D_POSIX_SOURCE}"
99 /* Provide a STARTFILE_SPEC appropriate for DragonFly. Here we add the magical
100 crtbegin.o file (see crtstuff.c) which provides part of the support for
101 getting C++ file-scope static object constructed before entering `main'. */
103 #define FBSD_STARTFILE_SPEC "\
109 %{profile:gcrt1.o%s} \
110 %{!profile:crt1.o%s}}}} \
112 %{!shared:crtbegin.o%s} \
113 %{shared:crtbeginS.o%s}"
115 /* Provide an ENDFILE_SPEC appropriate for DragonFly/i386. Here we tack on
116 our own magical crtend.o file (see crtstuff.c) which provides part of
117 the support for getting C++ file-scope static object constructed before
118 entering `main', followed by the normal "finalizer" file, `crtn.o'. */
120 #define FBSD_ENDFILE_SPEC "\
121 %{!shared:crtend.o%s} \
122 %{shared:crtendS.o%s} \
126 /* Provide a LIB_SPEC appropriate for DragonFly as configured and as
127 required by the user-land thread model. Before __FreeBSD_version
128 500016, select the appropriate libc, depending on whether we're
129 doing profiling or need threads support. At __FreeBSD_version
130 500016 and later, thread libraries can be linked with libc. To
131 make matters interesting, we can't actually use __FreeBSD_version
132 provided by <osreldate.h> directly since it breaks cross-compiling.
133 As a final twist, make it a hard error if -pthread is provided on
134 the command line and gcc was configured with --disable-threads
135 (this will help avoid bug reports from users complaining about
136 threading when they misconfigured the gcc bootstrap but are later
137 consulting FreeBSD manual pages that refer to the mythical -pthread
140 /* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
141 libc, depending on whether we're doing profiling or need threads support.
142 (simular to the default, except no -lg, and no -p). */
144 #ifdef FBSD_NO_THREADS
145 #define FBSD_LIB_SPEC " \
146 %{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \
147 is built with the --enable-threads configure-time option.} \
153 #include <sys/param.h>
154 #if __FreeBSD_version >= 500016
155 #define FBSD_LIB_SPEC " \
157 %{!pg: %{pthread:-lc_r} -lc} \
158 %{pg: %{pthread:-lc_r_p} -lc_p} \
161 #define FBSD_LIB_SPEC " \
168 %{pthread:-lc_r_p}} \