Dynamic root: Move ld-elf.so.2 to /libexec
[dragonfly.git] / contrib / gcc-4.7 / gcc / config / dragonfly.h
CommitLineData
fdc4107c
JM
1/* Base configuration file for all DragonFly targets.
2 Copyright (C) 1999, 2000, 2001, 2007, 2008 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 3, or (at your option)
9any later version.
10
11GCC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20/* Common DragonFly configuration.
21 All DragonFly architectures should include this file, which will specify
22 their commonalities.
23 Adapted from gcc/config/i386/freebsd-elf.h by
24 David O'Brien <obrien@FreeBSD.org>.
25 Further work by David O'Brien <obrien@FreeBSD.org> and
26 Loren J. Rittle <ljrittle@acm.org>. */
27
28#undef TARGET_OS_CPP_BUILTINS
29#define TARGET_OS_CPP_BUILTINS() \
30 do \
31 { \
32 builtin_define_std ("unix"); \
33 builtin_define ("__DragonFly__"); \
34 builtin_assert ("system=unix"); \
35 builtin_assert ("system=bsd"); \
36 builtin_assert ("system=DragonFly"); \
37 } \
38 while (0)
39
40#undef CPP_SPEC
41#define CPP_SPEC \
42 "%(cpp_cpu) %(cpp_arch) %{posix:-D_POSIX_SOURCE}"
43
44#undef STARTFILE_SPEC
45#define STARTFILE_SPEC \
46 "%{!shared: \
47 %{pg:gcrt1.o%s} \
48 %{!pg: \
49 %{p:gcrt1.o%s} \
50 %{!p: \
51 %{profile: gcrt1.o%s} \
52 %{!profile: \
53 %{pie: Scrt1.o%s;:crt1.o%s}}}}} \
54 crti.o%s \
55 %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
56
57#undef ENDFILE_SPEC
58#define ENDFILE_SPEC \
59 "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
60
61#undef LIB_SPEC
62#define LIB_SPEC \
63 "%{pthread:-lpthread} -lc"
64
65#if defined(HAVE_LD_EH_FRAME_HDR)
66#define LINK_EH_SPEC "--eh-frame-hdr"
67#endif
68
69/* Provide a LINK_SPEC appropriate for DragonFly. Here we provide support
70 for the special GCC options -static and -shared, which allow us to
71 link things in one of these three modes by applying the appropriate
72 combinations of options at link-time.
73
74 When the -shared link option is used a final link is not being
75 done. */
76
77#define DFBSD_LINK_SPEC \
78 "%{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
79 %{v:-V} \
80 %{assert*} %{R*} %{rpath*} %{defsym*} \
81 %{shared:-Bshareable %{h*} %{soname*}} \
82 %{!shared: \
83 %{!static: \
84 %{rdynamic:-export-dynamic} \
85 -dynamic-linker %(dfbsd_dynamic_linker) \
86 } \
87 %{static:-Bstatic} \
88 } \
89 %{!static:--hash-style=both} \
90 %{symbolic:-Bsymbolic}"
91
92#undef LINK_SPEC
93#define LINK_SPEC DFBSD_LINK_SPEC
94
16dbe6a9 95#define DFBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.2"
fdc4107c
JM
96
97
98/* Use --as-needed -lgcc_s for eh support. */
99#ifdef HAVE_LD_AS_NEEDED
100#define USE_LD_AS_NEEDED 1
101#endif
102
103/************************[ Target stuff ]***********************************/
104
105/* All DragonFly Architectures support the ELF object file format. */
106#undef OBJECT_FORMAT_ELF
107#define OBJECT_FORMAT_ELF
108
109/* Don't assume anything about the header files. */
110#undef NO_IMPLICIT_EXTERN_C
111#define NO_IMPLICIT_EXTERN_C 1
112
113/* Follow DragonFly's standard headers (<machine/stdint.h>, etc...). */
114
115#undef WCHAR_TYPE
116#define WCHAR_TYPE "int"
117
118#undef WINT_TYPE
119#define WINT_TYPE "int"
120
121/*
122 * Profile libraries are found at /usr/lib/profile with standard names
123 * #define MATH_LIBRARY_PROFILE "m_p"
124 */
125
126/* Code generation parameters. */
127
128/* Use periods rather than dollar signs in special g++ assembler names.
129 This ensures the configuration knows our system correctly so we can link
130 with libraries compiled with the native cc. */
131#undef NO_DOLLAR_IN_LABEL
132
133/* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW.
134 This enables the test coverage code to use file locking when exiting a
135 program, which avoids race conditions if the program has forked. */
136#define TARGET_POSIX_IO