1 |
38 |
julius |
/* Base configuration file for all FreeBSD targets.
|
2 |
|
|
Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007 Free Software Foundation, Inc.
|
3 |
|
|
|
4 |
|
|
This file is part of GCC.
|
5 |
|
|
|
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)
|
9 |
|
|
any later version.
|
10 |
|
|
|
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.
|
15 |
|
|
|
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/>. */
|
19 |
|
|
|
20 |
|
|
/* Common FreeBSD configuration.
|
21 |
|
|
All FreeBSD architectures should include this file, which will specify
|
22 |
|
|
their commonalities.
|
23 |
|
|
Adapted from gcc/config/freebsd.h by
|
24 |
|
|
David O'Brien <obrien@FreeBSD.org>
|
25 |
|
|
Loren J. Rittle <ljrittle@acm.org>. */
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
/* In case we need to know. */
|
29 |
|
|
#define USING_CONFIG_FREEBSD_SPEC 1
|
30 |
|
|
|
31 |
|
|
/* This defines which switch letters take arguments. On FreeBSD, most of
|
32 |
|
|
the normal cases (defined in gcc.c) apply, and we also have -h* and
|
33 |
|
|
-z* options (for the linker) (coming from SVR4).
|
34 |
|
|
We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
|
35 |
|
|
|
36 |
|
|
#define FBSD_SWITCH_TAKES_ARG(CHAR) \
|
37 |
|
|
(DEFAULT_SWITCH_TAKES_ARG (CHAR) \
|
38 |
|
|
|| (CHAR) == 'h' \
|
39 |
|
|
|| (CHAR) == 'z' /* ignored by ld */ \
|
40 |
|
|
|| (CHAR) == 'R')
|
41 |
|
|
|
42 |
|
|
/* This defines which multi-letter switches take arguments. */
|
43 |
|
|
|
44 |
|
|
#define FBSD_WORD_SWITCH_TAKES_ARG(STR) \
|
45 |
|
|
(DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
|
46 |
|
|
|| !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \
|
47 |
|
|
|| !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \
|
48 |
|
|
|| !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
|
49 |
|
|
|
50 |
|
|
#define FBSD_TARGET_OS_CPP_BUILTINS() \
|
51 |
|
|
do \
|
52 |
|
|
{ \
|
53 |
|
|
builtin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR); \
|
54 |
|
|
builtin_define_std ("unix"); \
|
55 |
|
|
builtin_define ("__KPRINTF_ATTRIBUTE__"); \
|
56 |
|
|
builtin_assert ("system=unix"); \
|
57 |
|
|
builtin_assert ("system=bsd"); \
|
58 |
|
|
builtin_assert ("system=FreeBSD"); \
|
59 |
|
|
FBSD_TARGET_CPU_CPP_BUILTINS(); \
|
60 |
|
|
} \
|
61 |
|
|
while (0)
|
62 |
|
|
|
63 |
|
|
/* Define the default FreeBSD-specific per-CPU hook code. */
|
64 |
|
|
#define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0)
|
65 |
|
|
|
66 |
|
|
/* Provide a CPP_SPEC appropriate for FreeBSD. We just deal with the GCC
|
67 |
|
|
option `-posix', and PIC issues. */
|
68 |
|
|
|
69 |
|
|
#define FBSD_CPP_SPEC " \
|
70 |
|
|
%(cpp_cpu) \
|
71 |
|
|
%(cpp_arch) \
|
72 |
|
|
%{posix:-D_POSIX_SOURCE}"
|
73 |
|
|
|
74 |
|
|
/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
|
75 |
|
|
the magical crtbegin.o file (see crtstuff.c) which provides part
|
76 |
|
|
of the support for getting C++ file-scope static object constructed
|
77 |
|
|
before entering `main'. */
|
78 |
|
|
|
79 |
|
|
#define FBSD_STARTFILE_SPEC \
|
80 |
|
|
"%{!shared: \
|
81 |
|
|
%{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
|
82 |
|
|
%{!p:%{profile:gcrt1.o%s} \
|
83 |
|
|
%{!profile:crt1.o%s}}}} \
|
84 |
|
|
crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
|
85 |
|
|
|
86 |
|
|
/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
|
87 |
|
|
the magical crtend.o file (see crtstuff.c) which provides part of
|
88 |
|
|
the support for getting C++ file-scope static object constructed
|
89 |
|
|
before entering `main', followed by a normal "finalizer" file,
|
90 |
|
|
`crtn.o'. */
|
91 |
|
|
|
92 |
|
|
#define FBSD_ENDFILE_SPEC \
|
93 |
|
|
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
|
94 |
|
|
|
95 |
|
|
/* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
|
96 |
|
|
required by the user-land thread model. Before __FreeBSD_version
|
97 |
|
|
500016, select the appropriate libc, depending on whether we're
|
98 |
|
|
doing profiling or need threads support. At __FreeBSD_version
|
99 |
|
|
500016 and later, when threads support is requested include both
|
100 |
|
|
-lc and the threading lib instead of only -lc_r. To make matters
|
101 |
|
|
interesting, we can't actually use __FreeBSD_version provided by
|
102 |
|
|
<osreldate.h> directly since it breaks cross-compiling. As a final
|
103 |
|
|
twist, make it a hard error if -pthread is provided on the command
|
104 |
|
|
line and gcc was configured with --disable-threads (this will help
|
105 |
|
|
avoid bug reports from users complaining about threading when they
|
106 |
|
|
misconfigured the gcc bootstrap but are later consulting FreeBSD
|
107 |
|
|
manual pages that refer to the mythical -pthread option). */
|
108 |
|
|
|
109 |
|
|
/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
|
110 |
|
|
libc, depending on whether we're doing profiling or need threads support.
|
111 |
|
|
(similar to the default, except no -lg, and no -p). */
|
112 |
|
|
|
113 |
|
|
#ifdef FBSD_NO_THREADS
|
114 |
|
|
#define FBSD_LIB_SPEC " \
|
115 |
|
|
%{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \
|
116 |
|
|
is built with the --enable-threads configure-time option.} \
|
117 |
|
|
%{!shared: \
|
118 |
|
|
%{!pg: -lc} \
|
119 |
|
|
%{pg: -lc_p} \
|
120 |
|
|
}"
|
121 |
|
|
#else
|
122 |
|
|
#if FBSD_MAJOR < 5
|
123 |
|
|
#define FBSD_LIB_SPEC " \
|
124 |
|
|
%{!shared: \
|
125 |
|
|
%{!pg: \
|
126 |
|
|
%{!pthread:-lc} \
|
127 |
|
|
%{pthread:-lc_r}} \
|
128 |
|
|
%{pg: \
|
129 |
|
|
%{!pthread:-lc_p} \
|
130 |
|
|
%{pthread:-lc_r_p}} \
|
131 |
|
|
}"
|
132 |
|
|
#else
|
133 |
|
|
#define FBSD_LIB_SPEC " \
|
134 |
|
|
%{!shared: \
|
135 |
|
|
%{!pg: %{pthread:-lpthread} -lc} \
|
136 |
|
|
%{pg: %{pthread:-lpthread_p} -lc_p} \
|
137 |
|
|
}"
|
138 |
|
|
#endif
|
139 |
|
|
#endif
|
140 |
|
|
|
141 |
|
|
#if FBSD_MAJOR < 6
|
142 |
|
|
#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
|
143 |
|
|
#else
|
144 |
|
|
#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
|
145 |
|
|
#endif
|