--- ld/configure.tgt.orig 2021-12-07 23:59:58.133149000 +1000 +++ ld/configure.tgt 2021-12-08 22:31:05.236786000 +1000 @@ -52,6 +52,8 @@ targ_extra_emuls="aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb" ;; aarch64-*-cloudabi*) targ_emul=aarch64cloudabi targ_extra_emuls=aarch64cloudabib ;; +aarch64-*-bsdsunix*) targ_emul=aarch64bsdsux + targ_extra_emuls="aarch64bsdsuxb aarch64elf" ;; aarch64-*-freebsd*) targ_emul=aarch64fbsd targ_extra_emuls="aarch64fbsdb aarch64elf" ;; aarch64-*-fuchsia*) targ_emul=aarch64elf @@ -70,6 +72,10 @@ aarch64-*-linux*) targ_emul=aarch64linux targ_extra_libpath="aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi" targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath" ;; +alpha*-*-bsdsunix*) + targ_emul=elf64alpha_bsdsux + targ_extra_emuls="elf64alpha alpha" + tdir_alpha=`echo ${targ_alias} | sed -e 's/bsdsunix/bsdsunixecoff/'` ;; alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) targ_emul=elf64alpha_fbsd targ_extra_emuls="elf64alpha alpha" @@ -102,6 +108,11 @@ arm-wince-pe | arm-*-wince | arm*-*-mingw32ce*) targ_emul=arm_wince_pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; arm-*-pe) targ_emul=armpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; +arm*b-*-bsdsunix*) targ_emul=armelfb_bsdsux + targ_extra_emuls="armelf_bsdsux armelf" ;; +arm*-*-bsdsunix*) + targ_emul=armelf_bsdsux + targ_extra_emuls="armelfb_bsdsux armelf" ;; arm*b-*-freebsd*) targ_emul=armelfb_fbsd targ_extra_emuls="armelf_fbsd armelf" ;; arm*-*-freebsd* | arm-*-kfreebsd*-gnu) @@ -320,6 +331,19 @@ targ_extra_emuls="elf_iamcu i386bsd" ;; x86_64-*-dragonfly*) targ_emul=elf_x86_64 targ_extra_emuls="elf_i386 elf_iamcu elf_l1om elf_k1om" ;; +i[3-7]86-*-bsdsunix*) + targ_emul=elf_i386_bsdsux + targ_extra_emuls="elf_i386 elf_iamcu i386bsd" ;; +x86_64-*-bsdsunix*) + targ_emul=elf_x86_64_bsdsux + targ_extra_emuls="elf_i386_bsdsux elf_x86_64 elf_i386 elf_iamcu elf_l1om elf_l1om_bsdsux elf_k1om elf_k1om_bsdsux" + targ_extra_libpath="elf_i386_bsdsux" + tdir_elf_i386_fbsd=`echo ${targ_alias} \ + | sed -e 's/x86_64/i386/'` + tdir_elf_iamcu=`echo ${targ_alias} \ + | sed -e 's/x86_64/i386/'` + tdir_elf_i386=`echo ${targ_alias} \ + | sed -e 's/x86_64/i386/'` ;; i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu) targ_emul=elf_i386_fbsd targ_extra_emuls="elf_i386 elf_iamcu i386bsd" ;; @@ -376,6 +400,9 @@ ;; ia16-*-elf*) targ_emul=elf_i386 targ_extra_emuls=i386msdos ;; ia64-*-elf*) targ_emul=elf64_ia64 ;; +ia64-*-bsdsunix*) + targ_emul=elf64_ia64_bsdsux + targ_extra_emuls="elf64_ia64" ;; ia64-*-freebsd* | ia64-*-kfreebsd*-gnu) targ_emul=elf64_ia64_fbsd targ_extra_emuls="elf64_ia64" ;; @@ -480,6 +507,22 @@ mips*-*-linux-*) targ_emul=elf32btsmip targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" targ_extra_libpath=$targ_extra_emuls ;; +mips64*el-*-bsdsunix*) + targ_emul=elf64ltsmip_bsdsux + targ_extra_emuls="elf32ltsmip_bsdsux elf32btsmip_bsdsux elf32ltsmipn32_bsdsux elf32btsmipn32_bsdsux elf64ltsmip_bsdsux elf64btsmip_bsdsux elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip" + targ_extra_libpath=$targ_extra_emuls ;; +mips64*-*-bsdsunix*) + targ_emul=elf64btsmip_bsdsux + targ_extra_emuls="elf32btsmip_bsdsux elf32ltsmip_bsdsux elf32btsmipn32_bsdsux elf32ltsmipn32_bsdsux elf64btsmip_bsdsux elf64ltsmip_bsdsux elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip" + targ_extra_libpath=$targ_extra_emuls ;; +mips*el-*-bsdsunix*) + targ_emul=elf32ltsmip_bsdsux + targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmipn32_bsdsux elf32btsmip_bsdsux elf32btsmipn32_bsdsux elf64ltsmip_bsdsux elf64btsmip_bsdsux" + targ_extra_libpath=$targ_extra_emuls ;; +mips*-*-bsdsunix*) + targ_emul=elf32btsmip_bsdsux + targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_bsdsux elf32btsmipn32_bsdsux elf32ltsmipn32_bsdsux elf64ltsmip_bsdsux elf64btsmip_bsdsux" + targ_extra_libpath=$targ_extra_emuls ;; mips64*el-*-freebsd* | mips64*el-*-kfreebsd*-gnu) targ_emul=elf64ltsmip_fbsd targ_extra_emuls="elf32ltsmip_fbsd elf32btsmip_fbsd elf32ltsmipn32_fbsd elf32btsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip" @@ -532,6 +575,22 @@ targ_extra_emuls="elf_i386 elf_iamcu" ;; pj*-*-*) targ_emul=pjelf ;; +powerpc-*-bsdsunix*) + targ_emul=elf32ppc_bsdsux + targ_extra_emuls="elf32ppc elf32ppcsim" + targ_extra_libpath=elf32ppc; + tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'` ;; +powerpc64-*-bsdsunix*) + targ_emul=elf64ppc_bsdsux + targ_extra_emuls="elf64ppc elf32ppc_bsdsux elf32ppc" + targ_extra_libpath="elf32ppc_bsdsux elf32ppc" + tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'` + tdir_elf32ppc_bsdsux=$tdir_elf32ppc + ;; +powerpc64le-*-bsdsunix*) + targ_emul=elf64lppc_bsdsux + targ_extra_emuls="elf64ppc" + ;; powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu) targ_emul=elf32ppc_fbsd targ_extra_emuls="elf32ppc elf32ppcsim" @@ -655,6 +714,14 @@ ;; rl78-*-*) targ_emul=elf32rl78 ;; rx-*-*) targ_emul=elf32rx ;; +s390x-*-bsdsunix*) targ_emul=elf64_s390 + targ_extra_emuls=elf_s390 + targ_extra_libpath=$targ_extra_emuls + tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'` ;; +s390x-*-freebsd*) targ_emul=elf64_s390 + targ_extra_emuls=elf_s390 + targ_extra_libpath=$targ_extra_emuls + tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'` ;; s390x-*-linux*) targ_emul=elf64_s390 targ_extra_emuls=elf_s390 targ_extra_libpath=$targ_extra_emuls @@ -695,6 +762,11 @@ sh-*-pe) targ_emul=shpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; sh-*-*) targ_emul=sh; targ_extra_emuls=shl ;; +sparc64-*-bsdsunix* | sparcv9-*-bsdsunix*) + targ_emul=elf64_sparc_bsdsux + targ_extra_emuls="elf64_sparc elf32_sparc" + targ_extra_libpath=$targ_extra_emuls + tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` ;; sparc64-*-freebsd* | sparcv9-*-freebsd* | sparc64-*-kfreebsd*-gnu | sparcv9-*-kfreebsd*-gnu) targ_emul=elf64_sparc_fbsd targ_extra_emuls="elf64_sparc elf32_sparc" @@ -788,6 +860,10 @@ *-*-dragonfly*) NATIVE_LIB_DIRS='/lib /usr/lib /usr/pkg/lib /usr/local/lib' + ;; + +*-*-bsdsunix*) + NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib' ;; *-*-freebsd*)