Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/linux.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | a06113de4d67 |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
1 /* Definitions for Linux-based GNU systems with ELF format | 1 /* Definitions for systems using the Linux kernel, with or without |
2 MMU, using ELF at the compiler level but possibly FLT for final | |
3 linked executables and shared libraries in some no-MMU cases, and | |
4 possibly with a choice of libc implementations. | |
2 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006, | 5 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006, |
3 2007, 2009 Free Software Foundation, Inc. | 6 2007, 2009, 2010, 2011 Free Software Foundation, Inc. |
4 Contributed by Eric Youngdale. | 7 Contributed by Eric Youngdale. |
5 Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org). | 8 Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org). |
6 | 9 |
7 This file is part of GCC. | 10 This file is part of GCC. |
8 | 11 |
23 You should have received a copy of the GNU General Public License and | 26 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; | 27 a copy of the GCC Runtime Library Exception along with this program; |
25 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | 28 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
26 <http://www.gnu.org/licenses/>. */ | 29 <http://www.gnu.org/licenses/>. */ |
27 | 30 |
28 /* Don't assume anything about the header files. */ | 31 /* C libraries supported on Linux. */ |
29 #define NO_IMPLICIT_EXTERN_C | 32 #ifdef SINGLE_LIBC |
30 | 33 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) |
31 #undef ASM_APP_ON | 34 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) |
32 #define ASM_APP_ON "#APP\n" | 35 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) |
33 | |
34 #undef ASM_APP_OFF | |
35 #define ASM_APP_OFF "#NO_APP\n" | |
36 | |
37 #undef MD_EXEC_PREFIX | |
38 #undef MD_STARTFILE_PREFIX | |
39 | |
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'. */ | |
44 | |
45 #undef STARTFILE_SPEC | |
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}" | |
50 #else | 36 #else |
51 #define STARTFILE_SPEC \ | 37 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) |
52 "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \ | 38 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) |
53 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" | 39 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) |
54 #endif | 40 #endif |
55 | |
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'. */ | |
61 | |
62 #undef ENDFILE_SPEC | |
63 #define ENDFILE_SPEC \ | |
64 "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" | |
65 | |
66 /* This is for -profile to use -lc_p instead of -lc. */ | |
67 #ifndef CC1_SPEC | |
68 #define CC1_SPEC "%{profile:-p}" | |
69 #endif | |
70 | |
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)" | |
74 | |
75 #undef LIB_SPEC | |
76 #define LIB_SPEC \ | |
77 "%{pthread:-lpthread} \ | |
78 %{shared:-lc} \ | |
79 %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}" | |
80 | 41 |
81 #define LINUX_TARGET_OS_CPP_BUILTINS() \ | 42 #define LINUX_TARGET_OS_CPP_BUILTINS() \ |
82 do { \ | 43 do { \ |
83 builtin_define ("__gnu_linux__"); \ | 44 if (OPTION_GLIBC) \ |
45 builtin_define ("__gnu_linux__"); \ | |
84 builtin_define_std ("linux"); \ | 46 builtin_define_std ("linux"); \ |
85 builtin_define_std ("unix"); \ | 47 builtin_define_std ("unix"); \ |
86 builtin_assert ("system=linux"); \ | 48 builtin_assert ("system=linux"); \ |
87 builtin_assert ("system=unix"); \ | 49 builtin_assert ("system=unix"); \ |
88 builtin_assert ("system=posix"); \ | 50 builtin_assert ("system=posix"); \ |
89 } while (0) | 51 } while (0) |
90 | 52 |
91 #if defined(HAVE_LD_EH_FRAME_HDR) | 53 /* Determine which dynamic linker to use depending on whether GLIBC or |
92 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " | 54 uClibc or Bionic is the default C library and whether |
93 #endif | 55 -muclibc or -mglibc or -mbionic has been passed to change the default. */ |
94 | 56 |
95 /* Define this so we can compile MS code for use with WINE. */ | 57 #define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ |
96 #define HANDLE_PRAGMA_PACK_PUSH_POP | 58 "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" |
97 | 59 |
98 #undef LINK_GCC_C_SEQUENCE_SPEC | 60 #if DEFAULT_LIBC == LIBC_GLIBC |
99 #define LINK_GCC_C_SEQUENCE_SPEC \ | 61 #define CHOOSE_DYNAMIC_LINKER(G, U, B) \ |
100 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" | 62 CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) |
101 | 63 #elif DEFAULT_LIBC == LIBC_UCLIBC |
102 /* Use --as-needed -lgcc_s for eh support. */ | 64 #define CHOOSE_DYNAMIC_LINKER(G, U, B) \ |
103 #ifdef HAVE_LD_AS_NEEDED | 65 CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) |
104 #define USE_LD_AS_NEEDED 1 | 66 #elif DEFAULT_LIBC == LIBC_BIONIC |
105 #endif | 67 #define CHOOSE_DYNAMIC_LINKER(G, U, B) \ |
106 | 68 CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) |
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. */ | |
110 #if UCLIBC_DEFAULT | |
111 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}" | |
112 #else | 69 #else |
113 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}" | 70 #error "Unsupported DEFAULT_LIBC" |
114 #endif | 71 #endif /* DEFAULT_LIBC */ |
115 | 72 |
116 /* For most targets the following definitions suffice; | 73 /* For most targets the following definitions suffice; |
117 GLIBC_DYNAMIC_LINKER must be defined for each target using them, or | 74 GLIBC_DYNAMIC_LINKER must be defined for each target using them, or |
118 GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets | 75 GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets |
119 supporting both 32-bit and 64-bit compilation. */ | 76 supporting both 32-bit and 64-bit compilation. */ |
120 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" | 77 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" |
121 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" | 78 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" |
122 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" | 79 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" |
123 #define LINUX_DYNAMIC_LINKER \ | 80 #define BIONIC_DYNAMIC_LINKER "/system/bin/linker" |
124 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) | 81 #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker" |
125 #define LINUX_DYNAMIC_LINKER32 \ | 82 #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" |
126 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) | 83 |
127 #define LINUX_DYNAMIC_LINKER64 \ | 84 #define LINUX_DYNAMIC_LINKER \ |
128 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) | 85 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ |
86 BIONIC_DYNAMIC_LINKER) | |
87 #define LINUX_DYNAMIC_LINKER32 \ | |
88 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ | |
89 BIONIC_DYNAMIC_LINKER32) | |
90 #define LINUX_DYNAMIC_LINKER64 \ | |
91 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ | |
92 BIONIC_DYNAMIC_LINKER64) | |
129 | 93 |
130 /* Determine whether the entire c99 runtime | 94 /* Determine whether the entire c99 runtime |
131 is present in the runtime library. */ | 95 is present in the runtime library. */ |
132 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) | 96 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) |
133 | 97 |
134 /* Whether we have sincos that follows the GNU extension. */ | 98 /* Whether we have sincos that follows the GNU extension. */ |
135 #define TARGET_HAS_SINCOS (OPTION_GLIBC) | 99 #define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC) |
136 | |
137 #define TARGET_POSIX_IO |