Commit | Line | Data |
---|---|---|
36ea6198 ILT |
1 | # This is the linker host specific file. This is invoked by the |
2 | # autoconf generated configure script. Putting it in a separate shell | |
3 | # file lets us skip running autoconf when modifying host specific | |
4 | # information. | |
5 | ||
6 | # This file sets the following shell variables: | |
36ea6198 ILT |
7 | # HDEFINES host specific compiler flags |
8 | # HOSTING_CRT0 crt0.o file used for bootstrapping | |
9 | # HOSTING_LIBS libraries used for bootstrapping | |
10 | # NATIVE_LIB_DIRS library directories to search on this host | |
ad43e45b | 11 | # HLDFLAGS link flags to use on this host |
fe80f638 | 12 | # HLDENV environment variable to set when linking for the host |
ad43e45b | 13 | # RPATH_ENVVAR environment variable used to find shared libraries |
36ea6198 ILT |
14 | |
15 | HDEFINES= | |
16 | HOSTING_CRT0=/lib/crt0.o | |
17 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc' | |
18 | NATIVE_LIB_DIRS= | |
19 | ||
20 | case "${host}" in | |
21 | ||
02a5d235 ILT |
22 | alpha-*-linux*) |
23 | HOSTING_CRT0=/usr/lib/crt0.o | |
24 | ;; | |
25 | ||
36ea6198 ILT |
26 | alpha-*-*) |
27 | HOSTING_CRT0=/usr/ccs/lib/crt0.o | |
28 | NATIVE_LIB_DIRS=/usr/ccs/lib | |
29 | ;; | |
30 | ||
fe80f638 | 31 | i[3456]86-*-bsd* | i[3456]86-*-freebsd* | i[3456]86-*-netbsd*) |
36ea6198 ILT |
32 | # The new BSD `make' has a bug: it doesn't pass empty arguments in |
33 | # shell commands. So we need to make this value non-empty in order | |
34 | # for the genscripts.sh call to work. There's nothing magic about | |
35 | # the value `/lib'; it's just a dummy. | |
02a5d235 | 36 | NATIVE_LIB_DIRS=/lib |
ed1f99e7 | 37 | HOSTING_CRT0=/usr/lib/crt0.o |
36ea6198 ILT |
38 | ;; |
39 | ||
fe80f638 ILT |
40 | i[3456]86-*-sysv4*) |
41 | HOSTING_CRT0='/usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`' | |
42 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o' | |
36ea6198 ILT |
43 | NATIVE_LIB_DIRS=/usr/ccs/lib |
44 | ;; | |
45 | ||
fe80f638 ILT |
46 | i[3456]86-sequent-ptx* | i[3456]86-sequent-sysv*) |
47 | HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`' | |
48 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi`' | |
673f5b9f ILT |
49 | ;; |
50 | ||
fe80f638 | 51 | i[3456]86-*-sysv*) |
36ea6198 | 52 | HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`' |
fe80f638 | 53 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o' |
36ea6198 ILT |
54 | ;; |
55 | ||
fe80f638 ILT |
56 | i[3456]86-*-solaris*) |
57 | HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else gcc -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else gcc -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`' | |
58 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else gcc -print-file-name=crtn.o; fi`' | |
36ea6198 ILT |
59 | NATIVE_LIB_DIRS=/usr/ccs/lib |
60 | ;; | |
61 | ||
fe80f638 ILT |
62 | i[3456]86-*-sco* | i[3456]86-*-isc*) |
63 | # In some configurations gcc does not use crtbegin.o and crtend.o. | |
64 | # In that case gcc -print-file-name=crtbegin.o will simply print | |
65 | # crtbegin.o. We create dummy crtbegin.o and crtend.o files to | |
66 | # handle this. | |
67 | echo "int dummy_crtbegin () { return 0; }" > crtbegin.c | |
68 | ${CC} -c crtbegin.c -o crtbegin.o | |
69 | rm -f crtbegin.c | |
70 | echo "int dummy_crteng () { return 0; }" > crtend.c | |
71 | ${CC} -c crtend.c -o crtend.o | |
72 | rm -f crtend.c | |
73 | HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`' | |
74 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` /lib/crtn.o' | |
36ea6198 ILT |
75 | ;; |
76 | ||
fe80f638 | 77 | i[3456]86-*-linux*aout* | i[3456]86-*-linuxoldld) |
36ea6198 ILT |
78 | HOSTING_CRT0=/usr/lib/crt0.o |
79 | ;; | |
80 | ||
81272efd | 81 | i[3456]86-*-linux*libc1*) |
fe80f638 ILT |
82 | HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`' |
83 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o' | |
ed1f99e7 ILT |
84 | ;; |
85 | ||
81272efd ILT |
86 | i[3456]86-*-linux*) |
87 | HOSTING_CRT0='-dynamic-linker `fgrep ld-linux.so \`gcc --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld-linux.so..\).*,\1,"` `gcc --print-file-name=crt1.o` `gcc --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`' | |
88 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -L`dirname \`gcc --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc --print-file-name=crtend.o; fi` `gcc --print-file-name=crtn.o`' | |
89 | ;; | |
90 | ||
fe80f638 | 91 | i[3456]86-*-lynxos*) |
36ea6198 ILT |
92 | HOSTING_CRT0=/lib/init1.o |
93 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o' | |
94 | ;; | |
95 | ||
2e598345 | 96 | mips*-dec-bsd*) |
36ea6198 ILT |
97 | HOSTING_CRT0=/usr/lib/crt0.o |
98 | ;; | |
99 | ||
2e598345 ILT |
100 | mips*-sgi-irix4*) |
101 | HOSTING_CRT0=/usr/lib/crt1.o | |
102 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o' | |
103 | ;; | |
104 | ||
fe80f638 | 105 | mips*-sgi-irix[56]*) |
36ea6198 ILT |
106 | HOSTING_CRT0=/usr/lib/crt1.o |
107 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o' | |
108 | ;; | |
109 | ||
fe80f638 ILT |
110 | m68*-*-linux*aout*) |
111 | HOSTING_CRT0=/usr/lib/crt0.o | |
112 | ;; | |
113 | ||
114 | m68*-*-linux*libc1*) | |
115 | HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`' | |
116 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o' | |
117 | ;; | |
118 | ||
119 | m68*-*-linux*) | |
120 | HOSTING_CRT0='-dynamic-linker /lib/ld.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`' | |
121 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o' | |
122 | ;; | |
123 | ||
36ea6198 ILT |
124 | m68*-*-lynxos*) |
125 | HOSTING_CRT0=/lib/init1.o | |
126 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o' | |
127 | ;; | |
128 | ||
ed1f99e7 ILT |
129 | m68*-motorola-sysv) |
130 | HOSTING_CRT0='`if [ -f ../gcc/crt0.o ]; then echo ../gcc/crt0.o; elif [ -f \`gcc -print-file-name=\`crt0.o ]; then echo \`gcc -print-file-name=\`crt0.o; else echo /lib/crt0.o; fi`' | |
131 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc881 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi`' | |
132 | ;; | |
133 | ||
36ea6198 ILT |
134 | m68*-sun-*) |
135 | HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o' | |
136 | ;; | |
137 | ||
138 | m88*-*-dgux*) | |
02a5d235 | 139 | HDEFINES=-D__using_DGUX |
fe80f638 | 140 | HOSTING_CRT0='/lib/crt0.o -X' |
36ea6198 ILT |
141 | HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a |
142 | ;; | |
143 | ||
ed1f99e7 | 144 | m88*-motorola-sysv3) |
fe80f638 ILT |
145 | HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`' |
146 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi`' | |
ed1f99e7 ILT |
147 | ;; |
148 | ||
36ea6198 ILT |
149 | romp-*-*) |
150 | HDEFINES=-DNO_VARARGS | |
36ea6198 ILT |
151 | ;; |
152 | ||
fe80f638 ILT |
153 | sparc*-*-solaris2*) |
154 | HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else gcc -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else gcc -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`' | |
155 | HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else gcc -print-file-name=crtn.o; fi`' | |
36ea6198 ILT |
156 | NATIVE_LIB_DIRS=/usr/ccs/lib |
157 | ;; | |
158 | ||
159 | esac | |
2e598345 ILT |
160 | |
161 | HLDFLAGS= | |
fe80f638 | 162 | HLDENV= |
ad43e45b | 163 | RPATH_ENVVAR=LD_LIBRARY_PATH |
2e598345 ILT |
164 | # If we have shared libraries, try to set rpath reasonably. |
165 | if test "${shared}" = "true"; then | |
166 | case "${host}" in | |
b6acf084 ILT |
167 | *-*-hpux*) |
168 | HLDFLAGS='-Wl,+s,+b,$(libdir)' | |
ad43e45b | 169 | RPATH_ENVVAR=SHLIB_PATH |
b6acf084 | 170 | ;; |
fe80f638 | 171 | *-*-irix[56]*) |
2e598345 ILT |
172 | HLDFLAGS='-Wl,-rpath,$(libdir)' |
173 | ;; | |
174 | *-*-linux*aout*) | |
175 | ;; | |
176 | *-*-linux*) | |
177 | HLDFLAGS='-Wl,-rpath,$(libdir)' | |
178 | ;; | |
fe80f638 | 179 | *-*-solaris*) |
2e598345 ILT |
180 | HLDFLAGS='-R $(libdir)' |
181 | ;; | |
fe80f638 ILT |
182 | *-*-sysv4*) |
183 | HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;' | |
184 | ;; | |
2e598345 ILT |
185 | esac |
186 | fi | |
187 | ||
188 | # On SunOS, if the linker supports the -rpath option, use it to | |
189 | # prevent ../bfd and ../opcodes from being included in the run time | |
190 | # search path. | |
191 | case "${host}" in | |
192 | *-*-sunos*) | |
193 | echo 'main () { }' > conftest.c | |
194 | ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t | |
195 | if grep 'unrecognized' conftest.t >/dev/null 2>&1; then | |
196 | : | |
197 | elif grep 'No such file' conftest.t >/dev/null 2>&1; then | |
198 | : | |
9e2ef098 ILT |
199 | elif grep 'do not mix' conftest.t >/dev/null 2>&1; then |
200 | : | |
2e598345 ILT |
201 | elif test "${shared}" = "true"; then |
202 | HLDFLAGS='-Wl,-rpath=$(libdir)' | |
203 | else | |
204 | HLDFLAGS='-Wl,-rpath=' | |
205 | fi | |
206 | rm -f conftest.t conftest.c conftest | |
207 | ;; | |
208 | esac |