[binutils-gdb] more solaris config tidies

Alan Modra amodra@sourceware.org
Sat Dec 20 04:53:47 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=17883a4c42c6a210e758836040e3bca5ea55fcff

commit 17883a4c42c6a210e758836040e3bca5ea55fcff
Author: Alan Modra <amodra@gmail.com>
Date:   Sat Dec 20 14:14:47 2025 +1030

    more solaris config tidies
    
    This patch is primarily about making ld and bfd config match for
    solaris targets.  In commit 3677b7296185 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.

Diff:
---
 bfd/config.bfd   | 11 ++++-------
 ld/configure.tgt | 24 ++++++++----------------
 2 files changed, 12 insertions(+), 23 deletions(-)

diff --git a/bfd/config.bfd b/bfd/config.bfd
index b180382d7f4..6648810f7fe 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -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
diff --git a/ld/configure.tgt b/ld/configure.tgt
index abc94f8df39..8efe659e5a0 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -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


More information about the Binutils-cvs mailing list