| Commit | Line | Data |
|---|---|---|
| 53d7ad08 SS |
1 | /* Base configuration file for all DragonFly targets. |
| 2 | Copyright (C) 1999, 2000, 2001, 2007, 2008 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 | ||
| 18cb0187 | 20 | /* Common DragonFly configuration. |
| 53d7ad08 SS |
21 | All DragonFly architectures should include this file, which will specify |
| 22 | their commonalities. | |
| 23 | ||
| 24 | Adapted from gcc/config/freebsd.h by | |
| 25 | Joerg Sonnenberger <joerg@bec.de> | |
| 26 | ||
| 18cb0187 JM |
27 | Adapted from gcc/config/i386/freebsd-elf.h by |
| 28 | David O'Brien <obrien@FreeBSD.org>. | |
| 53d7ad08 SS |
29 | Further work by David O'Brien <obrien@FreeBSD.org> and |
| 30 | Loren J. Rittle <ljrittle@acm.org>. */ | |
| 31 | ||
| b4190895 SW |
32 | |
| 33 | /* This defines which switch letters take arguments. On DragonFly, most of | |
| 34 | the normal cases (defined in gcc.c) apply, and we also have -h* and | |
| 35 | -z* options (for the linker) (coming from SVR4). | |
| 36 | We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ | |
| 37 | ||
| 38 | #undef SWITCH_TAKES_ARG | |
| 39 | #define SWITCH_TAKES_ARG(CHAR) \ | |
| 40 | (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ | |
| 41 | || (CHAR) == 'h' \ | |
| 42 | || (CHAR) == 'z' /* ignored by ld */ \ | |
| 43 | || (CHAR) == 'R') | |
| 44 | ||
| 45 | ||
| 46 | #undef WORD_SWITCH_TAKES_ARG | |
| 47 | #define WORD_SWITCH_TAKES_ARG(STR) \ | |
| 48 | (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ | |
| 49 | || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \ | |
| 50 | || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ | |
| 51 | || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) | |
| 52 | ||
| 1cc7b376 | 53 | #define HANDLE_PRAGMA_PACK_PUSH_POP 1 |
| b4190895 | 54 | |
| 18cb0187 | 55 | /* JRM: 15 Nov 2010 |
| b4190895 SW |
56 | SWITCH_TAKES_ARG & WORD_SWITCH_TAKES_ARG removed due to poisoning |
| 57 | prior to gcc 4.6.0 release. Replaced with dragonfly.opt. | |
| 18cb0187 | 58 | http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02102.html |
| 1cc7b376 JM |
59 | http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02373.html |
| 60 | ||
| 61 | HANDLE_PRAGMA_PACK_PUSH_POP poisoned by GCC 4.6.0 | |
| 62 | http://gcc.gnu.org/ml/gcc-patches/2010-11/msg02106.html */ | |
| 18cb0187 | 63 | |
| 53d7ad08 | 64 | #undef TARGET_OS_CPP_BUILTINS |
| 18cb0187 JM |
65 | #define TARGET_OS_CPP_BUILTINS() \ |
| 66 | do \ | |
| 67 | { \ | |
| 68 | builtin_define_std ("unix"); \ | |
| 69 | builtin_define ("__DragonFly__"); \ | |
| 70 | builtin_assert ("system=unix"); \ | |
| 71 | builtin_assert ("system=bsd"); \ | |
| 72 | builtin_assert ("system=DragonFly"); \ | |
| 73 | } \ | |
| 53d7ad08 SS |
74 | while (0) |
| 75 | ||
| 76 | #undef CPP_SPEC | |
| 18cb0187 JM |
77 | #define CPP_SPEC \ |
| 78 | "%(cpp_cpu) %(cpp_arch) %{posix:-D_POSIX_SOURCE}" | |
| 53d7ad08 SS |
79 | |
| 80 | #undef STARTFILE_SPEC | |
| 81 | #define STARTFILE_SPEC \ | |
| 82 | "%{!shared: \ | |
| e101389c JM |
83 | %{pg:gcrt1.o%s} \ |
| 84 | %{!pg: \ | |
| 85 | %{p:gcrt1.o%s} \ | |
| 86 | %{!p: \ | |
| 87 | %{profile: gcrt1.o%s} \ | |
| 88 | %{!profile: \ | |
| 89 | %{pie: Scrt1.o%s;:crt1.o%s}}}}} \ | |
| 90 | crti.o%s \ | |
| 91 | %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}" | |
| 53d7ad08 SS |
92 | |
| 93 | #undef ENDFILE_SPEC | |
| 18cb0187 | 94 | #define ENDFILE_SPEC \ |
| e101389c | 95 | "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" |
| 53d7ad08 SS |
96 | |
| 97 | #undef LIB_SPEC | |
| 18cb0187 JM |
98 | #define LIB_SPEC \ |
| 99 | "%{pthread:-lpthread} -lc" | |
| 53d7ad08 SS |
100 | |
| 101 | /* Provide a LINK_SPEC appropriate for DragonFly. Here we provide support | |
| 102 | for the special GCC options -static and -shared, which allow us to | |
| 103 | link things in one of these three modes by applying the appropriate | |
| 18cb0187 | 104 | combinations of options at link-time. |
| 53d7ad08 SS |
105 | |
| 106 | When the -shared link option is used a final link is not being | |
| 107 | done. */ | |
| 108 | ||
| 1617af9c | 109 | #define DFBSD_LINK_SPEC \ |
| 18cb0187 | 110 | "%{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \ |
| 53d7ad08 SS |
111 | %{v:-V} \ |
| 112 | %{assert*} %{R*} %{rpath*} %{defsym*} \ | |
| 113 | %{shared:-Bshareable %{h*} %{soname*}} \ | |
| 4687ecd9 JM |
114 | %{!shared: \ |
| 115 | %{!static: \ | |
| 116 | %{rdynamic:-export-dynamic} \ | |
| 117 | -dynamic-linker %(dfbsd_dynamic_linker) \ | |
| 118 | } \ | |
| 119 | %{static:-Bstatic}} \ | |
| 120 | %{!static:--hash-style=both} \ | |
| 53d7ad08 SS |
121 | %{symbolic:-Bsymbolic}" |
| 122 | ||
| 1617af9c JM |
123 | #undef LINK_SPEC |
| 124 | #define LINK_SPEC DFBSD_LINK_SPEC | |
| 125 | ||
| 18cb0187 JM |
126 | #define DFBSD_DYNAMIC_LINKER \ |
| 127 | "/usr/libexec/ld-elf.so.2" | |
| 53d7ad08 SS |
128 | |
| 129 | #if defined(HAVE_LD_EH_FRAME_HDR) | |
| f0a144b4 | 130 | #define LINK_EH_SPEC "--eh-frame-hdr" |
| 53d7ad08 SS |
131 | #endif |
| 132 | ||
| 133 | /* Use --as-needed -lgcc_s for eh support. */ | |
| 134 | #ifdef HAVE_LD_AS_NEEDED | |
| 135 | #define USE_LD_AS_NEEDED 1 | |
| 136 | #endif | |
| 137 | ||
| 138 | /************************[ Target stuff ]***********************************/ | |
| 139 | ||
| 140 | /* All DragonFly Architectures support the ELF object file format. */ | |
| 141 | #undef OBJECT_FORMAT_ELF | |
| 142 | #define OBJECT_FORMAT_ELF | |
| 143 | ||
| 144 | /* Don't assume anything about the header files. */ | |
| 145 | #undef NO_IMPLICIT_EXTERN_C | |
| 146 | #define NO_IMPLICIT_EXTERN_C 1 | |
| 147 | ||
| 148 | /* Make gcc agree with DragonFly's standard headers (<machine/stdint.h>, etc...) */ | |
| 149 | ||
| 150 | #undef WCHAR_TYPE | |
| 151 | #define WCHAR_TYPE "int" | |
| 152 | ||
| 153 | /* Code generation parameters. */ | |
| 154 | ||
| 155 | /* Use periods rather than dollar signs in special g++ assembler names. | |
| 156 | This ensures the configuration knows our system correctly so we can link | |
| 157 | with libraries compiled with the native cc. */ | |
| 158 | #undef NO_DOLLAR_IN_LABEL | |
| 159 | ||
| 160 | /* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW. | |
| 161 | This enables the test coverage code to use file locking when exiting a | |
| 162 | program, which avoids race conditions if the program has forked. */ | |
| 163 | #define TARGET_POSIX_IO |