1 /* Base configuration file for all DragonFly targets.
2 Copyright (C) 2014-2017 Free Software Foundation, Inc.
3 Contributed by John Marino <gnugcc@marino.st>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
26 #undef TARGET_OS_CPP_BUILTINS
27 #define TARGET_OS_CPP_BUILTINS() \
30 builtin_define_std ("unix"); \
31 builtin_define ("__DragonFly__"); \
32 builtin_assert ("system=unix"); \
33 builtin_assert ("system=bsd"); \
34 builtin_assert ("system=DragonFly"); \
40 "%(cpp_cpu) %(cpp_arch) %{posix:-D_POSIX_SOURCE}"
43 #define STARTFILE_SPEC \
49 %{profile: gcrt1.o%s} \
51 %{pie: Scrt1.o%s;:crt1.o%s}}}}} \
53 %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
56 #define ENDFILE_SPEC \
57 "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
61 "%{pthread:-lpthread} -lc"
63 #if defined(HAVE_LD_EH_FRAME_HDR)
64 #define LINK_EH_SPEC "--eh-frame-hdr"
67 /* Provide a LINK_SPEC appropriate for DragonFly. Here we provide support
68 for the special GCC options -static and -shared, which allow us to
69 link things in one of these three modes by applying the appropriate
70 combinations of options at link-time.
72 When the -shared link option is used a final link is not being
75 #define DFBSD_LINK_SPEC \
76 "%{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
78 %{assert*} %{R*} %{rpath*} %{defsym*} \
79 %{shared:-Bshareable %{h*} %{soname*}} \
82 %{rdynamic:-export-dynamic} \
83 -dynamic-linker %(dfbsd_dynamic_linker) \
87 %{!static:--hash-style=gnu} \
88 %{symbolic:-Bsymbolic}"
91 #define LINK_SPEC DFBSD_LINK_SPEC
93 #define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
96 /* Use --as-needed -lgcc_s for eh support. */
97 #ifdef HAVE_LD_AS_NEEDED
98 #define USE_LD_AS_NEEDED 1
101 /************************[ Target stuff ]***********************************/
103 /* All DragonFly Architectures support the ELF object file format. */
104 #undef OBJECT_FORMAT_ELF
105 #define OBJECT_FORMAT_ELF
107 /* Don't assume anything about the header files. */
108 #undef NO_IMPLICIT_EXTERN_C
109 #define NO_IMPLICIT_EXTERN_C 1
111 /* Follow DragonFly's standard headers (<machine/stdint.h>, etc...). */
114 #define WCHAR_TYPE "int"
117 #define WINT_TYPE "int"
119 /* Code generation parameters. */
121 /* Use periods rather than dollar signs in special g++ assembler names.
122 This ensures the configuration knows our system correctly so we can link
123 with libraries compiled with the native cc. */
124 #undef NO_DOLLAR_IN_LABEL
126 /* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW.
127 This enables the test coverage code to use file locking when exiting a
128 program, which avoids race conditions if the program has forked. */
129 #define TARGET_POSIX_IO