1 /* Base configuration file for all FreeBSD targets.
2 Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2009 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 Under Section 7 of GPL version 3, you are granted additional
17 permissions described in the GCC Runtime Library Exception, version
18 3.1, as published by the Free Software Foundation.
20 You should have received a copy of the GNU General Public License and
21 a copy of the GCC Runtime Library Exception along with this program;
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 <http://www.gnu.org/licenses/>. */
25 /* Common DragonFly configuration.
26 All DragonFly architectures should include this file, which will specify
29 Adapted from gcc/config/freebsd-spec.h by
30 Joerg Sonnenberger <joerg@bec.de>
32 Adapted from gcc/config/freebsd.h by
33 David O'Brien <obrien@FreeBSD.org>
34 Loren J. Rittle <ljrittle@acm.org>. */
37 /* This defines which switch letters take arguments. On DragonFly, most of
38 the normal cases (defined in gcc.c) apply, and we also have -h* and
39 -z* options (for the linker) (coming from SVR4).
40 We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
42 #define DFBSD_SWITCH_TAKES_ARG(CHAR) \
43 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
45 || (CHAR) == 'z' /* ignored by ld */ \
48 /* This defines which multi-letter switches take arguments. */
50 #define DFBSD_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"))
56 #define DFBSD_TARGET_OS_CPP_BUILTINS() \
59 builtin_define_with_int_value ("__DragonFly__", DFBSD_MAJOR); \
60 builtin_define_std ("unix"); \
61 builtin_define ("__KPRINTF_ATTRIBUTE__"); \
62 builtin_assert ("system=unix"); \
63 builtin_assert ("system=bsd"); \
64 builtin_assert ("system=DragonFly"); \
65 DFBSD_NATIVE_TARGET_OS_CPP_BUILTINS(); \
66 DFBSD_TARGET_CPU_CPP_BUILTINS(); \
70 /* Define the default DragonFly-specific per-CPU hook code. */
71 #define DFBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0)
73 #ifndef DFBSD_NATIVE_TARGET_OS_CPP_BUILTINS
74 #define DFBSD_NATIVE_TARGET_OS_CPP_BUILTINS() \
78 /* Provide a CPP_SPEC appropriate for DragonFly. We just deal with the GCC
79 option `-posix', and PIC issues. */
81 #define DFBSD_CPP_SPEC " \
84 %{posix:-D_POSIX_SOURCE}"
86 /* Provide a STARTFILE_SPEC appropriate for DragonFly. Here we add
87 the magical crtbegin.o file (see crtstuff.c) which provides part
88 of the support for getting C++ file-scope static object constructed
89 before entering `main'. */
91 #define DFBSD_STARTFILE_SPEC \
93 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
94 %{!p:%{profile:gcrt1.o%s} \
95 %{!profile:crt1.o%s}}}} \
96 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
98 /* Provide a ENDFILE_SPEC appropriate for DragonFly. Here we tack on
99 the magical crtend.o file (see crtstuff.c) which provides part of
100 the support for getting C++ file-scope static object constructed
101 before entering `main', followed by a normal "finalizer" file,
104 #define DFBSD_ENDFILE_SPEC \
105 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
107 /* Provide a LIB_SPEC appropriate for DragonFly.
108 Just always link -lc and allow -pthread to be an alias for -lpthread
111 #define DFBSD_LIB_SPEC " \
112 %{pthread:-lpthread} \
116 #define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
118 #if defined(HAVE_LD_EH_FRAME_HDR)
119 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
122 /* Use --as-needed -lgcc_s for eh support. */
123 #ifdef HAVE_LD_AS_NEEDED
124 #define USE_LD_AS_NEEDED 1