2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / config / linux.h
blob0f7ba1777e8b865e78eae17a5af3b0a8e0ceb890
1 /* Definitions for Linux-based GNU systems with ELF format
2 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003
3 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 2, or (at your option)
12 any later version.
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 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
24 /* Don't assume anything about the header files. */
25 #define NO_IMPLICIT_EXTERN_C
27 #undef ASM_APP_ON
28 #define ASM_APP_ON "#APP\n"
30 #undef ASM_APP_OFF
31 #define ASM_APP_OFF "#NO_APP\n"
33 #undef MD_EXEC_PREFIX
34 #undef MD_STARTFILE_PREFIX
36 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
37 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
38 provides part of the support for getting C++ file-scope static
39 object constructed before entering `main'. */
41 #undef STARTFILE_SPEC
42 #ifdef USE_GNULIBC_1
43 #define STARTFILE_SPEC \
44 "%{!shared: \
45 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
46 %{!p:%{profile:gcrt1.o%s} \
47 %{!profile:crt1.o%s}}}} \
48 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
49 #elif defined HAVE_LD_PIE
50 #define STARTFILE_SPEC \
51 "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
52 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
53 #else
54 #define STARTFILE_SPEC \
55 "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
56 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
57 #endif
59 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
60 the GNU/Linux magical crtend.o file (see crtstuff.c) which
61 provides part of the support for getting C++ file-scope static
62 object constructed before entering `main', followed by a normal
63 GNU/Linux "finalizer" file, `crtn.o'. */
65 #undef ENDFILE_SPEC
66 #define ENDFILE_SPEC \
67 "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
69 /* This is for -profile to use -lc_p instead of -lc. */
70 #ifndef CC1_SPEC
71 #define CC1_SPEC "%{profile:-p}"
72 #endif
74 /* The GNU C++ standard library requires that these macros be defined. */
75 #undef CPLUSPLUS_CPP_SPEC
76 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
78 #undef LIB_SPEC
79 /* We no longer link with libc_p.a or libg.a by default. If you
80 want to profile or debug the GNU/Linux C library, please add
81 -profile or -ggdb to LDFLAGS at the link time, respectively. */
82 #if 1
83 #ifdef USE_GNULIBC_1
84 #define LIB_SPEC \
85 "%{!shared: %{p:-lgmon} %{pg:-lgmon} %{profile:-lgmon -lc_p} \
86 %{!profile:%{!ggdb:-lc} %{ggdb:-lg}}}"
87 #else
88 #define LIB_SPEC \
89 "%{pthread:-lpthread} \
90 %{shared:-lc} \
91 %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
92 #endif
93 #else
94 #define LIB_SPEC \
95 "%{!shared: \
96 %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
97 %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
98 #endif
100 #define LINUX_TARGET_OS_CPP_BUILTINS() \
101 do { \
102 builtin_define ("__gnu_linux__"); \
103 builtin_define_std ("linux"); \
104 builtin_define_std ("unix"); \
105 builtin_assert ("system=linux"); \
106 builtin_assert ("system=unix"); \
107 builtin_assert ("system=posix"); \
108 } while (0)
110 #if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
111 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
112 #endif
114 /* Define this so we can compile MS code for use with WINE. */
115 #define HANDLE_PRAGMA_PACK_PUSH_POP
117 #define LINK_GCC_C_SEQUENCE_SPEC \
118 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
120 /* Determine whether the the entire c99 runtime
121 is present in the runtime library. */
122 #ifndef USE_GNULIBC_1
123 #define TARGET_C99_FUNCTIONS 1
124 #endif
126 #define TARGET_HAS_F_SETLKW