PR/56490
[official-gcc.git] / gcc / config / freebsd.h
blob87c0acf1d894e203a59d9cd7f8060ae5e3953478
1 /* Base configuration file for all FreeBSD targets.
2 Copyright (C) 1999-2013 Free Software Foundation, Inc.
4 This file is part of GCC.
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.
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.
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/>. */
20 /* Common FreeBSD configuration.
21 All FreeBSD 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>. */
29 /* In case we need to know. */
30 #define USING_CONFIG_FREEBSD 1
32 #undef TARGET_OS_CPP_BUILTINS
33 #define TARGET_OS_CPP_BUILTINS() FBSD_TARGET_OS_CPP_BUILTINS()
35 #undef CPP_SPEC
36 #define CPP_SPEC FBSD_CPP_SPEC
38 #undef STARTFILE_SPEC
39 #define STARTFILE_SPEC FBSD_STARTFILE_SPEC
41 #undef ENDFILE_SPEC
42 #define ENDFILE_SPEC FBSD_ENDFILE_SPEC
44 #undef LIB_SPEC
45 #define LIB_SPEC FBSD_LIB_SPEC
47 #if defined(HAVE_LD_EH_FRAME_HDR)
48 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
49 #endif
51 #ifdef TARGET_LIBC_PROVIDES_SSP
52 #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared}"
53 #endif
55 /* Use --as-needed -lgcc_s for eh support. */
56 #ifdef HAVE_LD_AS_NEEDED
57 #define USE_LD_AS_NEEDED 1
58 #endif
60 /************************[ Target stuff ]***********************************/
62 /* All FreeBSD Architectures support the ELF object file format. */
63 #undef OBJECT_FORMAT_ELF
64 #define OBJECT_FORMAT_ELF
66 /* Don't assume anything about the header files. */
67 #undef NO_IMPLICIT_EXTERN_C
68 #define NO_IMPLICIT_EXTERN_C 1
70 /* Follow FreeBSD's standard headers (<sys/_types.h> etc...). */
72 #undef WCHAR_TYPE
73 #define WCHAR_TYPE "int"
75 #undef WINT_TYPE
76 #define WINT_TYPE "int"
78 #define MATH_LIBRARY_PROFILE "m_p"
80 /* Code generation parameters. */
82 /* Use periods rather than dollar signs in special g++ assembler names.
83 This ensures the configuration knows our system correctly so we can link
84 with libraries compiled with the native cc. */
85 #undef NO_DOLLAR_IN_LABEL
87 /* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW.
88 This enables the test coverage code to use file locking when exiting a
89 program, which avoids race conditions if the program has forked. */
90 #define TARGET_POSIX_IO