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