more solaris config tidies

This patch is primarily about making ld and bfd config match for
solaris targets.  In commit 3677b72961 I made the bfd config match
the ld config, which resulted in PR 27666.  This goes the other way,
changing the ld config to match bfd.  The current mismatch results in
failures like:
..ld-new: target elf32-i386 not found
FAIL: Build libgot-1-i386.so
The problem is that even though the elf32-i386 target is compiled in
to bfd, it is excluded from the list of targets supported by bfd.
ld -V says it is there, but can't use it..

Secondarily, remove "want64" from the 32-bit x86 and sparc solaris
targets in config.bfd, and arrange for ld/configure.tgt to match that
by using targ64_extra_emuls.  This means that on a 32-bit host you
won't get the 64-bit solaris target support by default.  Setting
"want64" forces use of 64-bit bfd_vma on such hosts, which usually
isn't needed for a 32-bit target, and when "want64" is true it is a
little odd to see targ64_selvecs used.  Also, some nonsense has crept
in to ld/configure.tgt regarding targ_extra_libpath.  Any target
mentioned in targ_extra_libpath does not need to be mentioned in
targ_extra_emuls.  So tidy that for solaris.

Finally, matching of solaris targets has been simplified.  This does
not change target triple matching, except with --enable-obsolete.
Without --enable-obsolete, you will still need to specify solaris2.10
or solaris2.11 as the operating system part of the target triple, and
this is expected to become permanent after the next binutils release.

	PR 27666
bfd/
	* config.bfd: Simplify solaris target matching.  Remove
	"want64" from x86 and 32-bit sparc solaris targets.
ld/
	* configure.tgt: Remove non-solaris targets from the x86 and
	32-bit sparc solaris targets, and use targ64 variables to add
	conditional 64-bit targets.  Don't unnecessarily add targets
	to targ_extra_emuls that appear in targ_extra_libpatch.
	Simplify solaris target matching.
This commit is contained in:
Alan Modra
2025-12-20 14:14:47 +10:30
parent f4e835a40c
commit 17883a4c42
2 changed files with 12 additions and 23 deletions

View File

@@ -594,11 +594,10 @@ case "${targ}" in
targ_defvec=i386_elf32_vec
targ_selvecs="iamcu_elf32_vec i386_coff_vec"
;;
i[3-7]86-*-solaris2.1[01]*)
i[3-7]86-*-solaris2*)
# PR 27666: Do not include i386_elf32_vec or x86_64_elf64_vec.
targ_defvec=i386_elf32_sol2_vec
targ64_selvecs=x86_64_elf64_sol2_vec
want64=true
;;
i[3-7]86-*-solaris*)
# PR 27666: Do not include i386_elf32_vec here.
@@ -726,7 +725,7 @@ case "${targ}" in
targ_selvecs=i386_elf32_vec
want64=true
;;
x86_64-*-solaris2.1[01]*)
x86_64-*-solaris2*)
# PR 27666: Do not include i386_elf32_vec or x86_64_elf64_vec.
targ_defvec=x86_64_elf64_sol2_vec
targ_selvecs=i386_elf32_sol2_vec
@@ -1335,15 +1334,13 @@ case "${targ}" in
targ_selvecs="sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec"
targ_underscore=yes
;;
sparc-*-solaris2.[7-9]* | sparc-*-solaris2.1[01]*)
sparc-*-solaris2*)
# PR 27666: Do not include sparc_elf32_vec or sparc_elf64_vec here.
targ_defvec=sparc_elf32_sol2_vec
targ64_selvecs=sparc_elf64_sol2_vec
want64=true
;;
#ifdef BFD64
sparcv9-*-solaris2.[7-9]* | sparcv9-*-solaris2.1[01]* | \
sparc64-*-solaris2.[7-9]* | sparc64-*-solaris2.1[01]*)
sparcv9-*-solaris2* | sparc64-*-solaris2*)
# PR 27666: Do not include sparc_elf32_vec or sparc_elf64_vec here.
targ_defvec=sparc_elf64_sol2_vec
targ_selvecs=sparc_elf32_sol2_vec

View File

@@ -373,15 +373,12 @@ i[3-7]86-*-linux-*) targ_emul=elf_i386
i[3-7]86-*-redox*) targ_emul=elf_i386
targ_extra_emuls=elf_x86_64
;;
i[3-7]86-*-solaris2.1[01]*)
i[3-7]86-*-solaris2*)
targ_emul=elf_i386_sol2
targ_extra_emuls="elf_x86_64_sol2 elf_i386 elf_x86_64"
targ_extra_libpath=$targ_extra_emuls
targ64_extra_libpath=elf_x86_64_sol2
;;
i[3-7]86-*-solaris*)
targ_emul=elf_i386_sol2
targ_extra_emuls=elf_i386
targ_extra_libpath=$targ_extra_emuls
;;
i[3-7]86-*-netbsd* | \
i[3-7]86-*-netbsd*-gnu* | \
@@ -918,11 +915,9 @@ sparc64-*-linux-*) targ_emul=elf64_sparc
sparc64-*-*bsd*) targ_emul=elf64_sparc
targ_extra_emuls="elf32_sparc"
;;
sparc64-*-solaris2.[7-9]* | sparc64-*-solaris2.1[01]* | \
sparcv9-*-solaris2.[7-9]* | sparcv9-*-solaris2.1[01]*)
sparc64-*-solaris2* | sparcv9-*-solaris2*)
targ_emul=elf64_sparc_sol2
targ_extra_emuls="elf32_sparc_sol2 elf64_sparc elf32_sparc"
targ_extra_libpath=$targ_extra_emuls
targ_extra_libpath=elf32_sparc_sol2
;;
sparc64-*-haiku*) targ_emul=elf64_sparc
;;
@@ -933,14 +928,12 @@ sparc*-*-linux-*) targ_emul=elf32_sparc
targ_extra_libpath=elf64_sparc
tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
;;
sparc-*-solaris2.[7-9]* | sparc-*-solaris2.1[01]*)
sparc-*-solaris2*)
targ_emul=elf32_sparc_sol2
targ_extra_emuls="elf64_sparc_sol2 elf32_sparc elf64_sparc"
targ_extra_libpath=$targ_extra_emuls
targ64_extra_libpath=elf64_sparc_sol2
;;
sparc*-*-solaris*)
targ_emul=elf32_sparc_sol2
targ_extra_emuls=elf32_sparc
;;
sparc*-*-vxworks*) targ_emul=elf32_sparc_vxworks
;;
@@ -1008,10 +1001,9 @@ x86_64-*-linux-*) targ_emul=elf_x86_64
x86_64-*-redox*) targ_emul=elf_x86_64
targ_extra_emuls=elf_i386
;;
x86_64-*-solaris2.1[01]*)
x86_64-*-solaris2*)
targ_emul=elf_x86_64_sol2
targ_extra_emuls="elf_i386_sol2 elf_x86_64 elf_i386"
targ_extra_libpath=$targ_extra_emuls
targ_extra_libpath=elf_i386_sol2
;;
x86_64-*-netbsd* | x86_64-*-openbsd*)
targ_emul=elf_x86_64