configure.tgt revision 1.26
1# configure.tgt
2#
3#   Copyright (C) 2013-2016 Free Software Foundation, Inc.
4#
5# This file is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; see the file COPYING3.  If not see
17# <http://www.gnu.org/licenses/>.
18
19# This is the linker target specific file.  This is invoked by the
20# autoconf generated configure script.  Putting it in a separate shell
21# file lets us skip running autoconf when modifying target specific
22# information.
23
24# This file switches on the shell variable ${targ}, and sets the
25# following shell variables:
26#  targ_emul		name of linker emulation to use
27#  targ_extra_emuls	additional linker emulations to provide
28#  targ_extra_libpath	additional linker emulations using LIB_PATH
29#  targ_extra_ofiles	additional host-compiled objects needed by the emulation
30#  targ64_extra_emuls	additional linker emulations to provide if
31#  			--enable-64-bit-bfd is given or if host is 64 bit.
32#  targ64_extra_libpath	additional linker emulations using LIB_PATH if
33#  			--enable-64-bit-bfd is given or if host is 64 bit.
34#  NATIVE_LIB_DIRS	library directories to search on this host
35#			(if we are a native or sysrooted linker)
36
37targ_extra_emuls=
38targ_extra_libpath=
39targ_extra_ofiles=
40targ64_extra_emuls=
41targ64_extra_libpath=
42
43# Please try to keep this table in alphabetic order - it makes it
44# much easier to lookup a specific archictecture.  Naturally any
45# architecture variants should be kept together even if their names
46# break the alpha sorting.
47case "${targ}" in
48aarch64_be-*-elf)	targ_emul=aarch64elfb
49			targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b armelfb armelf" ;;
50aarch64-*-elf | aarch64-*-rtems*)
51			targ_emul=aarch64elf
52			targ_extra_emuls="aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb" ;;
53aarch64-*-cloudabi*)	targ_emul=aarch64cloudabi
54			targ_extra_emuls=aarch64cloudabib ;;
55aarch64-*-freebsd*)	targ_emul=aarch64fbsd
56			targ_extra_emuls="aarch64fbsdb aarch64elf" ;;
57aarch64_be-*-linux*)	targ_emul=aarch64linuxb
58			targ_extra_libpath="aarch64linux aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
59			targ_extra_emuls="aarch64elfb aarch64elf aarch64elf32 aarch64elf32b armelfb armelf $targ_extra_libpath" ;;
60aarch64-*-linux*)	targ_emul=aarch64linux
61			targ_extra_libpath="aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
62			targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath" ;;
63aarch64_be-*-netbsd*)	targ_emul=aarch64nbsdb
64			targ_extra_emuls="aarch64nbsd aarch64elfb aarch64elf armelfb_nbsd_eabihf armelf_nbsd_eabihf armelfb_nbsd_eabi armelf_nbsd_eabi armelfb_nbsd armelf_nbsd armelf armelfb" ;;
65aarch64-*-netbsd*)	targ_emul=aarch64nbsd
66			targ_extra_emuls="aarch64nbsdb aarch64elf aarch64elfb armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armelfb" ;;
67alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
68		        targ_emul=elf64alpha_fbsd
69			targ_extra_emuls="elf64alpha alpha"
70			tdir_alpha=`echo ${targ_alias} | sed -e 's/freebsd/freebsdecoff/'` ;;
71alpha*-*-linux*ecoff*)	targ_emul=alpha targ_extra_emuls=elf64alpha
72			tdir_elf64alpha=`echo ${targ_alias} | sed -e 's/ecoff//'` ;;
73alpha*-*-linux-*)	targ_emul=elf64alpha targ_extra_emuls=alpha
74			tdir_alpha=`echo ${targ_alias} | sed -e 's/linux\(-gnu\)*/linux\1ecoff/'` ;;
75alpha*-*-osf*)		targ_emul=alpha ;;
76alpha*-*-gnu*)		targ_emul=elf64alpha ;;
77alpha*-*-netware*)	targ_emul=alpha ;;
78alpha*-*-netbsd*)	targ_emul=elf64alpha_nbsd ;;
79alpha*-*-openbsd*)	targ_emul=elf64alpha ;;
80alpha*-*-*vms*)		targ_emul=alphavms
81			;;
82arc*-*-elf*)		targ_emul=arcelf
83            		targ_extra_emuls="arcelf_prof arclinux arclinux_prof arcv2elf arcv2elfx"
84            		;;
85arc*-*-linux*)		targ_emul=arclinux
86			targ_extra_emuls="arclinux_prof arcelf arcelf_prof arcv2elf arcv2elfx"
87			;;
88arm-epoc-pe)		targ_emul=arm_epoc_pe ;	targ_extra_ofiles="deffilep.o pe-dll.o" ;;
89arm*-*-cegcc*)		targ_emul=arm_wince_pe ; targ_extra_ofiles="deffilep.o pe-dll.o"
90			LIB_PATH='${tooldir}/lib/w32api' ;;
91arm-wince-pe | arm-*-wince | arm*-*-mingw32ce*)
92			targ_emul=arm_wince_pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
93arm-*-pe)		targ_emul=armpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
94arm-*-aout | armel-*-aout) targ_emul=armaoutl ;;
95armeb-*-aout)		targ_emul=armaoutb ;;
96arm-*-coff)		targ_emul=armcoff ;;
97arm*b-*-freebsd*)	targ_emul=armelfb_fbsd
98			targ_extra_emuls="armelf_fbsd armelf" ;;
99arm*-*-freebsd* | arm-*-kfreebsd*-gnu)
100	       		targ_emul=armelf_fbsd
101			targ_extra_emuls="armelf" ;;
102arm*eb-*-netbsdelf*-*eabihf*)
103			targ_emul=armelfb_nbsd_eabihf;
104			targ_extra_emuls="armelf_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armnbsd" ;;
105arm*eb-*-netbsdelf*-*eabi*)
106			targ_emul=armelfb_nbsd_eabi;
107			targ_extra_emuls="armelf_nbsd_eabi armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd armelfb_nbsd armelf armnbsd" ;;
108arm*-*-netbsdelf*-*eabihf*)
109			targ_emul=armelf_nbsd_eabihf;
110			targ_extra_emuls="armelfb_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armnbsd" ;;
111arm*-*-netbsdelf*-*eabi*)
112			targ_emul=armelf_nbsd_eabi;
113			targ_extra_emuls="armelfb_nbsd_eabi armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd armelfb_nbsd armelf armnbsd" ;;
114arm*eb-*-netbsdelf*)	targ_emul=armelfb_nbsd;
115			targ_extra_emuls="armelf_nbsd armelf armnbsd" ;;
116arm-*-netbsdelf*)	targ_emul=armelf_nbsd;
117			targ_extra_emuls="armelfb_nbsd armelf armnbsd" ;;
118arm-*-netbsd*)		targ_emul=armnbsd;
119			targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd"  ;;
120arm-*-nto*)		targ_emul=armnto ;;
121arm-*-openbsd*)		targ_emul=armnbsd ;;
122arm-*-phoenix*)		targ_emul=armelf ;;
123arm-*-rtems*)		targ_emul=armelf ;;
124armeb-*-elf | armeb-*-eabi*)
125			targ_emul=armelfb ;;
126arm-*-elf | arm*-*-eabi*)
127	  		targ_emul=armelf ;;
128arm*-*-symbianelf*)     targ_emul=armsymbian;;
129arm-*-kaos*)		targ_emul=armelf ;;
130arm9e-*-elf)		targ_emul=armelf ;;
131arm*b-*-linux-*eabi*)	targ_emul=armelfb_linux_eabi
132			targ_extra_emuls=armelf_linux_eabi
133			targ_extra_libpath=$targ_extra_emuls
134			;;
135arm*b-*-linux-*)	targ_emul=armelfb_linux
136			targ_extra_emuls="armelfb armelf armelf_linux"
137			targ_extra_libpath="armelf_linux"
138			;;
139arm*-*-linux-*eabi*)	targ_emul=armelf_linux_eabi
140			targ_extra_emuls=armelfb_linux_eabi
141			targ_extra_libpath=$targ_extra_emuls
142			;;
143arm*-*-linux-*)	        targ_emul=armelf_linux
144			targ_extra_emuls="armelf armelfb armelfb_linux"
145			targ_extra_libpath="armelfb_linux"
146			;;
147arm*b-*-nacl*)		targ_emul=armelfb_nacl
148			targ_extra_emuls="armelf_nacl elf_i386_nacl"
149			targ_extra_libpath=$targ_extra_emuls
150			targ64_extra_emuls="elf32_x86_64_nacl elf_x86_64_nacl"
151			targ64_extra_libpath=$targ64_extra_emuls
152			;;
153arm*-*-nacl*)		targ_emul=armelf_nacl
154			targ_extra_emuls="armelfb_nacl elf_i386_nacl"
155			targ_extra_libpath=$targ_extra_emuls
156			targ64_extra_emuls="elf32_x86_64_nacl elf_x86_64_nacl"
157			targ64_extra_libpath=$targ64_extra_emuls
158			;;
159arm*-*-uclinux*eabi*)	targ_emul=armelf_linux_eabi
160			targ_extra_emuls=armelfb_linux_eabi
161			targ_extra_libpath=$targ_extra_emuls
162			;;
163arm*-*-uclinux*)	targ_emul=armelf_linux
164			targ_extra_emuls="armelf armelfb armelfb_linux"
165			targ_extra_libpath="armelfb_linux"
166			;;
167arm-*-vxworks)		targ_emul=armelf_vxworks ;;
168arm*-*-conix*)		targ_emul=armelf ;;
169avr-*-*)		targ_emul=avr2
170			targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny"
171			;;
172bfin-*-elf)		targ_emul=elf32bfin;
173			targ_extra_emuls="elf32bfinfd"
174			targ_extra_libpath=$targ_extra_emuls
175			;;
176bfin-*-rtems*)		targ_emul=elf32bfin;
177			targ_extra_emuls="elf32bfinfd"
178			targ_extra_libpath=$targ_extra_emuls
179			;;
180bfin-*-uclinux*)	targ_emul=elf32bfin;
181			targ_extra_emuls="elf32bfinfd"
182			targ_extra_libpath=$targ_extra_emuls
183			;;
184bfin-*-linux-uclibc*)	targ_emul=elf32bfinfd;
185			targ_extra_emuls="elf32bfin"
186			targ_extra_libpath=$targ_extra_emuls
187			;;
188cr16-*-elf*)            targ_emul=elf32cr16 ;;
189cr16c-*-elf*)           targ_emul=elf32cr16c
190			;;
191cris-*-*aout*)		targ_emul=crisaout
192			targ_extra_emuls="criself crislinux"
193			targ_extra_libpath=$targ_extra_emuls ;;
194cris-*-linux-* | crisv32-*-linux-*)
195			targ_emul=crislinux ;;
196cris-*-* | crisv32-*-*)	targ_emul=criself
197			targ_extra_emuls="crisaout crislinux"
198			targ_extra_libpath=$targ_extra_emuls
199			;;
200crx-*-elf*)		targ_emul=elf32crx
201			;;
202d10v-*-*)		targ_emul=d10velf ;;
203d30v-*-*ext*)		targ_emul=d30v_e; targ_extra_emuls="d30velf d30v_o" ;;
204d30v-*-*onchip*)	targ_emul=d30v_o; targ_extra_emuls="d30velf d30v_e" ;;
205d30v-*-*)		targ_emul=d30velf; targ_extra_emuls="d30v_e d30v_o"
206			;;
207dlx-*-elf*)		targ_emul=elf32_dlx
208			;;
209epiphany-*-elf)		targ_emul=elf32epiphany
210			targ_extra_emuls="elf32epiphany_4x4"
211			;;
212fido*-*-elf*)		targ_emul=m68kelf ;;
213fr30-*-*)		targ_emul=elf32fr30
214			;;
215frv-*-*linux*)		targ_emul=elf32frvfd ;;
216frv-*-*)		targ_emul=elf32frv ; targ_extra_emuls="elf32frvfd"
217			;;
218moxie-*-moxiebox*)	targ_emul=moxiebox
219			;;
220moxie-*-*)		targ_emul=elf32moxie
221			;;
222h8300-*-hms* | h8300-*-coff* | h8300-*-rtemscoff*)
223			targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn h8300sx h8300sxn" ;;
224h8300-*-elf* | h8300-*-rtems*)
225			targ_emul=h8300elf;
226			targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf" ;;
227h8300-*-linux*)
228			targ_emul=h8300elf_linux;
229			targ_extra_emuls="h8300helf_linux h8300self_linux h8300sxelf_linux" ;;
230h8500-*-hms* | h8500-*-coff* | h8500-*-rtems*)
231			targ_emul=h8500
232			targ_extra_emuls="h8500s h8500b h8500m h8500c"
233			;;
234hppa*64*-*-linux-*)	targ_emul=hppa64linux ;;
235hppa*64*-hpux*)		targ_emul=elf64hppa ;;
236hppa*-*-linux-*)	targ_emul=hppalinux ;;
237hppa*-*-*elf*)		targ_emul=hppaelf ;;
238hppa*-*-lites*)		targ_emul=hppaelf ;;
239hppa*-*-netbsd*)	targ_emul=hppanbsd ;;
240hppa*-*-openbsd*)	targ_emul=hppaobsd
241			;;
242i370-*-elf* | i370-*-linux-*) targ_emul=elf32i370
243			;;
244i[3-7]86-*-nto-qnx*)	targ_emul=i386nto ;;
245i[3-7]86-*-vsta)	targ_emul=vsta ;;
246i[3-7]86-*-go32)	targ_emul=i386go32 ;;
247i[3-7]86-*-msdosdjgpp*) targ_emul=i386go32 ;;
248i[3-7]86-*-aix*)	targ_emul=i386coff ;;
249i[3-7]86-*-sco*)	targ_emul=i386coff ;;
250i[3-7]86-*-isc*)	targ_emul=i386coff ;;
251i[3-7]86-*-lynxos*)	targ_emul=i386lynx ;;
252i[3-7]86-*-coff)	targ_emul=i386coff ;;
253i[3-7]86-*-rtems*)	targ_emul=elf_i386
254			targ_extra_emuls=elf_iamcu ;;
255i[3-7]86-*-aros*)	targ_emul=elf_i386
256			targ_extra_emuls=elf_iamcu ;;
257i[3-7]86-*-rdos*)	targ_emul=elf_i386
258			targ_extra_emuls=elf_iamcu ;;
259x86_64-*-rdos*)		targ_emul=elf64rdos ;;
260x86_64-*-cloudabi*)	targ_emul=elf_x86_64_cloudabi ;;
261i[3-7]86-*-bsd)		targ_emul=i386bsd ;;
262i[3-7]86-*-bsd386)	targ_emul=i386bsd ;;
263i[3-7]86-*-bsdi*)	targ_emul=i386bsd ;;
264i[3-7]86-*-aout)	targ_emul=i386aout ;;
265i[3-7]86-*-linux*aout*)	targ_emul=i386linux
266			targ_extra_emuls="elf_i386 elf_iamcu"
267			tdir_elf_iamcu=`echo ${targ_alias} | sed -e 's/aout//'`
268			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;;
269i[3-7]86-*-linux*oldld)	targ_emul=i386linux
270			targ_extra_emuls="elf_i386 elf_iamcu" ;;
271i[3-7]86-*-linux-*)	targ_emul=elf_i386
272			targ_extra_emuls="i386linux elf_iamcu"
273			targ64_extra_emuls="elf_x86_64 elf32_x86_64 elf_l1om elf_k1om"
274			targ64_extra_libpath=elf_x86_64
275			targ_extra_libpath=elf32_x86_64
276			tdir_i386linux=${targ_alias}aout ;;
277x86_64-*-linux-gnux32)	targ_emul=elf32_x86_64
278			targ_extra_emuls="elf_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om"
279			targ_extra_libpath="elf_i386 elf_iamcu elf_x86_64 elf_l1om elf_k1om"
280			tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
281			tdir_elf_iamcu=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
282			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'` ;;
283x86_64-*-linux-*)	targ_emul=elf_x86_64
284			targ_extra_emuls="elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om"
285			targ_extra_libpath="elf_i386 elf32_x86_64 elf_l1om elf_k1om"
286			tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
287			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
288i[3-7]86-*-sysv[45]*)	targ_emul=elf_i386
289			targ_extra_emuls=elf_iamcu ;;
290i[3-7]86-*-solaris2*)	targ_emul=elf_i386_sol2
291                        targ_extra_emuls="elf_i386_ldso elf_i386 elf_iamcu elf_x86_64_sol2 elf_x86_64 elf_l1om elf_k1om"
292			targ_extra_libpath=$targ_extra_emuls
293                        ;;
294x86_64-*-solaris2*)
295			targ_emul=elf_x86_64_sol2
296			targ_extra_emuls="elf_x86_64 elf_i386_sol2 elf_i386_ldso elf_i386 elf_iamcu elf_l1om elf_k1om"
297			targ_extra_libpath=$targ_extra_emuls
298			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
299i[3-7]86-*-unixware)	targ_emul=elf_i386
300			targ_extra_emuls=elf_iamcu ;;
301i[3-7]86-*-solaris*)	targ_emul=elf_i386_ldso
302                        targ_extra_emuls="elf_i386"
303			targ_extra_libpath=$targ_extra_emuls
304                        ;;
305i[3-7]86-*-netbsdelf* | \
306i[3-7]86-*-netbsd*-gnu* | \
307i[3-7]86-*-knetbsd*-gnu)
308			targ_emul=elf_i386
309			targ_extra_emuls="elf_iamcu i386nbsd" ;;
310i[3-7]86-*-netbsdpe*)	targ_emul=i386pe
311			targ_extra_ofiles="deffilep.o pe-dll.o" ;;
312i[3-7]86-*-netbsd*)	targ_emul=i386nbsd
313			targ_extra_emuls=elf_i386 ;;
314x86_64-*-netbsd*)	targ_emul=elf_x86_64
315			targ_extra_emuls="elf_i386 elf_iamcu i386nbsd elf_l1om elf_k1om"
316			tdir_elf_iamcu=`echo ${targ_alias} | \
317			    sed -e 's/x86_64/i386/'`
318			case "${tdir_elf_iamcu}" in
319			*-netbsdelf*)   ;;
320			*)		tdir_elf_iamcu=`echo ${tdir_elf_iamcu} | \
321				        sed -e 's/netbsd/netbsdelf/'`;;
322			esac
323			tdir_elf_i386=`echo ${targ_alias} | \
324			    sed -e 's/x86_64/i386/'`
325			case "${tdir_elf_i386}" in
326			*-netbsdelf*)   ;;
327			*)		tdir_elf_i386=`echo ${tdir_elf_i386} | \
328				        sed -e 's/netbsd/netbsdelf/'`;;
329			esac ;;
330i[3-7]86-*-netware)	targ_emul=i386nw ;;
331i[3-7]86-*-elfiamcu)	targ_emul=elf_iamcu
332			targ_extra_emuls=elf_i386 ;;
333i[3-7]86-*-elf*)	targ_emul=elf_i386
334			targ_extra_emuls=elf_iamcu ;;
335x86_64-*-elf* | x86_64-*-rtems*)
336			targ_emul=elf_x86_64
337			targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om"
338			targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om"
339			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
340			;;
341i[3-7]86-*-kaos*)	targ_emul=elf_i386 ;;
342i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | i[3-7]86-*-freebsd[12])
343			targ_emul=i386bsd ;;
344i[3-7]86-*-dragonfly*)	targ_emul=elf_i386
345			targ_extra_emuls="elf_iamcu i386bsd" ;;
346x86_64-*-dragonfly*)	targ_emul=elf_x86_64
347			targ_extra_emuls="elf_i386 elf_iamcu elf_l1om elf_k1om" ;;
348i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
349		        targ_emul=elf_i386_fbsd
350			targ_extra_emuls="elf_i386 elf_iamcu i386bsd" ;;
351x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
352			targ_emul=elf_x86_64_fbsd
353			targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386 elf_iamcu elf_l1om elf_l1om_fbsd elf_k1om elf_k1om_fbsd"
354			targ_extra_libpath="elf_i386_fbsd"
355			tdir_elf_i386_fbsd=`echo ${targ_alias} \
356			    | sed -e 's/x86_64/i386/'`
357			tdir_elf_iamcu=`echo ${targ_alias} \
358			    | sed -e 's/x86_64/i386/'`
359			tdir_elf_i386=`echo ${targ_alias} \
360			    | sed -e 's/x86_64/i386/'` ;;
361i[3-7]86-*-sysv*)	targ_emul=i386coff ;;
362i[3-7]86-*-ptx*)	targ_emul=i386coff ;;
363i[3-7]86-*-mach*)	targ_emul=i386mach ;;
364i[3-7]86-*-gnu*)	targ_emul=elf_i386
365			targ_extra_emuls=elf_iamcu ;;
366i[3-7]86-*-msdos*)	targ_emul=i386msdos; targ_extra_emuls=i386aout ;;
367i[3-7]86-*-moss*)	targ_emul=i386moss; targ_extra_emuls=i386msdos ;;
368i[3-7]86-*-winnt*)	targ_emul=i386pe ;
369			targ_extra_ofiles="deffilep.o pe-dll.o" ;;
370i[3-7]86-*-pe)		targ_emul=i386pe ;
371			targ_extra_ofiles="deffilep.o pe-dll.o" ;;
372i[3-7]86-*-cygwin*)	targ_emul=i386pe ;
373			targ_extra_ofiles="deffilep.o pe-dll.o" ;
374			test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;;
375i[3-7]86-*-mingw32*)	targ_emul=i386pe ;
376			targ_extra_ofiles="deffilep.o pe-dll.o" ;;
377x86_64-*-pe | x86_64-*-pep) targ_emul=i386pep ;
378			targ_extra_emuls=i386pe ;
379			targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" ;;
380x86_64-*-cygwin)	targ_emul=i386pep ;
381			targ_extra_emuls=i386pe
382			targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o"
383			test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;;
384x86_64-*-mingw*)	targ_emul=i386pep ;
385			targ_extra_emuls=i386pe
386			targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" ;;
387i[3-7]86-*-interix*)	targ_emul=i386pe_posix;
388 			targ_extra_ofiles="deffilep.o pe-dll.o" ;;
389i[3-7]86-*-beospe*)	targ_emul=i386beos ;;
390i[3-7]86-*-beos*)	targ_emul=elf_i386_be ;;
391i[3-7]86-*-vxworks*)	targ_emul=elf_i386_vxworks ;;
392i[3-7]86-*-chaos)	targ_emul=elf_i386_chaos
393			;;
394i[3-7]86-*-nacl*)	targ_emul=elf_i386_nacl
395			targ_extra_emuls="armelf_nacl armelfb_nacl"
396			targ_extra_libpath=$targ_extra_emuls
397			targ64_extra_emuls="elf32_x86_64_nacl elf_x86_64_nacl"
398			targ64_extra_libpath=$targ64_extra_emuls
399			;;
400x86_64-*-nacl*)		targ_emul=elf32_x86_64_nacl
401			targ_extra_emuls="elf_i386_nacl elf_x86_64_nacl armelf_nacl armelfb_nacl"
402			targ_extra_libpath=$targ_extra_emuls
403			tdir_elf_i386_nacl=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
404			;;
405i860-*-coff)		targ_emul=coff_i860 ;;
406i860-stardent-sysv4* | i860-stardent-elf*)
407			targ_emul=elf32_i860
408			;;
409i960-wrs-vxworks5.0*)	targ_emul=gld960 ;;
410i960-wrs-vxworks5*)	targ_emul=gld960coff ;;
411i960-wrs-vxworks*)	targ_emul=gld960 ;;
412i960-*-coff)		targ_emul=gld960coff ;;
413i960-intel-nindy)	targ_emul=gld960 ;;
414i960-*-rtems*)		targ_emul=gld960coff ;;
415i960-*-elf*)		targ_emul=elf32_i960
416			;;
417ia64-*-elf*)		targ_emul=elf64_ia64 ;;
418ia64-*-freebsd* | ia64-*-kfreebsd*-gnu)
419		        targ_emul=elf64_ia64_fbsd
420			targ_extra_emuls="elf64_ia64" ;;
421ia64-*-netbsd*)		targ_emul=elf64_ia64 ;;
422ia64-*-linux*)		targ_emul=elf64_ia64 ;;
423ia64-*-*vms*)		targ_emul=elf64_ia64_vms ;;
424ia64-*-aix*)		targ_emul=elf64_aix
425			;;
426ip2k-*-elf)		targ_emul=elf32ip2k
427			;;
428iq2000-*-elf)           targ_emul=elf32iq2000 ; targ_extra_emuls="elf32iq10"
429			;;
430lm32-*-*linux*)         targ_emul=elf32lm32fd ;;
431lm32-*-*)               targ_emul=elf32lm32 ; targ_extra_emuls="elf32lm32fd"
432                        ;;
433m32c-*-elf | m32c-*-rtems*)
434			targ_emul=elf32m32c
435			;;
436m32r*le-*-elf*)         targ_emul=m32rlelf ;;
437m32r*-*-elf* | m32r*-*-rtems*)
438			targ_emul=m32relf ;;
439m32r*le-*-linux-*)      targ_emul=m32rlelf_linux ;;
440m32r*-*-linux-*)        targ_emul=m32relf_linux
441			;;
442m68hc11-*-*|m6811-*-*)	targ_emul=m68hc11elf
443			targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
444m68hc12-*-*|m6812-*-*)	targ_emul=m68hc12elf
445			targ_extra_emuls="m68hc12elfb m68hc11elf m68hc11elfb" ;;
446m68*-sun-sunos[34]*)	targ_emul=sun3 ;;
447m68*-wrs-vxworks*)	targ_emul=sun3 ;;
448m68*-ericsson-ose)	targ_emul=sun3 ;;
449m68*-apple-aux*)	targ_emul=m68kaux ;;
450m68k-sony-*)		targ_emul=news ;;
451m68k-hp-bsd*)		targ_emul=hp300bsd ;;
452m68*-motorola-sysv*)	targ_emul=delta68 ;;
453m68*-*-aout)		targ_emul=m68kaout ;;
454m68*-*-coff)		targ_emul=m68kcoff ;;
455m68*-*-elf)		targ_emul=m68kelf ;;
456m68*-*-hpux*)		targ_emul=hp3hpux ;;
457m68k-*-linux*aout*)	targ_emul=m68klinux
458			targ_extra_emuls=m68kelf
459			tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'` ;;
460m68k-*-linux-*) 	targ_emul=m68kelf
461			targ_extra_emuls=m68klinux
462			tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'` ;;
463m68k-*-uclinux*)	targ_emul=m68kelf ;;
464m68*-*-gnu*)		targ_emul=m68kelf ;;
465m68*-*-netbsd*4k*)	targ_emul=m68k4knbsd
466			targ_extra_emuls="m68knbsd m68kelfnbsd" ;;
467m68*-*-netbsdelf* | m5407*-*-netbsdelf*)
468			targ_emul=m68kelfnbsd
469			targ_extra_emuls="m68knbsd m68k4knbsd" ;;
470m68*-*-netbsdaout* | m68*-*-netbsd*)
471			targ_emul=m68knbsd
472			targ_extra_emuls="m68kelfnbsd m68k4knbsd" ;;
473m68*-*-psos*)		targ_emul=m68kpsos ;;
474m68*-*-rtemscoff*)	targ_emul=m68kcoff ;;
475m68*-*-rtems*)		targ_emul=m68kelf
476			;;
477m8*-*-*)		targ_emul=m88kbcs
478			;;
479mcore-*-pe)		targ_emul=mcorepe ;
480			targ_extra_ofiles="deffilep.o pe-dll.o" ;;
481mcore-*-elf)		targ_emul=elf32mcore
482			;;
483mep-*-elf)		targ_emul=elf32mep ;;
484metag-*-*)		targ_emul=elf32metag ;;
485microblazeel*-linux*)	targ_emul="elf32mbel_linux"
486			targ_extra_emuls="elf32mb_linux"
487			;;
488microblaze*-linux*)	targ_emul="elf32mb_linux"
489			targ_extra_emuls="elf32mbel_linux"
490			;;
491microblazeel*)		targ_emul=elf32microblazeel
492			targ_extra_emuls=elf32microblaze
493			;;
494microblaze*)		targ_emul=elf32microblaze
495			targ_extra_emuls=elf32microblazeel
496			;;
497mips*-sgi-irix5*)	targ_emul=elf32bsmip ;;
498mips*-sgi-irix6*)	targ_emul=elf32bmipn32
499	                targ_extra_emuls="elf32bsmip elf64bmip"
500			targ_extra_libpath=$targ_extra_emuls ;;
501mips64*el-*-netbsd*)	targ_emul=elf32ltsmipn32 	 
502			targ_extra_emuls="elf64btsmip elf64ltsmip elf32ltsmip elf32btsmipn32 elf32btsmip" 	 
503			targ_extra_libpath=$targ_extra_emuls
504			;; 	 
505mips64*-*-netbsd*)	targ_emul=elf32btsmipn32
506			targ_extra_emuls="elf64ltsmip elf64btsmip elf32btsmip elf32ltsmipn32 elf32ltsmip"
507			targ_extra_libpath=$targ_extra_emuls
508  			;;
509mips*el-*-netbsd*)	targ_emul=elf32ltsmip
510			targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
511			;;
512mips*-*-netbsd*)	targ_emul=elf32btsmip
513			targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip"
514			;;
515mips*-*-bsd*)		targ_emul=mipsbig ;;
516mips*vr4300el-*-elf*)	targ_emul=elf32l4300 ;;
517mips*vr4300-*-elf*)	targ_emul=elf32b4300 ;;
518mips*vr4100el-*-elf*)	targ_emul=elf32l4300 ;;
519mips*vr4100-*-elf*)	targ_emul=elf32b4300 ;;
520mips*vr5000el-*-elf*)	targ_emul=elf32l4300 ;;
521mips*vr5000-*-elf*)	targ_emul=elf32b4300 ;;
522mips*el-sde-elf* | mips*el-mti-elf* | mips*el-img-elf*)
523			targ_emul=elf32ltsmip
524			targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" ;;
525mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
526			targ_emul=elf32btsmip
527			targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" ;;
528mips64*el-ps2-elf*)	targ_emul=elf32lr5900n32
529			targ_extra_emuls="elf32lr5900"
530			targ_extra_libpath=$targ_extra_emuls ;;
531mips*el-ps2-elf*)	targ_emul=elf32lr5900
532			targ_extra_emuls="elf32lr5900n32"
533			targ_extra_libpath=$targ_extra_emuls ;;
534mips*el-*-elf*)		targ_emul=elf32elmip ;;
535mips*-*-elf*)		targ_emul=elf32ebmip ;;
536mips*-*-rtems*)		targ_emul=elf32ebmip ;;
537mips*el-*-vxworks*)	targ_emul=elf32elmipvxworks
538			targ_extra_emuls="elf32ebmipvxworks" ;;
539mips*-*-vxworks*)	targ_emul=elf32ebmipvxworks
540		        targ_extra_emuls="elf32elmipvxworks" ;;
541mips*-*-windiss)	targ_emul=elf32mipswindiss ;;
542mips64*el-*-linux-*)	targ_emul=elf32ltsmipn32
543			targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
544			targ_extra_libpath=$targ_extra_emuls ;;
545mips64*-*-linux-*)	targ_emul=elf32btsmipn32
546			targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
547			targ_extra_libpath=$targ_extra_emuls ;;
548mips*el-*-linux-*)	targ_emul=elf32ltsmip
549			targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
550			targ_extra_libpath=$targ_extra_emuls ;;
551mips*-*-linux-*)	targ_emul=elf32btsmip
552			targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
553			targ_extra_libpath=$targ_extra_emuls ;;
554mips64*el-*-freebsd* | mips64*el-*-kfreebsd*-gnu)
555			targ_emul=elf32ltsmipn32_fbsd
556			targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmip_fbsd elf32btsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
557			targ_extra_libpath=$targ_extra_emuls ;;
558mips64*-*-freebsd* | mips64*-*-kfreebsd*-gnu)
559			targ_emul=elf32btsmipn32_fbsd
560			targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmip_fbsd elf32ltsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
561			targ_extra_libpath=$targ_extra_emuls ;;
562mips*el-*-freebsd* | mips*el-*-kfreebsd*-gnu)
563			targ_emul=elf32ltsmip_fbsd
564			targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmipn32_fbsd elf32btsmip_fbsd elf32btsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
565			targ_extra_libpath=$targ_extra_emuls ;;
566mips*-*-freebsd* | mips*-*-kfreebsd*-gnu)
567			targ_emul=elf32btsmip_fbsd
568			targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmipn32_fbsd elf32ltsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
569			targ_extra_libpath=$targ_extra_emuls ;;
570mips*-*-sysv4*)         targ_emul=elf32btsmip
571			;;
572mmix-*-*)		targ_emul=mmo
573			targ_extra_emuls=elf64mmix
574			;;
575am33_2.0-*-linux*)	targ_emul=elf32am33lin ;;
576mn10200-*-*)		targ_emul=mn10200 ;;
577mn10300-*-*)		targ_emul=mn10300
578			;;
579mt-*elf)                targ_emul=elf32mt
580			;;
581msp430-*-*)             targ_emul=msp430elf
582			targ_extra_emuls="msp430X"
583			;;
584nds32*le-*-elf*)	targ_emul=nds32elf
585			targ_extra_emuls="nds32elf16m nds32belf nds32belf16m"
586			;;
587nds32*be-*-elf*)	targ_emul=nds32belf
588			targ_extra_emuls="nds32elf nds32elf16m nds32belf16m"
589			;;
590nds32*le-*-linux-gnu*)	targ_emul=nds32elf_linux ;;
591nds32*be-*-linux-gnu*)	targ_emul=nds32belf_linux ;;
592nios2*-*-linux*)	targ_emul=nios2linux ;;
593nios2*-*-*)		targ_emul=nios2elf ;;
594ns32k-pc532-mach* | ns32k-pc532-ux*)  targ_emul=pc532macha ;;
595ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd
596			;;
597or1k-*-elf | or1knd-*-elf)		targ_emul=elf32or1k ;;
598or1k-*-linux* | or1knd-*-linux*)	targ_emul=elf32or1k_linux ;;
599or1k-*-netbsd* | or1knd-*-netbsd*)	targ_emul=elf32or1k_nbsd ;;
600or1k-*-rtems* | or1knd-*-rtems*)	targ_emul=elf32or1k
601			;;
602pdp11-*-*)		targ_emul=pdp11
603			;;
604pjl*-*-*)	        targ_emul=pjlelf
605			targ_extra_emuls="elf_i386 elf_iamcu" ;;
606pj*-*-*)	        targ_emul=pjelf
607			;;
608powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu)
609			targ_emul=elf32ppc_fbsd
610			targ_extra_emuls="elf32ppc elf32ppcsim"
611			targ_extra_libpath=elf32ppc;
612			tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'` ;;
613powerpc64-*-freebsd*)
614			targ_emul=elf64ppc_fbsd
615			targ_extra_emuls="elf64ppc elf32ppc_fbsd elf32ppc"
616			targ_extra_libpath="elf32ppc_fbsd elf32ppc"
617			tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
618			tdir_elf32ppc_fbsd=$tdir_elf32ppc
619			;;
620powerpc-*-netbsd*)
621			targ_emul=elf32ppc_nbsd
622			targ_extra_emuls="elf32ppc elf32ppcsim"
623			targ_extra_libpath=elf32ppc;
624			tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'`
625			targ64_extra_emuls=elf64ppc
626			targ64_extra_libpath=elf64ppc
627			;;
628powerpc64-*-netbsd*)
629			targ_emul=elf64ppc
630			targ_extra_emuls="elf32ppc elf32ppc_nbsd elf32ppcsim"
631			targ_extra_libpath="elf32ppc_nbsd elf32ppc"
632			tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
633			tdir_elf32ppc_fbsd=$tdir_elf32ppc
634			;;
635powerpc-*-vxworks*)
636			targ_emul=elf32ppcvxworks
637			targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim" ;;
638powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
639  | powerpc*-*-linux* | powerpc*-*-openbsd* \
640  | powerpc*-*-solaris* | powerpc*-*-kaos* | powerpc*-*-vxworks*)
641			case "${targ}" in
642			*64*)	targ_emul=elf64ppc
643				targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
644				targ_extra_libpath="elf32ppc elf32ppclinux"
645				td=tdir_elf32ppc
646				case "${targ}" in
647				powerpc*le-*) td=tdir_elf32lppc;;
648				esac
649				eval ${td}=`echo "${targ_alias}" | sed -e 's/64//'`
650				eval ${td}linux=\$${td}
651				eval ${td}sim=\$${td}
652				;;
653			*linux*) targ_emul=elf32ppclinux
654				targ_extra_emuls="elf32ppc elf32ppcsim"
655				targ_extra_libpath=elf32ppc
656				targ64_extra_emuls=elf64ppc
657				targ64_extra_libpath=elf64ppc
658				;;
659			*)	targ_emul=elf32ppc
660				targ_extra_emuls="elf32ppclinux elf32ppcsim"
661				targ_extra_libpath=elf32ppclinux
662				targ64_extra_emuls=elf64ppc
663				targ64_extra_libpath=elf64ppc
664			esac
665			case "${targ}" in
666			powerpc*le-*)
667				# PR 19985: Include big endian emulations.
668				for z in targ_extra_emuls targ_extra_libpath targ64_extra_emuls targ64_extra_libpath
669				do
670				  eval ${z}=\"\$${z} `eval echo \\$${z} | sed -e 's/ppc/lppc/g'`\"
671				done
672				targ_extra_emuls="$targ_extra_emuls $targ_emul"
673			        eval targ_emul=\"`eval echo \\$targ_emul | sed -e 's/ppc/lppc/g'`\"
674			esac ;;
675powerpc-*-nto*)         targ_emul=elf32ppcnto ;;
676powerpcle-*-nto*)       targ_emul=elf32lppcnto ;;
677powerpc-*-rtems*)	targ_emul=elf32ppc ;;
678powerpc-*-macos*)	targ_emul=ppcmacos ;;
679powerpc-*-netware*)	targ_emul=ppcnw ;;
680powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
681			targ_emul=ppcpe
682			targ_extra_ofiles="deffilep.o pe-dll.o" ;;
683powerpc-*-aix[5-9]*)	targ_emul=aix5ppc ;;
684powerpc-*-aix*)		targ_emul=aixppc ;;
685powerpc-*-beos*)	targ_emul=aixppc ;;
686powerpc-*-windiss*)	targ_emul=elf32ppcwindiss ;;
687powerpc-*-lynxos*)	targ_emul=ppclynx ;;
688riscv32-*-*)		targ_emul=elf32lriscv
689			targ_extra_emuls="elf64lriscv"
690			targ_extra_libpath=$targ_extra_emuls ;;
691riscv*-*-*)		targ_emul=elf64lriscv
692			targ_extra_emuls="elf32lriscv"
693			targ_extra_libpath=$targ_extra_emuls ;;
694rs6000-*-aix[5-9]*)	targ_emul=aix5rs6 ;;
695rs6000-*-aix*)		targ_emul=aixrs6
696			;;
697rl78-*-*)		targ_emul=elf32rl78 ;;
698rx-*-*)			targ_emul=elf32rx ;;
699s390x-*-linux*)         targ_emul=elf64_s390
700			targ_extra_emuls=elf_s390
701			targ_extra_libpath=$targ_extra_emuls
702			tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'` ;;
703s390x-*-tpf*)		targ_emul=elf64_s390
704			tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'` ;;
705s390-*-linux*)          targ_emul=elf_s390
706			targ64_extra_emuls=elf64_s390
707			targ64_extra_libpath=elf64_s390
708			tdir_elf64_s390=`echo ${targ_alias} | sed -e 's/s390/s390x/'`
709			;;
710score-*-elf)            targ_emul=score7_elf
711			targ_extra_emuls=score3_elf ;;
712sh-*-linux*)		targ_emul=shlelf_linux
713			targ_extra_emuls="shelf_linux shlelf_fd shelf_fd"
714			targ_extra_libpath=shelf_linux ;;
715sh64eb-*-linux*)	targ_emul=shelf32_linux
716			targ_extra_emuls="shlelf32_linux" ;;
717sh64-*-linux*)		targ_emul=shlelf32_linux
718			targ_extra_emuls="shelf32_linux"
719			targ_extra_libpath=shelf32_linux ;;
720sh*eb-*-linux*)		targ_emul=shelf_linux
721			targ_extra_emuls="shelf_fd" ;;
722sh*-*-linux*)		targ_emul=shlelf_linux
723			targ_extra_emuls="shlelf_fd" ;;
724sh5le-*-netbsd*)	targ_emul=shlelf32_nbsd
725			targ_extra_emuls="shelf32_nbsd shelf64_nbsd shlelf64_nbsd shelf_nbsd shlelf_nbsd" ;;
726sh5-*-netbsd*)		targ_emul=shelf32_nbsd
727			targ_extra_emuls="shlelf32_nbsd shelf64_nbsd shlelf64_nbsd shelf_nbsd shlelf_nbsd" ;;
728sh64le-*-netbsd*)	targ_emul=shlelf64_nbsd
729			targ_extra_emuls="shelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd" ;;
730sh64-*-netbsd*)		targ_emul=shelf64_nbsd
731			targ_extra_emuls="shlelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd" ;;
732sh*l*-*-netbsdelf*)	targ_emul=shlelf_nbsd
733			targ_extra_emuls=shelf_nbsd ;;
734sh*-*-netbsdelf*)	targ_emul=shelf_nbsd
735			targ_extra_emuls=shlelf_nbsd ;;
736sh*-*-symbianelf*)	targ_emul=shlsymbian ;;
737shle*-*-elf* | sh[1234]*le*-*-elf | shle*-*-kaos*)
738			targ_emul=shlelf
739			targ_extra_emuls="shelf shl sh"	;;
740sh-*-rtemscoff*)	targ_emul=sh; targ_extra_emuls=shl ;;
741sh-*-elf* | sh[1234]*-*-elf | sh-*-rtems* | sh-*-kaos*)
742			targ_emul=shelf
743			targ_extra_emuls="shlelf sh shl" ;;
744sh-*-uclinux* | sh[12]-*-uclinux*)
745			targ_emul=shelf_uclinux
746			targ_extra_emuls="shelf shlelf sh shl shelf_fd shlelf_fd" ;;
747sh-*-vxworks)		targ_emul=shelf_vxworks
748			targ_extra_emuls=shlelf_vxworks ;;
749sh-*-nto*)		targ_emul=shelf_nto
750			targ_extra_emuls=shlelf_nto ;;
751sh-*-pe)		targ_emul=shpe ;
752			targ_extra_ofiles="deffilep.o pe-dll.o" ;;
753sh-*-*)			targ_emul=sh; targ_extra_emuls=shl ;;
754sh64le-*-elf*)		targ_emul=shlelf
755			targ_extra_emuls="shelf shlelf32 shelf32 shlelf64 shelf64"
756			targ_extra_libpath=$targ_extra_emuls ;;
757sh64-*-elf*)		targ_emul=shelf
758			targ_extra_emuls="shlelf shelf32 shlelf32 shelf64 shlelf64"
759			targ_extra_libpath=$targ_extra_emuls ;;
760sparc64-*-aout*)	targ_emul=sparcaout ;;
761sparc64-*-elf*)		targ_emul=elf64_sparc ;;
762sparc64-*-rtems*)	targ_emul=elf64_sparc ;;
763sparc-sun-sunos4*) 	targ_emul=sun4 ;;
764sparclite*-*-elf)	targ_emul=elf32_sparc ;;
765sparclite*-*-coff)	targ_emul=coff_sparc ;;
766sparclite*-fujitsu-*)	targ_emul=sparcaout ;;
767sparc*-*-aout)		targ_emul=sparcaout ;;
768sparc*-*-coff)		targ_emul=coff_sparc ;;
769sparc*-*-elf)		targ_emul=elf32_sparc ;;
770sparc*-*-sysv4*)	targ_emul=elf32_sparc ;;
771sparc*-*-vxworks*)	targ_emul=elf32_sparc_vxworks ;;
772sparc64-*-freebsd* | sparcv9-*-freebsd* | sparc64-*-kfreebsd*-gnu | sparcv9-*-kfreebsd*-gnu)
773			targ_emul=elf64_sparc_fbsd
774			targ_extra_emuls="elf64_sparc elf32_sparc"
775			targ_extra_libpath=$targ_extra_emuls
776			tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`	;;
777sparc*-*-linux*aout*)	targ_emul=sparclinux
778			targ_extra_emuls="elf32_sparc sun4"
779			tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
780			tdir_sun4=sparc-sun-sunos4 ;;
781sparc64-*-linux-*)	targ_emul=elf64_sparc
782			targ_extra_emuls="elf32_sparc sparclinux sun4"
783			targ_extra_libpath=elf32_sparc
784			tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
785			tdir_sparclinux=${tdir_elf32_sparc}aout
786			tdir_sun4=sparc-sun-sunos4 ;;
787sparc*-*-linux-*)	targ_emul=elf32_sparc
788			targ_extra_emuls="sparclinux elf64_sparc sun4"
789			targ_extra_libpath=elf64_sparc
790			tdir_sparclinux=${targ_alias}aout
791			tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
792			tdir_sun4=sparc-sun-sunos4 ;;
793sparc64-*-netbsd*)	targ_emul=elf64_sparc
794			targ_extra_emuls="elf32_sparc sparcnbsd"
795			;;
796sparc64-*-openbsd*)	targ_emul=elf64_sparc
797			targ_extra_emuls="elf32_sparc"
798			;;
799sparc*-*-netbsd*elf*)	targ_emul=elf32_sparc
800			targ_extra_emuls=sparcnbsd
801			;;
802sparc*-*-netbsd*)	targ_emul=sparcnbsd ;;
803sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
804			targ_emul=elf32_sparc_sol2
805			targ_extra_emuls=elf32_sparc ;;
806sparc-*-solaris2*)	targ_emul=elf32_sparc_sol2
807			targ_extra_emuls="elf32_sparc elf64_sparc_sol2 elf64_sparc"
808			targ_extra_libpath=$targ_extra_emuls
809			tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`	;;
810sparcv9-*-solaris2* | sparc64-*-solaris2*)
811			targ_emul=elf64_sparc_sol2
812			targ_extra_emuls="elf64_sparc elf32_sparc_sol2 elf32_sparc"
813			targ_extra_libpath=$targ_extra_emuls
814			tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` ;;
815sparc*-*-solaris2*)	targ_emul=elf32_sparc ;;
816sparc*-wrs-vxworks*)	targ_emul=sparcaout ;;
817sparc-*-rtems*)		targ_emul=elf32_sparc
818			;;
819spu-*-elf*)		targ_emul=elf32_spu ;;
820tic30-*-*aout*)		targ_emul=tic30aout ;;
821tic30-*-*coff*)		targ_emul=tic30coff ;;
822tic4x-*-* | c4x-*-*)    targ_emul=tic4xcoff ; targ_extra_emuls="tic3xcoff tic3xcoff_onchip" ;;
823tic54x-*-* | c54x*-*-*)	targ_emul=tic54xcoff ;;
824tic6x-*-elf)		targ_emul=elf32_tic6x_elf_le
825			targ_extra_emuls="elf32_tic6x_elf_be elf32_tic6x_le elf32_tic6x_be"
826			targ_extra_libpath=$targ_extra_emuls
827			;;
828tic6x-*-uclinux)	targ_emul=elf32_tic6x_linux_le
829			targ_extra_emuls="elf32_tic6x_linux_be elf32_tic6x_le elf32_tic6x_be"
830			targ_extra_libpath=$targ_extra_emuls
831			;;
832tic80-*-*)		targ_emul=tic80coff
833			;;
834tilegx-*-*)		targ_emul=elf64tilegx
835			targ_extra_emuls="elf64tilegx_be elf32tilegx elf32tilegx_be"
836			targ_extra_libpath=$targ_extra_emuls ;;
837tilegxbe-*-*)		targ_emul=elf64tilegx_be
838			targ_extra_emuls="elf64tilegx elf32tilegx elf32tilegx_be"
839			targ_extra_libpath=$targ_extra_emuls ;;
840tilepro-*-*)		targ_emul=elf32tilepro ;;
841ft32-*-*)		targ_emul=elf32ft32
842			;;
843v850*-*-*)		targ_emul=v850_rh850
844			targ_extra_emuls=v850
845			;;
846vax-dec-ultrix* | vax-dec-bsd*) targ_emul=vax ;;
847vax-*-netbsdelf*)	targ_emul=elf32vax
848			targ_extra_emuls=vaxnbsd ;;
849vax-*-netbsdaout* | vax-*-netbsd*)
850			targ_emul=vaxnbsd
851			targ_extra_emuls=elf32vax ;;
852vax-*-linux-*)  	targ_emul=elf32vax
853			;;
854visium-*-elf)		targ_emul=elf32visium
855			;;
856w65-*-*)		targ_emul=w65
857			;;
858xc16x-*-elf)		targ_emul=elf32xc16x
859                        targ_extra_emuls="elf32xc16xl elf32xc16xs"
860                        ;;
861xstormy16-*-*)		targ_emul=elf32xstormy16
862			;;
863xtensa*-*-*)		targ_emul=elf32xtensa
864			;;
865xgate-*-*)  		targ_emul=xgateelf
866			;;
867z80-*-coff)		targ_emul=z80
868			;;
869z8k-*-coff) 		targ_emul=z8002; targ_extra_emuls=z8001
870			;;
871*-*-ieee*)		targ_emul=vanilla
872			;;
873*-tandem-none)		targ_emul=st2000
874			;;
875*)
876  echo 2>&1 "*** ld does not support target ${targ}"
877  echo 2>&1 "*** see ld/configure.tgt for supported targets"
878  exit 1
879
880esac
881
882NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
883case "${target}" in
884
885*-*-dragonfly*)
886  NATIVE_LIB_DIRS='/lib /usr/lib /usr/pkg/lib /usr/local/lib'
887  ;;
888
889*-*-freebsd*)
890  NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
891  ;;
892
893hppa*64*-*-hpux11*)
894  NATIVE_LIB_DIRS=/usr/lib/pa20_64
895  ;;
896
897i[3-7]86-*-sysv4*)
898  NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
899  ;;
900
901i[3-7]86-*-solaris*)
902  NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
903  ;;
904
905i[3-7]86-pc-interix*)
906  NATIVE_LIB_DIRS='/usr/local/lib $$INTERIX_ROOT/usr/lib /lib /usr/lib'
907  ;;
908
909ia64-*-aix*)
910  NATIVE_LIB_DIRS='/usr/local/lib /usr/lib/ia64l64 /lib /usr/lib'
911  ;;
912
913sparc*-*-solaris2*)
914  NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
915  ;;
916
917spu-*-elf*)
918  # This allows to build a pair of PPU/SPU toolchains with common sysroot.
919  NATIVE_LIB_DIRS='/lib'
920  ;;
921
922i[03-9x]86-*-cygwin* | x86_64-*-cygwin*)
923  NATIVE_LIB_DIRS='/usr/lib /usr/lib/w32api'
924  ;;
925
926*-*-linux*)
927  ;;
928
929*-*-netbsd*)
930  ;;
931
932alpha*-*-*)
933  NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
934  ;;
935
936esac
937
938case "${target}" in
939frv-*-* | hppa*-*-* | ia64-*-* | mips*-*-*)
940  # Don't enable -z relro by default since many relro tests fail on these
941  # targets:
942  # FAIL: strip -z relro (relro1)
943  # FAIL: strip -z relro -shared (relro1)
944  # FAIL: objcopy -z relro (relro1)
945  # FAIL: objcopy -z relro -shared (relro1)
946  # FAIL: objcopy -z relro (tdata1)
947  # FAIL: objcopy -shared -z relro (tdata1)
948  # FAIL: objcopy -z relro (tdata2)
949  # FAIL: objcopy -shared -z relro (tdata2)
950  # FAIL: objcopy -z relro (tdata3)
951  # FAIL: objcopy -shared -z relro (tdata3)
952  # FAIL: objcopy -shared -z relro (tbss1)
953  # FAIL: objcopy -shared -z relro (tbss2)
954  # FAIL: objcopy -shared -z relro (tbss3)
955  ;;
956*-*-linux*)
957  if test ${ac_default_ld_z_relro} = unset; then
958    ac_default_ld_z_relro=1
959  fi
960  ;;
961esac
962