]>
Commit | Line | Data |
---|---|---|
83cce46b | 1 | /**************************************************************************** |
2 | * * | |
3 | * GNAT COMPILER COMPONENTS * | |
4 | * * | |
5 | * L I N K * | |
6 | * * | |
83cce46b | 7 | * C Implementation File * |
8 | * * | |
ee8f227a | 9 | * Copyright (C) 1992-2015, Free Software Foundation, Inc. * |
83cce46b | 10 | * * |
11 | * GNAT is free software; you can redistribute it and/or modify it under * | |
12 | * terms of the GNU General Public License as published by the Free Soft- * | |
6bc9506f | 13 | * ware Foundation; either version 3, or (at your option) any later ver- * |
83cce46b | 14 | * sion. GNAT is distributed in the hope that it will be useful, but WITH- * |
15 | * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * | |
6bc9506f | 16 | * or FITNESS FOR A PARTICULAR PURPOSE. * |
17 | * * | |
18 | * As a special exception under Section 7 of GPL version 3, you are granted * | |
19 | * additional permissions described in the GCC Runtime Library Exception, * | |
20 | * version 3.1, as published by the Free Software Foundation. * | |
21 | * * | |
22 | * You should have received a copy of the GNU General Public License and * | |
23 | * a copy of the GCC Runtime Library Exception along with this program; * | |
24 | * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see * | |
25 | * <http://www.gnu.org/licenses/>. * | |
83cce46b | 26 | * * |
27 | * GNAT was originally developed by the GNAT team at New York University. * | |
e78e8c8e | 28 | * Extensive contributions were provided by Ada Core Technologies Inc. * |
83cce46b | 29 | * * |
30 | ****************************************************************************/ | |
31 | ||
becb63f5 | 32 | /* This file contains host-specific parameters describing the behavior of the |
33 | linker. It is used by gnatlink as well as all tools that use Mlib. */ | |
34 | ||
35 | #ifdef __cplusplus | |
36 | extern "C" { | |
37 | #endif | |
83cce46b | 38 | |
9b94c9e7 | 39 | #ifdef IN_GCC |
6cb4b973 | 40 | #include "auto-host.h" |
9b94c9e7 | 41 | #endif |
83cce46b | 42 | |
d0c9584a | 43 | #include <string.h> |
44 | ||
83cce46b | 45 | /* objlist_file_supported is set to 1 when the system linker allows */ |
46 | /* response file, that is a file that contains the list of object files. */ | |
47 | /* This is useful on systems where the command line length is limited, */ | |
48 | /* meaning that putting all the object files on the command line can */ | |
49 | /* result in an unacceptable limit on the number of files. */ | |
50 | ||
51 | /* object_file_option denotes the system dependent linker option which */ | |
52 | /* allows object file names to be placed in a file and then passed to */ | |
53 | /* the linker. object_file_option must be set if objlist_file_supported */ | |
54 | /* is set to 1. */ | |
55 | ||
56 | /* link_max is a conservative system specific threshold (in bytes) of the */ | |
57 | /* argument length passed to the linker which will trigger a file being */ | |
58 | /* used instead of the command line directly. If the argument length is */ | |
27f48659 | 59 | /* greater than this threshold, then an objlist_file will be generated */ |
83cce46b | 60 | /* and object_file_option and objlist_file_supported must be set. If */ |
61 | /* objlist_file_supported is set to 0 (unsupported), then link_max is */ | |
62 | /* set to 2**31-1 so that the limit will never be exceeded. */ | |
63 | ||
64 | /* run_path_option is the system dependent linker option which specifies */ | |
65 | /* the run time path to use when loading dynamic libraries. This should */ | |
27f48659 | 66 | /* be set to the null string if the system does not support dynamic */ |
83cce46b | 67 | /* loading of libraries. */ |
68 | ||
69 | /* shared_libgnat_default gives the system dependent link method that */ | |
70 | /* be used by default for linking libgnat (shared or static) */ | |
71 | ||
d2697a05 | 72 | /* shared_libgcc_default gives the system dependent link method that */ |
6fb3c314 | 73 | /* be used by default for linking libgcc (shared or static) */ |
d2697a05 | 74 | |
5e0f2e2f | 75 | /* separate_run_path_options is set to 1 when separate "rpath" arguments */ |
76 | /* must be passed to the linker for each directory in the rpath. */ | |
77 | ||
bfcff2f0 | 78 | /* default_libgcc_subdir is the subdirectory name (from the installation */ |
79 | /* root) where we may find a shared libgcc to use by default. */ | |
80 | ||
83cce46b | 81 | #define SHARED 'H' |
82 | #define STATIC 'T' | |
83 | ||
5641963c | 84 | #if defined (__WIN32) |
8ffcff2e | 85 | const char *__gnat_object_file_option = "-Wl,@"; |
f270dc82 | 86 | const char *__gnat_run_path_option = ""; |
87 | int __gnat_link_max = 30000; | |
88 | unsigned char __gnat_objlist_file_supported = 1; | |
89 | char __gnat_shared_libgnat_default = STATIC; | |
d2697a05 | 90 | char __gnat_shared_libgcc_default = STATIC; |
f270dc82 | 91 | const char *__gnat_object_library_extension = ".a"; |
5e0f2e2f | 92 | unsigned char __gnat_separate_run_path_options = 0; |
bfcff2f0 | 93 | const char *__gnat_default_libgcc_subdir = "lib"; |
83cce46b | 94 | |
21a87c1d | 95 | #elif defined (__hpux__) |
f270dc82 | 96 | const char *__gnat_object_file_option = "-Wl,-c,"; |
97 | const char *__gnat_run_path_option = "-Wl,+b,"; | |
98 | int __gnat_link_max = 5000; | |
99 | unsigned char __gnat_objlist_file_supported = 1; | |
100 | char __gnat_shared_libgnat_default = STATIC; | |
d2697a05 | 101 | char __gnat_shared_libgcc_default = STATIC; |
f270dc82 | 102 | const char *__gnat_object_library_extension = ".a"; |
5e0f2e2f | 103 | unsigned char __gnat_separate_run_path_options = 0; |
bfcff2f0 | 104 | const char *__gnat_default_libgcc_subdir = "lib"; |
83cce46b | 105 | |
87e3f630 | 106 | #elif defined (__FreeBSD__) || defined (__DragonFly__) \ |
107 | || defined (__NetBSD__) || defined (__OpenBSD__) | |
8ffcff2e | 108 | const char *__gnat_object_file_option = "-Wl,@"; |
eabcce03 | 109 | const char *__gnat_run_path_option = "-Wl,-rpath,"; |
f270dc82 | 110 | char __gnat_shared_libgnat_default = STATIC; |
d2697a05 | 111 | char __gnat_shared_libgcc_default = STATIC; |
44d43e97 | 112 | int __gnat_link_max = 8192; |
113 | unsigned char __gnat_objlist_file_supported = 1; | |
eabcce03 | 114 | const char *__gnat_object_library_extension = ".a"; |
5e0f2e2f | 115 | unsigned char __gnat_separate_run_path_options = 0; |
bfcff2f0 | 116 | const char *__gnat_default_libgcc_subdir = "lib"; |
83cce46b | 117 | |
8a3d0a8f | 118 | #elif defined (__APPLE__) |
723bd332 | 119 | const char *__gnat_object_file_option = "-Wl,-filelist,"; |
8a3d0a8f | 120 | const char *__gnat_run_path_option = "-Wl,-rpath,"; |
121 | char __gnat_shared_libgnat_default = STATIC; | |
d2697a05 | 122 | char __gnat_shared_libgcc_default = SHARED; |
8a3d0a8f | 123 | int __gnat_link_max = 262144; |
124 | unsigned char __gnat_objlist_file_supported = 1; | |
8a3d0a8f | 125 | const char *__gnat_object_library_extension = ".a"; |
5e0f2e2f | 126 | unsigned char __gnat_separate_run_path_options = 1; |
bfcff2f0 | 127 | const char *__gnat_default_libgcc_subdir = "lib"; |
8a3d0a8f | 128 | |
3d230452 | 129 | #elif defined (__linux__) || defined (__GLIBC__) |
8ffcff2e | 130 | const char *__gnat_object_file_option = "-Wl,@"; |
f270dc82 | 131 | const char *__gnat_run_path_option = "-Wl,-rpath,"; |
132 | char __gnat_shared_libgnat_default = STATIC; | |
d2697a05 | 133 | char __gnat_shared_libgcc_default = STATIC; |
f270dc82 | 134 | int __gnat_link_max = 8192; |
135 | unsigned char __gnat_objlist_file_supported = 1; | |
f270dc82 | 136 | const char *__gnat_object_library_extension = ".a"; |
5e0f2e2f | 137 | unsigned char __gnat_separate_run_path_options = 0; |
bfcff2f0 | 138 | #if defined (__x86_64) |
70d595c8 | 139 | # if defined (__LP64__) |
bfcff2f0 | 140 | const char *__gnat_default_libgcc_subdir = "lib64"; |
70d595c8 | 141 | # else |
142 | const char *__gnat_default_libgcc_subdir = "libx32"; | |
143 | # endif | |
bfcff2f0 | 144 | #else |
145 | const char *__gnat_default_libgcc_subdir = "lib"; | |
146 | #endif | |
83cce46b | 147 | |
ce9ee49d | 148 | #elif defined (_AIX) |
149 | /* On AIX, even when with GNU ld we use native linker switches. This is | |
150 | particularly important for '-f' as it should be interpreted by collect2. */ | |
151 | ||
152 | const char *__gnat_object_file_option = "-Wl,-f,"; | |
153 | const char *__gnat_run_path_option = ""; | |
154 | char __gnat_shared_libgnat_default = STATIC; | |
155 | char __gnat_shared_libgcc_default = STATIC; | |
156 | int __gnat_link_max = 15000; | |
55387e86 | 157 | unsigned char __gnat_objlist_file_supported = 1; |
ce9ee49d | 158 | const char *__gnat_object_library_extension = ".a"; |
159 | unsigned char __gnat_separate_run_path_options = 0; | |
160 | const char *__gnat_default_libgcc_subdir = "lib"; | |
161 | ||
6cb4b973 | 162 | #elif (HAVE_GNU_LD) |
163 | /* These are the settings for all systems that use gnu ld. GNU style response | |
164 | file is supported, the shared library default is STATIC. */ | |
165 | ||
8ffcff2e | 166 | const char *__gnat_object_file_option = "-Wl,@"; |
ce9ee49d | 167 | const char *__gnat_run_path_option = ""; |
6cb4b973 | 168 | char __gnat_shared_libgnat_default = STATIC; |
169 | char __gnat_shared_libgcc_default = STATIC; | |
170 | int __gnat_link_max = 8192; | |
171 | unsigned char __gnat_objlist_file_supported = 1; | |
6cb4b973 | 172 | const char *__gnat_object_library_extension = ".a"; |
173 | unsigned char __gnat_separate_run_path_options = 0; | |
174 | const char *__gnat_default_libgcc_subdir = "lib"; | |
175 | ||
176 | #elif defined (VMS) | |
177 | const char *__gnat_object_file_option = ""; | |
178 | const char *__gnat_run_path_option = ""; | |
179 | char __gnat_shared_libgnat_default = STATIC; | |
180 | char __gnat_shared_libgcc_default = STATIC; | |
181 | int __gnat_link_max = 2147483647; | |
182 | unsigned char __gnat_objlist_file_supported = 0; | |
6cb4b973 | 183 | const char *__gnat_object_library_extension = ".olb"; |
184 | unsigned char __gnat_separate_run_path_options = 0; | |
185 | const char *__gnat_default_libgcc_subdir = "lib"; | |
186 | ||
3d230452 | 187 | #elif defined (__sun__) |
6cb4b973 | 188 | const char *__gnat_object_file_option = ""; |
189 | const char *__gnat_run_path_option = "-Wl,-R"; | |
190 | char __gnat_shared_libgnat_default = STATIC; | |
191 | char __gnat_shared_libgcc_default = STATIC; | |
192 | int __gnat_link_max = 2147483647; | |
193 | unsigned char __gnat_objlist_file_supported = 0; | |
6cb4b973 | 194 | const char *__gnat_object_library_extension = ".a"; |
195 | unsigned char __gnat_separate_run_path_options = 0; | |
196 | #if defined (__sparc_v9__) || defined (__sparcv9) | |
197 | const char *__gnat_default_libgcc_subdir = "lib/sparcv9"; | |
198 | #elif defined (__x86_64) | |
199 | const char *__gnat_default_libgcc_subdir = "lib/amd64"; | |
200 | #else | |
201 | const char *__gnat_default_libgcc_subdir = "lib"; | |
202 | #endif | |
203 | ||
3d230452 | 204 | #elif defined (__svr4__) && defined (__i386__) |
f270dc82 | 205 | const char *__gnat_object_file_option = ""; |
206 | const char *__gnat_run_path_option = ""; | |
207 | char __gnat_shared_libgnat_default = STATIC; | |
d2697a05 | 208 | char __gnat_shared_libgcc_default = STATIC; |
f270dc82 | 209 | int __gnat_link_max = 2147483647; |
210 | unsigned char __gnat_objlist_file_supported = 0; | |
f270dc82 | 211 | const char *__gnat_object_library_extension = ".a"; |
5e0f2e2f | 212 | unsigned char __gnat_separate_run_path_options = 0; |
bfcff2f0 | 213 | const char *__gnat_default_libgcc_subdir = "lib"; |
83cce46b | 214 | |
215 | #else | |
216 | ||
217 | /* These are the default settings for all other systems. No response file | |
218 | is supported, the shared library default is STATIC. */ | |
f270dc82 | 219 | const char *__gnat_run_path_option = ""; |
220 | const char *__gnat_object_file_option = ""; | |
221 | char __gnat_shared_libgnat_default = STATIC; | |
d2697a05 | 222 | char __gnat_shared_libgcc_default = STATIC; |
f270dc82 | 223 | int __gnat_link_max = 2147483647; |
224 | unsigned char __gnat_objlist_file_supported = 0; | |
f270dc82 | 225 | const char *__gnat_object_library_extension = ".a"; |
5e0f2e2f | 226 | unsigned char __gnat_separate_run_path_options = 0; |
bfcff2f0 | 227 | const char *__gnat_default_libgcc_subdir = "lib"; |
83cce46b | 228 | #endif |
becb63f5 | 229 | |
230 | #ifdef __cplusplus | |
231 | } | |
232 | #endif |