1 /* Definitions for Linux-based GNU systems with ELF format
2 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006,
3 2007, 2009 Free Software Foundation, Inc.
4 Contributed by Eric Youngdale.
5 Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org).
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 GCC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 Under Section 7 of GPL version 3, you are granted additional
20 permissions described in the GCC Runtime Library Exception, version
21 3.1, as published by the Free Software Foundation.
23 You should have received a copy of the GNU General Public License and
24 a copy of the GCC Runtime Library Exception along with this program;
25 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26 <http://www.gnu.org/licenses/>. */
28 /* Don't assume anything about the header files. */
29 #define NO_IMPLICIT_EXTERN_C
32 #define ASM_APP_ON "#APP\n"
35 #define ASM_APP_OFF "#NO_APP\n"
38 #undef MD_STARTFILE_PREFIX
40 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
41 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
42 provides part of the support for getting C++ file-scope static
43 object constructed before entering `main'. */
46 #if defined HAVE_LD_PIE
47 #define STARTFILE_SPEC \
48 "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
49 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
51 #define STARTFILE_SPEC \
52 "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
53 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
56 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
57 the GNU/Linux magical crtend.o file (see crtstuff.c) which
58 provides part of the support for getting C++ file-scope static
59 object constructed before entering `main', followed by a normal
60 GNU/Linux "finalizer" file, `crtn.o'. */
63 #define ENDFILE_SPEC \
64 "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
66 /* This is for -profile to use -lc_p instead of -lc. */
68 #define CC1_SPEC "%{profile:-p}"
71 /* The GNU C++ standard library requires that these macros be defined. */
72 #undef CPLUSPLUS_CPP_SPEC
73 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
77 "%{pthread:-lpthread} \
79 %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
81 #define LINUX_TARGET_OS_CPP_BUILTINS() \
83 builtin_define ("__gnu_linux__"); \
84 builtin_define_std ("linux"); \
85 builtin_define_std ("unix"); \
86 builtin_assert ("system=linux"); \
87 builtin_assert ("system=unix"); \
88 builtin_assert ("system=posix"); \
91 #if defined(HAVE_LD_EH_FRAME_HDR)
92 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
95 /* Define this so we can compile MS code for use with WINE. */
96 #define HANDLE_PRAGMA_PACK_PUSH_POP
98 #undef LINK_GCC_C_SEQUENCE_SPEC
99 #define LINK_GCC_C_SEQUENCE_SPEC \
100 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
102 /* Use --as-needed -lgcc_s for eh support. */
103 #ifdef HAVE_LD_AS_NEEDED
104 #define USE_LD_AS_NEEDED 1
107 /* Determine which dynamic linker to use depending on whether GLIBC or
108 uClibc is the default C library and whether -muclibc or -mglibc has
109 been passed to change the default. */
111 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
113 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
116 /* For most targets the following definitions suffice;
117 GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
118 GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
119 supporting both 32-bit and 64-bit compilation. */
120 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
121 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
122 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
123 #define LINUX_DYNAMIC_LINKER \
124 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
125 #define LINUX_DYNAMIC_LINKER32 \
126 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
127 #define LINUX_DYNAMIC_LINKER64 \
128 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
130 /* Determine whether the entire c99 runtime
131 is present in the runtime library. */
132 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
134 /* Whether we have sincos that follows the GNU extension. */
135 #define TARGET_HAS_SINCOS (OPTION_GLIBC)
137 #define TARGET_POSIX_IO