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