]> gcc.gnu.org Git - gcc.git/blame - gcc/ada/link.c
3psoccon.ads, [...]: Files added.
[gcc.git] / gcc / ada / link.c
CommitLineData
38cbfe40
RK
1/****************************************************************************
2 * *
3 * GNAT COMPILER COMPONENTS *
4 * *
5 * L I N K *
6 * *
38cbfe40
RK
7 * C Implementation File *
8 * *
fbf5a39b 9 * Copyright (C) 1992-2003, Free Software Foundation, Inc. *
38cbfe40
RK
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- *
13 * ware Foundation; either version 2, or (at your option) any later ver- *
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 *
16 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
17 * for more details. You should have received a copy of the GNU General *
18 * Public License distributed with GNAT; see file COPYING. If not, write *
19 * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
20 * MA 02111-1307, USA. *
21 * *
22 * As a special exception, if you link this file with other files to *
23 * produce an executable, this file does not by itself cause the resulting *
24 * executable to be covered by the GNU General Public License. This except- *
25 * ion does not however invalidate any other reasons why the executable *
26 * file might be covered by the GNU Public License. *
27 * *
28 * GNAT was originally developed by the GNAT team at New York University. *
71ff80dc 29 * Extensive contributions were provided by Ada Core Technologies Inc. *
38cbfe40
RK
30 * *
31 ****************************************************************************/
32
33/* This file contains parameterizations used by gnatlink.adb in handling */
34/* very long linker lines in systems where there are limitations on the */
35/* argument length when the command line is used to pass items to the */
36/* linker */
37
38#include <string.h>
39
40/* objlist_file_supported is set to 1 when the system linker allows */
41/* response file, that is a file that contains the list of object files. */
42/* This is useful on systems where the command line length is limited, */
43/* meaning that putting all the object files on the command line can */
44/* result in an unacceptable limit on the number of files. */
45
46/* object_file_option denotes the system dependent linker option which */
47/* allows object file names to be placed in a file and then passed to */
48/* the linker. object_file_option must be set if objlist_file_supported */
49/* is set to 1. */
50
51/* link_max is a conservative system specific threshold (in bytes) of the */
52/* argument length passed to the linker which will trigger a file being */
53/* used instead of the command line directly. If the argument length is */
54/* greater than this threshhold, then an objlist_file will be generated */
55/* and object_file_option and objlist_file_supported must be set. If */
56/* objlist_file_supported is set to 0 (unsupported), then link_max is */
57/* set to 2**31-1 so that the limit will never be exceeded. */
58
59/* run_path_option is the system dependent linker option which specifies */
60/* the run time path to use when loading dynamic libraries. This should */
61/* be set to the null string if the system does not support dynmamic */
62/* loading of libraries. */
63
64/* shared_libgnat_default gives the system dependent link method that */
65/* be used by default for linking libgnat (shared or static) */
66
67/* using_gnu_linker is set to 1 when the GNU linker is used under this */
68/* target. */
69
70/* RESPONSE FILE & GNU LINKER */
71/* -------------------------- */
72/* objlist_file_supported and using_gnu_link used together tell gnatlink */
73/* to generate a GNU style response file. Note that object_file_option */
74/* must be set to "" in this case, since no option is required for a */
75/* response file to be passed to GNU ld. With a GNU linker we use the */
76/* linker script to implement the response file feature. Any file passed */
77/* in the GNU ld command line with an unknown extension is supposed to be */
78/* a linker script. Each linker script augment the current configuration. */
79/* The format of such response file is as follow : */
80/* INPUT (obj1.p obj2.o ...) */
81
82#define SHARED 'H'
83#define STATIC 'T'
84
85#if defined (__osf__)
86const char *object_file_option = "-Wl,-input,";
87const char *run_path_option = "-Wl,-rpath,";
88int link_max = 10000;
89unsigned char objlist_file_supported = 1;
90char shared_libgnat_default = STATIC;
91unsigned char using_gnu_linker = 0;
92const char *object_library_extension = ".a";
93
94#elif defined (sgi)
95const char *object_file_option = "-Wl,-objectlist,";
96const char *run_path_option = "-Wl,-rpath,";
97int link_max = 5000;
98unsigned char objlist_file_supported = 1;
99char shared_libgnat_default = SHARED;
100unsigned char using_gnu_linker = 0;
101const char *object_library_extension = ".a";
102
103#elif defined (__WIN32)
104const char *object_file_option = "";
105const char *run_path_option = "";
106int link_max = 30000;
107unsigned char objlist_file_supported = 1;
108char shared_libgnat_default = STATIC;
109unsigned char using_gnu_linker = 1;
110const char *object_library_extension = ".a";
111
112#elif defined (__INTERIX)
113const char *object_file_option = "";
114const char *run_path_option = "";
115int link_max = 5000;
116unsigned char objlist_file_supported = 1;
117char shared_libgnat_default = STATIC;
118unsigned char using_gnu_linker = 1;
119const char *object_library_extension = ".a";
120
121#elif defined (hpux)
122const char *object_file_option = "-Wl,-c,";
123const char *run_path_option = "-Wl,+b,";
124int link_max = 5000;
125unsigned char objlist_file_supported = 1;
126char shared_libgnat_default = STATIC;
127unsigned char using_gnu_linker = 0;
128const char *object_library_extension = ".a";
129
130#elif defined (_AIX)
131const char *object_file_option = "-Wl,-f,";
132const char *run_path_option = "";
133int link_max = 15000;
b174e2d4 134const unsigned char objlist_file_supported = 1;
38cbfe40
RK
135char shared_libgnat_default = STATIC;
136unsigned char using_gnu_linker = 0;
137const char *object_library_extension = ".a";
138
139#elif defined (VMS)
140const char *object_file_option = "";
141const char *run_path_option = "";
142char shared_libgnat_default = SHARED;
143int link_max = 2147483647;
144unsigned char objlist_file_supported = 0;
145unsigned char using_gnu_linker = 0;
146const char *object_library_extension = ".olb";
147
148#elif defined (sun)
149const char *object_file_option = "";
150const char *run_path_option = "-R";
151char shared_libgnat_default = STATIC;
152int link_max = 2147483647;
153unsigned char objlist_file_supported = 0;
154unsigned char using_gnu_linker = 0;
155const char *object_library_extension = ".a";
156
157#elif defined (linux)
158const char *object_file_option = "";
159const char *run_path_option = "-Wl,-rpath,";
160char shared_libgnat_default = STATIC;
fbf5a39b
AC
161int link_max = 8192;
162unsigned char objlist_file_supported = 1;
163unsigned char using_gnu_linker = 1;
38cbfe40
RK
164const char *object_library_extension = ".a";
165
166#elif defined (__svr4__) && defined (i386)
167const char *object_file_option = "";
168const char *run_path_option = "";
169char shared_libgnat_default = STATIC;
170int link_max = 2147483647;
171unsigned char objlist_file_supported = 0;
172unsigned char using_gnu_linker = 0;
173const char *object_library_extension = ".a";
174
175#else
176
177/* These are the default settings for all other systems. No response file
178 is supported, the shared library default is STATIC. */
179const char *run_path_option = "";
180const char *object_file_option = "";
181char shared_libgnat_default = STATIC;
182int link_max = 2147483647;
183unsigned char objlist_file_supported = 0;
184unsigned char using_gnu_linker = 0;
185const char *object_library_extension = ".a";
186#endif
This page took 0.432137 seconds and 5 git commands to generate.