configure.tgt 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  1. # configure.tgt
  2. #
  3. # Copyright (C) 2013-2022 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. # This is the linker target specific file. This is invoked by the
  19. # autoconf generated configure script. Putting it in a separate shell
  20. # file lets us skip running autoconf when modifying target specific
  21. # information.
  22. # This file switches on the shell variable ${targ}, and sets the
  23. # following shell variables:
  24. # targ_emul name of linker emulation to use
  25. # targ_extra_emuls additional linker emulations to provide
  26. # targ_extra_libpath additional linker emulations using LIB_PATH
  27. # targ_extra_ofiles additional host-compiled objects needed by the emulation
  28. # targ64_extra_emuls additional linker emulations to provide if
  29. # --enable-64-bit-bfd is given or if host is 64 bit.
  30. # targ64_extra_libpath additional linker emulations using LIB_PATH if
  31. # --enable-64-bit-bfd is given or if host is 64 bit.
  32. # NATIVE_LIB_DIRS library directories to search on this host
  33. # (if we are a native or sysrooted linker)
  34. targ_extra_emuls=
  35. targ_extra_libpath=
  36. targ_extra_ofiles="ldelf.o ldelfgen.o"
  37. targ64_extra_emuls=
  38. targ64_extra_libpath=
  39. # Please try to keep this table more or less in alphabetic order - it
  40. # makes it much easier to lookup a specific archictecture.
  41. case "${targ}" in
  42. aarch64_be-*-elf) targ_emul=aarch64elfb
  43. targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b armelfb armelf"
  44. ;;
  45. aarch64-*-elf | aarch64-*-rtems* | aarch64-*-genode*)
  46. targ_emul=aarch64elf
  47. targ_extra_emuls="aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb"
  48. ;;
  49. aarch64-*-cloudabi*) targ_emul=aarch64cloudabi
  50. targ_extra_emuls=aarch64cloudabib
  51. ;;
  52. aarch64-*-freebsd*) targ_emul=aarch64fbsd
  53. targ_extra_emuls="aarch64fbsdb aarch64elf"
  54. ;;
  55. aarch64-*-fuchsia*) targ_emul=aarch64elf
  56. targ_extra_emuls="aarch64elfb armelf armelfb"
  57. ;;
  58. aarch64_be-*-linux-gnu_ilp32)
  59. targ_emul=aarch64linux32b
  60. targ_extra_libpath="aarch64linuxb aarch64linux aarch64linux32 armelfb_linux_eabi armelf_linux_eabi"
  61. targ_extra_emuls="aarch64elfb aarch64elf aarch64elf32 aarch64elf32b armelfb armelf $targ_extra_libpath"
  62. ;;
  63. aarch64-*-linux-gnu_ilp32)
  64. targ_emul=aarch64linux32
  65. targ_extra_libpath="aarch64linux aarch64linuxb aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
  66. targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath"
  67. ;;
  68. aarch64_be-*-linux*) targ_emul=aarch64linuxb
  69. targ_extra_libpath="aarch64linux aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
  70. targ_extra_emuls="aarch64elfb aarch64elf aarch64elf32 aarch64elf32b armelfb armelf $targ_extra_libpath"
  71. ;;
  72. aarch64-*-linux*) targ_emul=aarch64linux
  73. targ_extra_libpath="aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
  74. targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath"
  75. ;;
  76. aarch64-*-haiku*) targ_emul=aarch64haiku
  77. targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb armelf_haiku $targ_extra_libpath"
  78. ;;
  79. alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
  80. targ_emul=elf64alpha_fbsd
  81. targ_extra_emuls="elf64alpha alpha"
  82. tdir_alpha=`echo ${targ_alias} | sed -e 's/freebsd/freebsdecoff/'`
  83. ;;
  84. alpha*-*-linux*ecoff*) targ_emul=alpha
  85. targ_extra_emuls=elf64alpha
  86. tdir_elf64alpha=`echo ${targ_alias} | sed -e 's/ecoff//'`
  87. ;;
  88. alpha*-*-linux-*) targ_emul=elf64alpha
  89. targ_extra_emuls=alpha
  90. tdir_alpha=`echo ${targ_alias} | sed -e 's/linux\(-gnu\)*/linux\1ecoff/'`
  91. ;;
  92. alpha*-*-osf*) targ_emul=alpha
  93. targ_extra_ofiles=
  94. ;;
  95. alpha*-*-gnu*) targ_emul=elf64alpha
  96. ;;
  97. alpha*-*-netbsd*) targ_emul=elf64alpha_nbsd
  98. ;;
  99. alpha*-*-openbsd*) targ_emul=elf64alpha
  100. ;;
  101. alpha*-*-*vms*) targ_emul=alphavms
  102. targ_extra_ofiles=
  103. ;;
  104. am33_2.0-*-linux*) targ_emul=elf32am33lin # mn10300 variant
  105. ;;
  106. arc*-*-elf*) targ_emul=arcelf
  107. targ_extra_emuls="arclinux arclinux_nps arcv2elf arcv2elfx"
  108. ;;
  109. arc*-*-linux*) case "${with_cpu}" in
  110. nps400) targ_emul=arclinux_nps
  111. targ_extra_emuls=arclinux
  112. ;;
  113. *) targ_emul=arclinux
  114. targ_extra_emuls=arclinux_nps
  115. ;;
  116. esac
  117. targ_extra_emuls="${targ_extra_emuls} arcelf arcv2elf arcv2elfx"
  118. ;;
  119. arm*-*-cegcc*) targ_emul=arm_wince_pe
  120. targ_extra_ofiles="deffilep.o pe-dll.o"
  121. LIB_PATH='${tooldir}/lib/w32api'
  122. ;;
  123. arm-wince-pe | arm-*-wince | arm*-*-mingw32ce*)
  124. targ_emul=arm_wince_pe
  125. targ_extra_ofiles="deffilep.o pe-dll.o"
  126. ;;
  127. arm-*-pe) targ_emul=armpe
  128. targ_extra_ofiles="deffilep.o pe-dll.o"
  129. ;;
  130. arm*b-*-freebsd*) targ_emul=armelfb_fbsd
  131. targ_extra_emuls="armelf_fbsd armelf"
  132. ;;
  133. arm*-*-freebsd* | arm-*-kfreebsd*-gnu)
  134. targ_emul=armelf_fbsd
  135. targ_extra_emuls="armelfb_fbsd armelf"
  136. ;;
  137. armeb-*-netbsd*) targ_emul=armelfb_nbsd;
  138. targ_extra_emuls="armelf_nbsd armelf"
  139. ;;
  140. arm-*-netbsd*) targ_emul=armelf_nbsd;
  141. targ_extra_emuls="armelfb_nbsd armelf"
  142. ;;
  143. arm-*-nto*) targ_emul=armnto
  144. ;;
  145. arm-*-phoenix*) targ_emul=armelf
  146. ;;
  147. armeb-*-elf | armeb-*-eabi*)
  148. targ_emul=armelfb
  149. ;;
  150. arm-*-elf | arm*-*-eabi* | arm-*-rtems* | arm-*-genode*)
  151. targ_emul=armelf
  152. ;;
  153. arm-*-kaos*) targ_emul=armelf
  154. ;;
  155. arm9e-*-elf) targ_emul=armelf
  156. ;;
  157. arm*b-*-linux-*eabi*) targ_emul=armelfb_linux_eabi
  158. targ_extra_emuls=armelf_linux_eabi
  159. targ_extra_libpath=$targ_extra_emuls
  160. ;;
  161. arm*b-*-linux-*) targ_emul=armelfb_linux
  162. targ_extra_emuls="armelfb armelf armelf_linux"
  163. targ_extra_libpath="armelf_linux"
  164. ;;
  165. arm*-*-linux-*eabi*) targ_emul=armelf_linux_eabi
  166. targ_extra_emuls="armelfb_linux_eabi"
  167. targ_extra_libpath=$targ_extra_emuls
  168. ;;
  169. arm*-*-uclinuxfdpiceabi)
  170. targ_emul=armelf_linux_eabi
  171. targ_extra_emuls="armelfb_linux_eabi armelf_linux_fdpiceabi armelfb_linux_fdpiceabi"
  172. targ_extra_libpath=$targ_extra_emuls
  173. ;;
  174. arm*-*-linux-*) targ_emul=armelf_linux
  175. targ_extra_emuls="armelf armelfb armelfb_linux"
  176. targ_extra_libpath="armelfb_linux"
  177. ;;
  178. arm*b-*-nacl*) targ_emul=armelfb_nacl
  179. targ_extra_emuls="armelf_nacl"
  180. targ_extra_libpath=$targ_extra_emuls
  181. ;;
  182. arm*-*-nacl*) targ_emul=armelf_nacl
  183. targ_extra_emuls="armelfb_nacl"
  184. targ_extra_libpath=$targ_extra_emuls
  185. ;;
  186. arm*-*-uclinux*eabi*) targ_emul=armelf_linux_eabi
  187. targ_extra_emuls=armelfb_linux_eabi
  188. targ_extra_libpath=$targ_extra_emuls
  189. ;;
  190. arm*-*-uclinux*) targ_emul=armelf_linux
  191. targ_extra_emuls="armelf armelfb armelfb_linux"
  192. targ_extra_libpath="armelfb_linux"
  193. ;;
  194. arm-*-vxworks) targ_emul=armelf_vxworks
  195. ;;
  196. arm*-*-conix*) targ_emul=armelf
  197. ;;
  198. arm*-*-fuchsia*) targ_emul=armelf_fuchsia
  199. targ_extra_emuls="armelfb_fuchsia armelf armelfb"
  200. ;;
  201. arm*-*-haiku*) targ_emul=armelf_haiku
  202. targ_extra_emuls=armelf
  203. ;;
  204. avr-*-*) targ_emul=avr2
  205. targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny"
  206. ;;
  207. bfin-*-elf | bfin-*-rtems*)
  208. targ_emul=elf32bfin
  209. targ_extra_emuls="elf32bfinfd"
  210. targ_extra_libpath=$targ_extra_emuls
  211. ;;
  212. bfin-*-uclinux*) targ_emul=elf32bfin;
  213. targ_extra_emuls="elf32bfinfd"
  214. targ_extra_libpath=$targ_extra_emuls
  215. ;;
  216. bfin-*-linux-uclibc*) targ_emul=elf32bfinfd;
  217. targ_extra_emuls="elf32bfin"
  218. targ_extra_libpath=$targ_extra_emuls
  219. ;;
  220. bpf-*-*) targ_emul=elf64bpf
  221. ;;
  222. cr16-*-elf*) targ_emul=elf32cr16
  223. ;;
  224. cris-*-*aout*) targ_emul=crisaout
  225. targ_extra_emuls="criself crislinux"
  226. targ_extra_libpath=$targ_extra_emuls
  227. ;;
  228. cris-*-linux-* | crisv32-*-linux-*)
  229. targ_emul=crislinux
  230. ;;
  231. cris-*-* | crisv32-*-*) targ_emul=criself
  232. targ_extra_emuls="crisaout crislinux"
  233. targ_extra_libpath=$targ_extra_emuls
  234. ;;
  235. crx-*-elf*) targ_emul=elf32crx
  236. ;;
  237. csky-*-elf*) targ_emul=cskyelf
  238. ;;
  239. csky-*-linux*) targ_emul=cskyelf_linux
  240. ;;
  241. d10v-*-*) targ_emul=d10velf
  242. ;;
  243. d30v-*-*ext*) targ_emul=d30v_e
  244. targ_extra_emuls="d30velf d30v_o"
  245. targ_extra_ofiles=ldelfgen.o
  246. ;;
  247. d30v-*-*onchip*) targ_emul=d30v_o
  248. targ_extra_emuls="d30velf d30v_e"
  249. targ_extra_ofiles=ldelfgen.o
  250. ;;
  251. d30v-*-*) targ_emul=d30velf
  252. targ_extra_emuls="d30v_e d30v_o"
  253. targ_extra_ofiles=ldelfgen.o
  254. ;;
  255. dlx-*-elf*) targ_emul=elf32_dlx
  256. targ_extra_ofiles=ldelfgen.o
  257. ;;
  258. epiphany-*-*) targ_emul=elf32epiphany
  259. targ_extra_emuls="elf32epiphany_4x4"
  260. ;;
  261. fido*-*-elf*) targ_emul=m68kelf
  262. ;;
  263. fr30-*-*) targ_emul=elf32fr30
  264. targ_extra_ofiles=ldelfgen.o
  265. ;;
  266. frv-*-*linux*) targ_emul=elf32frvfd
  267. ;;
  268. frv-*-*) targ_emul=elf32frv
  269. targ_extra_emuls="elf32frvfd"
  270. ;;
  271. ft32-*-*) targ_emul=elf32ft32
  272. targ_extra_ofiles=ldelfgen.o
  273. ;;
  274. h8300-*-elf* | h8300-*-rtems*)
  275. targ_emul=h8300elf;
  276. targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf"
  277. ;;
  278. h8300-*-linux*)
  279. targ_emul=h8300elf_linux;
  280. targ_extra_emuls="h8300helf_linux h8300self_linux h8300sxelf_linux"
  281. ;;
  282. hppa*64*-*-linux-*) targ_emul=hppa64linux
  283. ;;
  284. hppa*64*-hpux*) targ_emul=elf64hppa
  285. ;;
  286. hppa*-*-linux-*) targ_emul=hppalinux
  287. ;;
  288. hppa*-*-*elf*) targ_emul=hppaelf
  289. ;;
  290. hppa*-*-lites*) targ_emul=hppaelf
  291. ;;
  292. hppa*-*-netbsd*) targ_emul=hppanbsd
  293. ;;
  294. hppa*-*-openbsd*) targ_emul=hppaobsd
  295. ;;
  296. i[3-7]86-*-nto-qnx*) targ_emul=i386nto
  297. ;;
  298. i[3-7]86-*-go32) targ_emul=i386go32
  299. targ_extra_ofiles=
  300. ;;
  301. i[3-7]86-*-msdosdjgpp*) targ_emul=i386go32
  302. targ_extra_ofiles=
  303. ;;
  304. i[3-7]86-*-lynxos*) targ_emul=i386lynx
  305. ;;
  306. i[3-7]86-*-aros*) targ_emul=elf_i386
  307. targ_extra_emuls=elf_iamcu
  308. ;;
  309. i[3-7]86-*-rdos*) targ_emul=elf_i386
  310. targ_extra_emuls=elf_iamcu
  311. ;;
  312. i[3-7]86-*-bsd) targ_emul=i386bsd
  313. targ_extra_ofiles=
  314. ;;
  315. i[3-7]86-*-bsd386) targ_emul=i386bsd
  316. targ_extra_ofiles=
  317. ;;
  318. i[3-7]86-*-bsdi*) targ_emul=i386bsd
  319. targ_extra_ofiles=
  320. ;;
  321. i[3-7]86-*-linux-*) targ_emul=elf_i386
  322. targ_extra_emuls="elf_iamcu"
  323. targ64_extra_emuls="elf_x86_64 elf32_x86_64"
  324. targ64_extra_libpath="elf_x86_64 elf32_x86_64"
  325. ;;
  326. i[3-7]86-*-redox*) targ_emul=elf_i386
  327. targ_extra_emuls=elf_x86_64
  328. ;;
  329. i[3-7]86-*-sysv[45]*) targ_emul=elf_i386
  330. targ_extra_emuls=elf_iamcu
  331. ;;
  332. i[3-7]86-*-solaris2*) targ_emul=elf_i386_sol2
  333. targ_extra_emuls="elf_i386_ldso elf_i386 elf_iamcu elf_x86_64_sol2 elf_x86_64"
  334. targ_extra_libpath=$targ_extra_emuls
  335. ;;
  336. i[3-7]86-*-unixware) targ_emul=elf_i386
  337. targ_extra_emuls=elf_iamcu
  338. ;;
  339. i[3-7]86-*-solaris*) targ_emul=elf_i386_ldso
  340. targ_extra_emuls="elf_i386"
  341. targ_extra_libpath=$targ_extra_emuls
  342. ;;
  343. i[3-7]86-*-netbsdpe*) targ_emul=i386pe
  344. targ_extra_ofiles="deffilep.o pe-dll.o"
  345. ;;
  346. i[3-7]86-*-netbsd* | \
  347. i[3-7]86-*-netbsd*-gnu* | \
  348. i[3-7]86-*-knetbsd*-gnu | \
  349. i[3-7]86-*-openbsd*)
  350. targ_emul=elf_i386
  351. targ_extra_emuls="elf_iamcu"
  352. ;;
  353. i[3-7]86-*-elfiamcu) targ_emul=elf_iamcu
  354. targ_extra_emuls=elf_i386
  355. ;;
  356. i[3-7]86-*-elf* | i[3-7]86-*-rtems* | i[3-7]86-*-genode*)
  357. targ_emul=elf_i386
  358. targ_extra_emuls=elf_iamcu
  359. ;;
  360. i[3-7]86-*-dragonfly*) targ_emul=elf_i386
  361. targ_extra_emuls="elf_iamcu i386bsd"
  362. ;;
  363. i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
  364. targ_emul=elf_i386_fbsd
  365. targ_extra_emuls="elf_i386 elf_iamcu i386bsd"
  366. ;;
  367. i[3-7]86-*-gnu*) targ_emul=elf_i386
  368. targ_extra_emuls=elf_iamcu
  369. ;;
  370. i[3-7]86-*-msdos*) targ_emul=i386msdos
  371. targ_extra_emuls=i386aout
  372. targ_extra_ofiles=
  373. ;;
  374. i[3-7]86-*-moss*) targ_emul=i386moss
  375. targ_extra_emuls=i386msdos
  376. ;;
  377. i[3-7]86-*-winnt*) targ_emul=i386pe ;
  378. targ_extra_ofiles="deffilep.o pe-dll.o"
  379. ;;
  380. i[3-7]86-*-pe) targ_emul=i386pe ;
  381. targ_extra_ofiles="deffilep.o pe-dll.o"
  382. ;;
  383. i[3-7]86-*-cygwin*) targ_emul=i386pe ;
  384. targ_extra_ofiles="deffilep.o pe-dll.o" ;
  385. test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api'
  386. ;;
  387. i[3-7]86-*-mingw32*) targ_emul=i386pe ;
  388. targ_extra_ofiles="deffilep.o pe-dll.o"
  389. ;;
  390. i[3-7]86-*-interix*) targ_emul=i386pe_posix;
  391. targ_extra_ofiles="deffilep.o pe-dll.o"
  392. ;;
  393. i[3-7]86-*-beospe*) targ_emul=i386beos
  394. targ_extra_ofiles=
  395. ;;
  396. i[3-7]86-*-beos*) targ_emul=elf_i386_be
  397. ;;
  398. i[3-7]86-*-haiku*) targ_emul=elf_i386_haiku
  399. ;;
  400. i[3-7]86-*-vxworks*) targ_emul=elf_i386_vxworks
  401. ;;
  402. i[3-7]86-*-chaos) targ_emul=elf_i386_chaos
  403. ;;
  404. ia16-*-elf*) targ_emul=elf_i386
  405. targ_extra_emuls=i386msdos
  406. ;;
  407. ia64-*-elf*) targ_emul=elf64_ia64
  408. ;;
  409. ia64-*-freebsd* | ia64-*-kfreebsd*-gnu)
  410. targ_emul=elf64_ia64_fbsd
  411. targ_extra_emuls="elf64_ia64"
  412. ;;
  413. ia64-*-netbsd*) targ_emul=elf64_ia64
  414. ;;
  415. ia64-*-linux*) targ_emul=elf64_ia64
  416. ;;
  417. ia64-*-*vms*) targ_emul=elf64_ia64_vms
  418. targ_extra_ofiles=ldelfgen.o
  419. ;;
  420. ia64-*-aix*) targ_emul=elf64_aix
  421. ;;
  422. ip2k-*-elf) targ_emul=elf32ip2k
  423. ;;
  424. iq2000-*-elf) targ_emul=elf32iq2000
  425. targ_extra_emuls="elf32iq10"
  426. targ_extra_ofiles=ldelfgen.o
  427. ;;
  428. lm32-*-*linux*) targ_emul=elf32lm32fd
  429. ;;
  430. lm32-*-*) targ_emul=elf32lm32
  431. targ_extra_emuls="elf32lm32fd"
  432. ;;
  433. m32c-*-elf)
  434. targ_emul=elf32m32c
  435. ;;
  436. m32r*le-*-elf*) targ_emul=m32rlelf
  437. ;;
  438. m32r*-*-elf*)
  439. targ_emul=m32relf
  440. ;;
  441. m32r*le-*-linux-*) targ_emul=m32rlelf_linux
  442. ;;
  443. m32r*-*-linux-*) targ_emul=m32relf_linux
  444. ;;
  445. m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
  446. targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb"
  447. ;;
  448. m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
  449. targ_extra_emuls="m68hc12elfb m68hc11elf m68hc11elfb"
  450. ;;
  451. m68*-*-netbsd*) targ_emul=m68kelfnbsd
  452. ;;
  453. m68*-*-haiku*) targ_emul=m68kelf
  454. ;;
  455. m68*-*-*) targ_emul=m68kelf
  456. ;;
  457. mcore-*-pe) targ_emul=mcorepe ;
  458. targ_extra_ofiles="deffilep.o pe-dll.o"
  459. ;;
  460. mcore-*-elf) targ_emul=elf32mcore
  461. ;;
  462. mep-*-elf) targ_emul=elf32mep
  463. ;;
  464. metag-*-*) targ_emul=elf32metag
  465. ;;
  466. microblazeel*-linux*) targ_emul="elf32mbel_linux"
  467. targ_extra_emuls="elf32mb_linux"
  468. ;;
  469. microblaze*-linux*) targ_emul="elf32mb_linux"
  470. targ_extra_emuls="elf32mbel_linux"
  471. ;;
  472. microblazeel*) targ_emul=elf32microblazeel
  473. targ_extra_emuls=elf32microblaze
  474. ;;
  475. microblaze*) targ_emul=elf32microblaze
  476. targ_extra_emuls=elf32microblazeel
  477. ;;
  478. mips*-sgi-irix5*) targ_emul=elf32bsmip
  479. ;;
  480. mips*-sgi-irix6*) targ_emul=elf32bmipn32
  481. targ_extra_emuls="elf32bsmip elf64bmip"
  482. targ_extra_libpath=$targ_extra_emuls
  483. ;;
  484. mips*el-*-haiku*) targ_emul=elf_mipsel_haiku
  485. targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
  486. ;;
  487. mips*el-*-netbsd*) targ_emul=elf32ltsmip
  488. targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
  489. ;;
  490. mips*-*-netbsd*) targ_emul=elf32btsmip
  491. targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip"
  492. ;;
  493. mips64el-*-openbsd*) targ_emul=elf64ltsmip
  494. targ_extra_emuls=elf64btsmip
  495. ;;
  496. mips64-*-openbsd*) targ_emul=elf64btsmip
  497. targ_extra_emuls=elf64ltsmip
  498. ;;
  499. mips*vr4300el-*-elf*) targ_emul=elf32l4300
  500. ;;
  501. mips*vr4300-*-elf*) targ_emul=elf32b4300
  502. ;;
  503. mips*vr4100el-*-elf*) targ_emul=elf32l4300
  504. ;;
  505. mips*vr4100-*-elf*) targ_emul=elf32b4300
  506. ;;
  507. mips*vr5000el-*-elf*) targ_emul=elf32l4300
  508. ;;
  509. mips*vr5000-*-elf*) targ_emul=elf32b4300
  510. ;;
  511. mips*el-sde-elf* | mips*el-mti-elf* | mips*el-img-elf*)
  512. targ_emul=elf32ltsmip
  513. targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
  514. ;;
  515. mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
  516. targ_emul=elf32btsmip
  517. targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
  518. ;;
  519. mips64*el-ps2-elf*) targ_emul=elf32lr5900n32
  520. targ_extra_emuls="elf32lr5900"
  521. targ_extra_libpath=$targ_extra_emuls
  522. ;;
  523. mips*el-ps2-elf*) targ_emul=elf32lr5900
  524. targ_extra_emuls="elf32lr5900n32"
  525. targ_extra_libpath=$targ_extra_emuls
  526. ;;
  527. mips*el-*-elf*) targ_emul=elf32elmip
  528. ;;
  529. mips*-*-elf* | mips*-*-rtems*)
  530. targ_emul=elf32ebmip
  531. ;;
  532. mips*el-*-vxworks*) targ_emul=elf32elmipvxworks
  533. targ_extra_emuls="elf32ebmipvxworks"
  534. ;;
  535. mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
  536. targ_extra_emuls="elf32elmipvxworks"
  537. ;;
  538. mips*-*-windiss) targ_emul=elf32mipswindiss
  539. ;;
  540. mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
  541. targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
  542. targ_extra_libpath=$targ_extra_emuls
  543. ;;
  544. mips64*-*-linux-*) targ_emul=elf32btsmipn32
  545. targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
  546. targ_extra_libpath=$targ_extra_emuls
  547. ;;
  548. mips*el-*-linux-*) targ_emul=elf32ltsmip
  549. targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
  550. targ_extra_libpath=$targ_extra_emuls
  551. ;;
  552. mips*-*-linux-*) targ_emul=elf32btsmip
  553. targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
  554. targ_extra_libpath=$targ_extra_emuls
  555. ;;
  556. mips64*el-*-freebsd* | mips64*el-*-kfreebsd*-gnu)
  557. targ_emul=elf32ltsmipn32_fbsd
  558. targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmip_fbsd elf32btsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
  559. targ_extra_libpath=$targ_extra_emuls
  560. ;;
  561. mips64*-*-freebsd* | mips64*-*-kfreebsd*-gnu)
  562. targ_emul=elf32btsmipn32_fbsd
  563. targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmip_fbsd elf32ltsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
  564. targ_extra_libpath=$targ_extra_emuls
  565. ;;
  566. mips*el-*-freebsd* | mips*el-*-kfreebsd*-gnu)
  567. targ_emul=elf32ltsmip_fbsd
  568. targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmipn32_fbsd elf32btsmip_fbsd elf32btsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
  569. targ_extra_libpath=$targ_extra_emuls
  570. ;;
  571. mips*-*-freebsd* | mips*-*-kfreebsd*-gnu)
  572. targ_emul=elf32btsmip_fbsd
  573. targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmipn32_fbsd elf32ltsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd"
  574. targ_extra_libpath=$targ_extra_emuls
  575. ;;
  576. mips*-*-sysv4*) targ_emul=elf32btsmip
  577. ;;
  578. mmix-*-*) targ_emul=mmo
  579. targ_extra_emuls=elf64mmix
  580. ;;
  581. mn10200-*-*) targ_emul=mn10200
  582. targ_extra_ofiles=ldelfgen.o
  583. ;;
  584. mn10300-*-*) targ_emul=mn10300
  585. ;;
  586. moxie-*-moxiebox*) targ_emul=moxiebox
  587. targ_extra_ofiles=ldelfgen.o
  588. ;;
  589. moxie-*-*) targ_emul=elf32moxie
  590. ;;
  591. msp430-*-*) targ_emul=msp430elf
  592. targ_extra_emuls="msp430X"
  593. targ_extra_ofiles=ldelfgen.o
  594. ;;
  595. mt-*elf) targ_emul=elf32mt
  596. targ_extra_ofiles=ldelfgen.o
  597. ;;
  598. nds32*le-*-elf*) targ_emul=nds32elf
  599. targ_extra_emuls="nds32elf16m nds32belf nds32belf16m"
  600. ;;
  601. nds32*be-*-elf*) targ_emul=nds32belf
  602. targ_extra_emuls="nds32elf nds32elf16m nds32belf16m"
  603. ;;
  604. nds32*le-*-linux-gnu*) targ_emul=nds32elf_linux
  605. ;;
  606. nds32*be-*-linux-gnu*) targ_emul=nds32belf_linux
  607. ;;
  608. nios2*-*-linux*) targ_emul=nios2linux
  609. ;;
  610. nios2*-*-*) targ_emul=nios2elf
  611. ;;
  612. ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha
  613. targ_extra_ofiles=
  614. ;;
  615. ns32k-*-*bsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd
  616. targ_extra_ofiles=
  617. ;;
  618. or1k-*-elf | or1knd-*-elf | or1k-*-rtems* | or1knd-*-rtems*)
  619. targ_emul=elf32or1k
  620. ;;
  621. or1k-*-linux* | or1knd-*-linux*) targ_emul=elf32or1k_linux
  622. ;;
  623. pdp11-*-*) targ_emul=pdp11
  624. targ_extra_ofiles=
  625. ;;
  626. pjl*-*-*) targ_emul=pjlelf
  627. targ_extra_emuls="elf_i386 elf_iamcu"
  628. ;;
  629. pj*-*-*) targ_emul=pjelf
  630. targ_extra_ofiles=ldelfgen.o
  631. ;;
  632. powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu)
  633. targ_emul=elf32ppc_fbsd
  634. targ_extra_emuls="elf32ppc elf32ppcsim"
  635. targ_extra_libpath=elf32ppc;
  636. tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'`
  637. ;;
  638. powerpc64-*-freebsd*)
  639. targ_emul=elf64ppc_fbsd
  640. targ_extra_emuls="elf64ppc elf32ppc_fbsd elf32ppc"
  641. targ_extra_libpath="elf32ppc_fbsd elf32ppc"
  642. tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
  643. tdir_elf32ppc_fbsd=$tdir_elf32ppc
  644. ;;
  645. powerpc64le-*-freebsd*)
  646. targ_emul=elf64lppc_fbsd
  647. targ_extra_emuls="elf64lppc"
  648. ;;
  649. powerpc-*-vxworks*)
  650. targ_emul=elf32ppcvxworks
  651. targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
  652. ;;
  653. powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
  654. | powerpc*-*-linux* | powerpc*-*-netbsd* | powerpc*-*-openbsd* \
  655. | powerpc*-*-rtems* \
  656. | powerpc*-*-solaris* | powerpc*-*-kaos* | powerpc*-*-vxworks*)
  657. case "${targ}" in
  658. powerpc64*)
  659. targ_emul=elf64ppc
  660. targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
  661. targ_extra_libpath="elf32ppc elf32ppclinux" ;;
  662. *linux*)
  663. targ_emul=elf32ppclinux
  664. targ_extra_emuls="elf32ppc elf32ppcsim"
  665. targ_extra_libpath=elf32ppc
  666. targ64_extra_emuls=elf64ppc
  667. targ64_extra_libpath=elf64ppc ;;
  668. *)
  669. targ_emul=elf32ppc
  670. targ_extra_emuls="elf32ppclinux elf32ppcsim"
  671. targ_extra_libpath=elf32ppclinux
  672. targ64_extra_emuls=elf64ppc
  673. targ64_extra_libpath=elf64ppc ;;
  674. esac
  675. td=tdir_elf32ppc
  676. td64=tdir_elf64ppc
  677. s=s/ppc/lppc/g
  678. case "${targ}" in
  679. powerpcle-* | powerpc64le-*)
  680. for z in td td64 targ_emul targ_extra_emuls \
  681. targ_extra_libpath targ64_extra_emuls \
  682. targ64_extra_libpath
  683. do
  684. eval ${z}=\"\`echo \$${z} \| sed -e $s\`\"
  685. done
  686. s=s/lppc/ppc/g ;;
  687. esac
  688. # Why oh why did we set tooldir based on target_alias
  689. # rather than on target?
  690. eval tdir_${targ_emul}="${targ_alias}"
  691. cpu=`echo "${targ_alias}" | sed -e 's/-.*//'`
  692. rest=`echo "${targ_alias}" | sed -e 's/^[^-]*//'`
  693. le=le
  694. case "${cpu}" in
  695. *little) le=little
  696. esac
  697. ta32=`echo "${cpu}" | sed -e s/64//`"${rest}"
  698. ta64=`echo "${cpu}" | sed -e 's/64//;s/$/64/;s/'${le}'64$/64'${le}'/;s/be64$/64be/'`"${rest}"
  699. eval test -n \"\$${td}\" || eval ${td}="${ta32}"
  700. eval test -n \"\$${td}linux\" || eval ${td}linux="${ta32}"
  701. eval test -n \"\$${td}sim\" || eval ${td}sim="${ta32}"
  702. eval test -n \"\$${td64}\" || eval ${td64}="${ta64}"
  703. # Now provide the other endian
  704. for z in targ_extra_emuls targ_extra_libpath
  705. do
  706. eval ${z}=\"\$${z} \`echo ${targ_emul} \$${z} \| sed -e $s\`\"
  707. done
  708. for z in targ64_extra_emuls targ64_extra_libpath
  709. do
  710. eval ${z}=\"\$${z} \`echo \$${z} \| sed -e $s\`\"
  711. done
  712. td=`echo "${td}" | sed -e $s`
  713. td64=`echo "${td64}" | sed -e $s`
  714. case "${targ}" in
  715. powerpcle-* | powerpc64le-*)
  716. cpu=`echo "${cpu}" | sed -e s/${le}\$//` ;;
  717. *)
  718. cpu=`echo "${cpu}" | sed -e s/be\$//`${le} ;;
  719. esac
  720. ta32=`echo "${cpu}" | sed -e s/64//`"${rest}"
  721. ta64=`echo "${cpu}" | sed -e 's/64//;s/$/64/;s/'${le}'64$/64'${le}/`"${rest}"
  722. eval test -n \"\$${td}\" || eval ${td}="${ta32}"
  723. eval test -n \"\$${td}linux\" || eval ${td}linux="${ta32}"
  724. eval test -n \"\$${td}sim\" || eval ${td}sim="${ta32}"
  725. eval test -n \"\$${td64}\" || eval ${td64}="${ta64}"
  726. ;;
  727. powerpc-*-nto*) targ_emul=elf32ppcnto
  728. ;;
  729. powerpcle-*-nto*) targ_emul=elf32lppcnto
  730. ;;
  731. powerpc-*-macos*) targ_emul=ppcmacos
  732. targ_extra_ofiles=
  733. ;;
  734. powerpc-*-aix[5-9]*) targ_emul=aix5ppc
  735. targ_extra_ofiles=
  736. ;;
  737. powerpc-*-aix*) targ_emul=aixppc
  738. targ_extra_ofiles=
  739. ;;
  740. powerpc-*-beos*) targ_emul=aixppc
  741. targ_extra_ofiles=
  742. ;;
  743. powerpc-*-haiku*) targ_emul=elf32ppchaiku
  744. ;;
  745. powerpc-*-windiss*) targ_emul=elf32ppcwindiss
  746. ;;
  747. pru*-*-*) targ_emul=pruelf
  748. ;;
  749. riscv32be*-*-linux*) targ_emul=elf32briscv
  750. targ_extra_emuls="elf32briscv_ilp32f elf32briscv_ilp32 elf64briscv elf64briscv_lp64f elf64briscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64"
  751. targ_extra_libpath=$targ_extra_emuls
  752. ;;
  753. riscv32*-*-linux*) targ_emul=elf32lriscv
  754. targ_extra_emuls="elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64 elf32briscv elf32briscv_ilp32f elf32briscv_ilp32 elf64briscv elf64briscv_lp64f elf64briscv_lp64"
  755. targ_extra_libpath=$targ_extra_emuls
  756. ;;
  757. riscvbe-*-* | riscv32be*-*-*)
  758. targ_emul=elf32briscv
  759. targ_extra_emuls="elf64briscv elf32lriscv elf64lriscv"
  760. targ_extra_libpath=$targ_extra_emuls
  761. ;;
  762. riscv-*-* | riscv32*-*-*)
  763. targ_emul=elf32lriscv
  764. targ_extra_emuls="elf64lriscv elf32briscv elf64briscv"
  765. targ_extra_libpath=$targ_extra_emuls
  766. ;;
  767. riscv64be*-*-linux*) targ_emul=elf64briscv
  768. targ_extra_emuls="elf64briscv_lp64f elf64briscv_lp64 elf32briscv elf32briscv_ilp32f elf32briscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32"
  769. targ_extra_libpath=$targ_extra_emuls
  770. ;;
  771. riscv64*-*-linux*) targ_emul=elf64lriscv
  772. targ_extra_emuls="elf64lriscv_lp64f elf64lriscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32 elf64briscv elf64briscv_lp64f elf64briscv_lp64 elf32briscv elf32briscv_ilp32f elf32briscv_ilp32"
  773. targ_extra_libpath=$targ_extra_emuls
  774. ;;
  775. riscv64be*-*-*) targ_emul=elf64briscv
  776. targ_extra_emuls="elf32briscv elf64lriscv elf32lriscv"
  777. targ_extra_libpath=$targ_extra_emuls
  778. ;;
  779. riscv64*-*-*) targ_emul=elf64lriscv
  780. targ_extra_emuls="elf32lriscv elf64briscv elf32briscv"
  781. targ_extra_libpath=$targ_extra_emuls
  782. ;;
  783. rs6000-*-aix[5-9]*) targ_emul=aix5rs6
  784. targ_extra_ofiles=
  785. ;;
  786. rs6000-*-aix*) targ_emul=aixrs6
  787. targ_extra_ofiles=
  788. ;;
  789. rl78-*-*) targ_emul=elf32rl78
  790. ;;
  791. rx-*-linux*) targ_emul=elf32rx_linux
  792. ;;
  793. rx-*-*) targ_emul=elf32rx
  794. ;;
  795. s12z-*-*) targ_emul=m9s12zelf
  796. targ_extra_ofiles=ldelfgen.o
  797. ;;
  798. s390x-*-linux*) targ_emul=elf64_s390
  799. targ_extra_emuls=elf_s390
  800. targ_extra_libpath=$targ_extra_emuls
  801. tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'`
  802. ;;
  803. s390x-*-tpf*) targ_emul=elf64_s390
  804. tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'`
  805. ;;
  806. s390-*-linux*) targ_emul=elf_s390
  807. targ64_extra_emuls=elf64_s390
  808. targ64_extra_libpath=elf64_s390
  809. tdir_elf64_s390=`echo ${targ_alias} | sed -e 's/s390/s390x/'`
  810. ;;
  811. score-*-elf) targ_emul=score7_elf
  812. targ_extra_emuls=score3_elf
  813. ;;
  814. sh-*-linux*) targ_emul=shlelf_linux
  815. targ_extra_emuls="shelf_linux shlelf_fd shelf_fd"
  816. targ_extra_libpath=shelf_linux
  817. ;;
  818. sh*eb-*-linux*) targ_emul=shelf_linux
  819. targ_extra_emuls="shelf_fd"
  820. ;;
  821. sh*-*-linux*) targ_emul=shlelf_linux
  822. targ_extra_emuls="shlelf_fd"
  823. ;;
  824. sh*l*-*-netbsdaout*) targ_emul=shl
  825. targ_extra_emuls=sh
  826. ;;
  827. sh*-*-netbsdaout*) targ_emul=sh
  828. targ_extra_emuls=shl
  829. ;;
  830. sh*l*-*-netbsd*) targ_emul=shlelf_nbsd
  831. targ_extra_emuls=shelf_nbsd
  832. ;;
  833. sh*-*-netbsd*) targ_emul=shelf_nbsd
  834. targ_extra_emuls=shlelf_nbsd
  835. ;;
  836. shle*-*-elf* | sh[1234]*le*-*-elf | shle*-*-kaos*)
  837. targ_emul=shlelf
  838. targ_extra_emuls="shelf shl sh"
  839. ;;
  840. sh-*-elf* | sh[1234]*-*-elf | sh-*-rtems* | sh-*-kaos*)
  841. targ_emul=shelf
  842. targ_extra_emuls="shlelf sh shl"
  843. ;;
  844. sh-*-uclinux* | sh[12]-*-uclinux*)
  845. targ_emul=shelf_uclinux
  846. targ_extra_emuls="shelf shlelf sh shl shelf_fd shlelf_fd"
  847. ;;
  848. sh-*-vxworks) targ_emul=shelf_vxworks
  849. targ_extra_emuls=shlelf_vxworks
  850. ;;
  851. sh-*-nto*) targ_emul=shelf_nto
  852. targ_extra_emuls=shlelf_nto
  853. ;;
  854. sh-*-pe) targ_emul=shpe ;
  855. targ_extra_ofiles="deffilep.o pe-dll.o"
  856. ;;
  857. sh-*-*) targ_emul=sh;
  858. targ_extra_emuls=shl
  859. targ_extra_ofiles=
  860. ;;
  861. sparc64-*-freebsd* | sparcv9-*-freebsd* | sparc64-*-kfreebsd*-gnu | sparcv9-*-kfreebsd*-gnu)
  862. targ_emul=elf64_sparc_fbsd
  863. targ_extra_emuls="elf64_sparc elf32_sparc"
  864. targ_extra_libpath=$targ_extra_emuls
  865. tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
  866. ;;
  867. sparc64-*-linux-*) targ_emul=elf64_sparc
  868. targ_extra_emuls="elf32_sparc"
  869. targ_extra_libpath=elf32_sparc
  870. tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
  871. ;;
  872. sparc64-*-*bsd*) targ_emul=elf64_sparc
  873. targ_extra_emuls="elf32_sparc"
  874. ;;
  875. sparc64-*-solaris2* | sparcv9-*-solaris2*)
  876. targ_emul=elf64_sparc_sol2
  877. targ_extra_emuls="elf64_sparc elf32_sparc_sol2 elf32_sparc"
  878. targ_extra_libpath=$targ_extra_emuls
  879. tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
  880. ;;
  881. sparc64-*-haiku*) targ_emul=elf64_sparc
  882. ;;
  883. sparc64-*-*) targ_emul=elf64_sparc
  884. ;;
  885. sparc*-*-linux-*) targ_emul=elf32_sparc
  886. targ_extra_emuls="elf64_sparc"
  887. targ_extra_libpath=elf64_sparc
  888. tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
  889. ;;
  890. sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
  891. targ_emul=elf32_sparc_sol2
  892. targ_extra_emuls=elf32_sparc
  893. ;;
  894. sparc-*-solaris2*) targ_emul=elf32_sparc_sol2
  895. targ_extra_emuls="elf32_sparc elf64_sparc_sol2 elf64_sparc"
  896. targ_extra_libpath=$targ_extra_emuls
  897. tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
  898. ;;
  899. sparc*-*-vxworks*) targ_emul=elf32_sparc_vxworks
  900. ;;
  901. sparc*-*-*) targ_emul=elf32_sparc
  902. ;;
  903. spu-*-elf*) targ_emul=elf32_spu
  904. ;;
  905. tic30-*-*coff*) targ_emul=tic30coff
  906. targ_extra_ofiles=
  907. ;;
  908. tic4x-*-* | c4x-*-*) targ_emul=tic4xcoff
  909. targ_extra_emuls="tic3xcoff tic3xcoff_onchip"
  910. targ_extra_ofiles=
  911. ;;
  912. tic54x-*-* | c54x*-*-*) targ_emul=tic54xcoff
  913. targ_extra_ofiles=
  914. ;;
  915. tic6x-*-elf) targ_emul=elf32_tic6x_elf_le
  916. targ_extra_emuls="elf32_tic6x_elf_be elf32_tic6x_le elf32_tic6x_be"
  917. targ_extra_libpath=$targ_extra_emuls
  918. ;;
  919. tic6x-*-uclinux) targ_emul=elf32_tic6x_linux_le
  920. targ_extra_emuls="elf32_tic6x_linux_be elf32_tic6x_le elf32_tic6x_be"
  921. targ_extra_libpath=$targ_extra_emuls
  922. ;;
  923. tilegx-*-*) targ_emul=elf64tilegx
  924. targ_extra_emuls="elf64tilegx_be elf32tilegx elf32tilegx_be"
  925. targ_extra_libpath=$targ_extra_emuls
  926. ;;
  927. tilegxbe-*-*) targ_emul=elf64tilegx_be
  928. targ_extra_emuls="elf64tilegx elf32tilegx elf32tilegx_be"
  929. targ_extra_libpath=$targ_extra_emuls
  930. ;;
  931. tilepro-*-*) targ_emul=elf32tilepro
  932. ;;
  933. v850*-*-*) targ_emul=v850_rh850
  934. targ_extra_emuls=v850
  935. ;;
  936. vax-*-netbsdaout*) targ_emul=vaxnbsd
  937. targ_extra_emuls=elf32vax
  938. ;;
  939. vax-*-netbsd*) targ_emul=elf32vax
  940. targ_extra_emuls=vaxnbsd
  941. ;;
  942. vax-*-linux-*) targ_emul=elf32vax
  943. ;;
  944. visium-*-elf) targ_emul=elf32visium
  945. ;;
  946. x86_64-*-rdos*) targ_emul=elf64rdos
  947. ;;
  948. x86_64-*-cloudabi*) targ_emul=elf_x86_64_cloudabi
  949. ;;
  950. x86_64-*-haiku*) targ_emul=elf_x86_64_haiku
  951. targ_extra_emuls="elf_x86_64 elf_i386_haiku"
  952. ;;
  953. x86_64-*-linux-gnux32) targ_emul=elf32_x86_64
  954. targ_extra_emuls="elf_x86_64 elf_i386 elf_iamcu"
  955. targ_extra_libpath="elf_i386 elf_iamcu elf_x86_64"
  956. tdir_elf_iamcu=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
  957. tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
  958. ;;
  959. x86_64-*-linux-*) targ_emul=elf_x86_64
  960. targ_extra_emuls="elf32_x86_64 elf_i386 elf_iamcu"
  961. targ_extra_libpath="elf_i386 elf32_x86_64"
  962. tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
  963. ;;
  964. x86_64-*-redox*) targ_emul=elf_x86_64
  965. targ_extra_emuls=elf_i386
  966. ;;
  967. x86_64-*-solaris2*) targ_emul=elf_x86_64_sol2
  968. targ_extra_emuls="elf_x86_64 elf_i386_sol2 elf_i386_ldso elf_i386 elf_iamcu"
  969. targ_extra_libpath=$targ_extra_emuls
  970. tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
  971. ;;
  972. x86_64-*-netbsd* | x86_64-*-openbsd*)
  973. targ_emul=elf_x86_64
  974. targ_extra_emuls="elf_i386 elf_iamcu"
  975. tdir_elf_iamcu=`echo ${targ_alias} | \
  976. sed -e 's/x86_64/i386/' -e 's/aout//'`
  977. tdir_elf_i386=`echo ${targ_alias} | \
  978. sed -e 's/x86_64/i386/' -e 's/aout//'`
  979. ;;
  980. x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia* | x86_64-*-genode*)
  981. targ_emul=elf_x86_64
  982. targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64"
  983. targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64"
  984. tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
  985. ;;
  986. x86_64-*-dragonfly*) targ_emul=elf_x86_64
  987. targ_extra_emuls="elf_i386 elf_iamcu"
  988. ;;
  989. x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
  990. targ_emul=elf_x86_64_fbsd
  991. targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386 elf_iamcu"
  992. targ_extra_libpath="elf_i386_fbsd"
  993. tdir_elf_i386_fbsd=`echo ${targ_alias} \
  994. | sed -e 's/x86_64/i386/'`
  995. tdir_elf_iamcu=`echo ${targ_alias} \
  996. | sed -e 's/x86_64/i386/'`
  997. tdir_elf_i386=`echo ${targ_alias} \
  998. | sed -e 's/x86_64/i386/'`
  999. ;;
  1000. x86_64-*-pe | x86_64-*-pep) targ_emul=i386pep ;
  1001. targ_extra_emuls=i386pe ;
  1002. targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o"
  1003. ;;
  1004. x86_64-*-cygwin) targ_emul=i386pep ;
  1005. targ_extra_emuls=i386pe
  1006. targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o"
  1007. test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api'
  1008. ;;
  1009. x86_64-*-mingw*) targ_emul=i386pep ;
  1010. targ_extra_emuls=i386pe
  1011. targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o"
  1012. ;;
  1013. xc16x-*-elf) targ_emul=elf32xc16x
  1014. targ_extra_emuls="elf32xc16xl elf32xc16xs"
  1015. ;;
  1016. xgate-*-*) targ_emul=xgateelf
  1017. targ_extra_ofiles=ldelfgen.o
  1018. ;;
  1019. xstormy16-*-*) targ_emul=elf32xstormy16
  1020. ;;
  1021. xtensa*-*-*) targ_emul=elf32xtensa
  1022. ;;
  1023. z80-*-elf*) targ_emul=elf32z80
  1024. targ_extra_ofiles="ldelf.o ldelfgen.o"
  1025. ;;
  1026. z80-*-coff) targ_emul=z80
  1027. targ_extra_ofiles=
  1028. ;;
  1029. z8k-*-coff) targ_emul=z8002
  1030. targ_extra_emuls=z8001
  1031. targ_extra_ofiles=
  1032. ;;
  1033. loongarch32-*) targ_emul=elf32loongarch
  1034. ;;
  1035. loongarch64-*) targ_emul=elf64loongarch
  1036. ;;
  1037. *-*-ieee*) targ_emul=vanilla
  1038. targ_extra_ofiles=
  1039. ;;
  1040. *)
  1041. echo 2>&1 "*** ld does not support target ${targ}"
  1042. echo 2>&1 "*** see ld/configure.tgt for supported targets"
  1043. exit 1
  1044. esac
  1045. NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
  1046. case "${target}" in
  1047. *-*-dragonfly*)
  1048. NATIVE_LIB_DIRS='/lib /usr/lib /usr/pkg/lib /usr/local/lib'
  1049. ;;
  1050. *-*-freebsd*)
  1051. NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
  1052. ;;
  1053. hppa*64*-*-hpux11*)
  1054. NATIVE_LIB_DIRS=/usr/lib/pa20_64
  1055. ;;
  1056. i[3-7]86-*-sysv4*)
  1057. NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
  1058. ;;
  1059. i[3-7]86-*-solaris*)
  1060. NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
  1061. ;;
  1062. i[3-7]86-pc-interix*)
  1063. NATIVE_LIB_DIRS='/usr/local/lib $$INTERIX_ROOT/usr/lib /lib /usr/lib'
  1064. ;;
  1065. ia64-*-aix*)
  1066. NATIVE_LIB_DIRS='/usr/local/lib /usr/lib/ia64l64 /lib /usr/lib'
  1067. ;;
  1068. sparc*-*-solaris2*)
  1069. NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
  1070. ;;
  1071. spu-*-elf*)
  1072. # This allows one to build a pair of PPU/SPU toolchains with common sysroot.
  1073. NATIVE_LIB_DIRS='/lib'
  1074. ;;
  1075. i[03-9x]86-*-cygwin* | x86_64-*-cygwin*)
  1076. NATIVE_LIB_DIRS='/usr/lib /usr/lib/w32api'
  1077. ;;
  1078. *-*-linux*)
  1079. ;;
  1080. *-*-netbsd*)
  1081. ;;
  1082. alpha*-*-*)
  1083. NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
  1084. ;;
  1085. esac
  1086. case "${target}" in
  1087. frv-*-* | hppa*-*-* | ia64-*-* | mips*-*-*)
  1088. # Don't enable -z relro by default since many relro tests fail on these
  1089. # targets:
  1090. # FAIL: strip -z relro (relro1)
  1091. # FAIL: strip -z relro -shared (relro1)
  1092. # FAIL: objcopy -z relro (relro1)
  1093. # FAIL: objcopy -z relro -shared (relro1)
  1094. # FAIL: objcopy -z relro (tdata1)
  1095. # FAIL: objcopy -shared -z relro (tdata1)
  1096. # FAIL: objcopy -z relro (tdata2)
  1097. # FAIL: objcopy -shared -z relro (tdata2)
  1098. # FAIL: objcopy -z relro (tdata3)
  1099. # FAIL: objcopy -shared -z relro (tdata3)
  1100. # FAIL: objcopy -shared -z relro (tbss1)
  1101. # FAIL: objcopy -shared -z relro (tbss2)
  1102. # FAIL: objcopy -shared -z relro (tbss3)
  1103. ;;
  1104. *-*-linux*)
  1105. if test ${ac_default_ld_z_relro} = unset; then
  1106. ac_default_ld_z_relro=1
  1107. fi
  1108. ;;
  1109. esac
  1110. # Enable -z separate-code and --warn-textrel by default for Linux/x86.
  1111. case "${target}" in
  1112. i[3-7]86-*-linux-* | x86_64-*-linux-*)
  1113. if test ${ac_default_ld_z_separate_code} = unset; then
  1114. ac_default_ld_z_separate_code=1
  1115. fi
  1116. if test ${ac_default_ld_textrel_check} = unset; then
  1117. ac_default_ld_textrel_check=yes
  1118. fi
  1119. ;;
  1120. esac