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