OLD | NEW |
1 /* Target definitions for GCC for NativeClient using ELF | 1 /* Target definitions for GCC for NativeClient using ELF |
2 Copyright (C) 1988, 1991, 1995, 2000, 2001, 2002 | 2 Copyright (C) 1988, 1991, 1995, 2000, 2001, 2002 |
3 Free Software Foundation, Inc. | 3 Free Software Foundation, Inc. |
4 | 4 |
5 Derived from sysv4.h written by Ron Guilmette (rfg@netcom.com). | 5 Derived from sysv4.h written by Ron Guilmette (rfg@netcom.com). |
6 | 6 |
7 This file is part of GCC. | 7 This file is part of GCC. |
8 | 8 |
9 GCC is free software; you can redistribute it and/or modify | 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 | 10 it under the terms of the GNU General Public License as published by |
(...skipping 26 matching lines...) Expand all Loading... |
37 #undef TARGET_VERSION | 37 #undef TARGET_VERSION |
38 #define TARGET_VERSION fprintf (stderr, " (NativeClient)"); | 38 #define TARGET_VERSION fprintf (stderr, " (NativeClient)"); |
39 | 39 |
40 /* Don't enclose system header files in extern "C" {...}. */ | 40 /* Don't enclose system header files in extern "C" {...}. */ |
41 #define NO_IMPLICIT_EXTERN_C | 41 #define NO_IMPLICIT_EXTERN_C |
42 | 42 |
43 /* Provide a STARTFILE_SPEC. Here we add | 43 /* Provide a STARTFILE_SPEC. Here we add |
44 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which provides part of | 44 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which provides part of |
45 the support for getting C++ file-scope static object constructed before | 45 the support for getting C++ file-scope static object constructed before |
46 entering `main'. */ | 46 entering `main'. */ |
47 | 47 |
48 #undef STARTFILE_SPEC | 48 #undef STARTFILE_SPEC |
49 #if defined HAVE_LD_PIE | 49 #if defined HAVE_LD_PIE |
50 #define STARTFILE_SPEC \ | 50 #define STARTFILE_SPEC \ |
51 "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ | 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}" | 52 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" |
53 #else | 53 #else |
54 #define STARTFILE_SPEC \ | 54 #define STARTFILE_SPEC \ |
55 "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \ | 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}" | 56 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" |
57 #endif | 57 #endif |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 #if defined(HAVE_LD_EH_FRAME_HDR) | 103 #if defined(HAVE_LD_EH_FRAME_HDR) |
104 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " | 104 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " |
105 #endif | 105 #endif |
106 | 106 |
107 /* Use --as-needed -lgcc_s for eh support. */ | 107 /* Use --as-needed -lgcc_s for eh support. */ |
108 #ifdef HAVE_LD_AS_NEEDED | 108 #ifdef HAVE_LD_AS_NEEDED |
109 #define USE_LD_AS_NEEDED 1 | 109 #define USE_LD_AS_NEEDED 1 |
110 #endif | 110 #endif |
111 | 111 |
112 /* TODO(pasko): replace LINUX_DYNAMIC_LINKER with NACL_DYNAMIC_LINKER when we | 112 #define NACL_DYNAMIC_LINKER32 "/lib/ld-nacl-x86-32.so.1" |
113 implement dynamic linking. */ | 113 #define NACL_DYNAMIC_LINKER64 "/lib64/ld-nacl-x86-64.so.1" |
114 | |
115 /* Determine which dynamic linker to use depending on whether GLIBC or | |
116 uClibc is the default C library and whether -muclibc or -mglibc has | |
117 been passed to change the default. */ | |
118 #if UCLIBC_DEFAULT | |
119 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc u
sed together}" G ";:" U "}" | |
120 #else | |
121 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc u
sed together}" U ";:" G "}" | |
122 #endif | |
123 | |
124 /* For most targets the following definitions suffice; | |
125 GLIBC_DYNAMIC_LINKER must be defined for each target using them, or | |
126 GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets | |
127 supporting both 32-bit and 64-bit compilation. */ | |
128 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" | |
129 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" | |
130 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" | |
131 #define LINUX_DYNAMIC_LINKER \ | |
132 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) | |
133 #define LINUX_DYNAMIC_LINKER32 \ | |
134 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) | |
135 #define LINUX_DYNAMIC_LINKER64 \ | |
136 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) | |
137 | |
138 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" | |
139 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" | |
140 | 114 |
141 /* Determine whether the entire c99 runtime | 115 /* Determine whether the entire c99 runtime |
142 is present in the runtime library. */ | 116 is present in the runtime library. */ |
143 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) | 117 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) |
144 | 118 |
145 /* Whether we have sincos that follows the GNU extension. */ | 119 /* Whether we have sincos that follows the GNU extension. */ |
146 #define TARGET_HAS_SINCOS (OPTION_GLIBC) | 120 #define TARGET_HAS_SINCOS (OPTION_GLIBC) |
147 | 121 |
148 #define TARGET_POSIX_IO | 122 #define TARGET_POSIX_IO |
149 | 123 |
150 #if TARGET_64BIT_DEFAULT | 124 #if TARGET_64BIT_DEFAULT |
151 #define SPEC_32 "m32" | 125 #define SPEC_32 "m32" |
152 #define SPEC_64 "!m32" | 126 #define SPEC_64 "!m32" |
153 #else | 127 #else |
154 #define SPEC_32 "!m64" | 128 #define SPEC_32 "!m64" |
155 #define SPEC_64 "m64" | 129 #define SPEC_64 "m64" |
156 #endif | 130 #endif |
157 | 131 |
158 #undef LINK_SPEC | 132 #undef LINK_SPEC |
159 #define LINK_SPEC "%{" SPEC_64 ":-m elf64_nacl} %{" SPEC_32 ":-m elf_nacl} \ | 133 #define LINK_SPEC "%{" SPEC_64 ":-m elf64_nacl} %{" SPEC_32 ":-m elf_nacl} \ |
160 %{shared:-shared} \ | 134 %{shared:-shared} \ |
161 %{!shared: \ | 135 %{!shared: \ |
162 %{!static: \ | 136 %{!static: \ |
163 %{rdynamic:-export-dynamic} \ | 137 %{rdynamic:-export-dynamic} \ |
164 %{" SPEC_32 ":%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "
}} \ | 138 %{" SPEC_32 ":%{!dynamic-linker:-dynamic-linker " NACL_DYNAMIC_LINKER32 "}
} \ |
165 %{" SPEC_64 ":%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "
}}} \ | 139 %{" SPEC_64 ":%{!dynamic-linker:-dynamic-linker " NACL_DYNAMIC_LINKER64 "}
}} \ |
166 %{static:-static}}" | 140 %{static:-static}}" |
167 | 141 |
168 #undef LINK_GCC_C_SEQUENCE_SPEC | 142 #undef LINK_GCC_C_SEQUENCE_SPEC |
169 #define LINK_GCC_C_SEQUENCE_SPEC \ | 143 #define LINK_GCC_C_SEQUENCE_SPEC \ |
170 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" | 144 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" |
171 | 145 |
172 #if TARGET_64BIT_DEFAULT | 146 #if TARGET_64BIT_DEFAULT |
173 #define MULTILIB_DEFAULTS { "m64" } | 147 #define MULTILIB_DEFAULTS { "m64" } |
174 #else | 148 #else |
175 #define MULTILIB_DEFAULTS { "m32" } | 149 #define MULTILIB_DEFAULTS { "m32" } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 #undef TARGET_USE_BT | 261 #undef TARGET_USE_BT |
288 #define TARGET_USE_BT (ix86_tune_features[X86_TUNE_USE_BT] && !TARGET_
NACL) | 262 #define TARGET_USE_BT (ix86_tune_features[X86_TUNE_USE_BT] && !TARGET_
NACL) |
289 | 263 |
290 #undef DBX_REGISTER_NUMBER | 264 #undef DBX_REGISTER_NUMBER |
291 #define DBX_REGISTER_NUMBER(n) \ | 265 #define DBX_REGISTER_NUMBER(n) \ |
292 (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) | 266 (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) |
293 | 267 |
294 #define DWARF2_ADDR_SIZE \ | 268 #define DWARF2_ADDR_SIZE \ |
295 (TARGET_NACL ? (TARGET_64BIT ? 8 : 4) : \ | 269 (TARGET_NACL ? (TARGET_64BIT ? 8 : 4) : \ |
296 (POINTER_SIZE / BITS_PER_UNIT)) | 270 (POINTER_SIZE / BITS_PER_UNIT)) |
OLD | NEW |