[binutils-gdb] x86: drop iamcu as default secondary target

Jan Beulich via Binutils-cvs <[email protected]>
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=715b203a36c8be5139d8c2105b05b1974ef5fc8e

commit 715b203a36c8be5139d8c2105b05b1974ef5fc8e
Author: Jan Beulich <[email protected]>
Date:   Fri Mar 20 14:08:12 2026 +0100

    x86: drop iamcu as default secondary target
    
    It's not clear why this would have been forced onto about everyone
    x86-ish. People wanting this as secondary target can specify it via the
    --enable-targets= configure option.
    
    Obviously a few tests cannot be run then anymore by default, but only when
    IAMCU is actually the/a configured target.
    
    While there also consolidate bfd/config.bfd entries doing identical
    selections.

Diff:
---
 bfd/config.bfd                  | 106 ++++++++++------------------------------
 gas/testsuite/gas/i386/i386.exp |   2 +-
 ld/configure.tgt                |  29 +++--------
 ld/testsuite/ld-i386/i386.exp   |   5 +-
 4 files changed, 39 insertions(+), 103 deletions(-)

diff --git a/bfd/config.bfd b/bfd/config.bfd
index 7cb267a3623..3e57676327c 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -573,9 +573,14 @@ case "${targ}" in
     targ_selvecs=hppa_elf32_vec
     ;;
 
-  i[3-7]86-*-elf* | i[3-7]86-*-rtems* | i[3-7]86-*-genode*)
+  i[3-7]86-*-elfiamcu*)
+    targ_defvec=iamcu_elf32_vec
+    targ_selvecs="i386_elf32_vec i386_coff_vec"
+    targ_archs="$targ_archs bfd_iamcu_arch"
+    ;;
+  i[3-7]86-*-elf* | i[3-7]86-*-genode* | i[3-7]86-*-nto* | i[3-7]86-*-rtems* | i[3-7]86-*-rdos*)
     targ_defvec=i386_elf32_vec
-    targ_selvecs="iamcu_elf32_vec i386_coff_vec"
+    targ_selvecs="i386_coff_vec"
     ;;
   i[3-7]86-*-solaris2*)
     targ_defvec=i386_elf32_sol2_vec
@@ -588,17 +593,8 @@ case "${targ}" in
     targ_defvec=i386_elf32_sol2_vec
     targ_selvecs=i386_elf32_vec
     ;;
-  i[3-7]86-*-nto*)
-    targ_defvec=i386_elf32_vec
-    targ_selvecs="iamcu_elf32_vec i386_coff_vec"
-    ;;
-  i[3-7]86-*-aros*)
-    targ_defvec=i386_elf32_vec
-    targ_selvecs=iamcu_elf32_vec
-    ;;
-  i[3-7]86-*-dicos*)
+  i[3-7]86-*-dicos* | i[3-7]86-*-dragonfly* |  i[3-7]86-*-netbsd* | i[3-7]86-*-knetbsd*-gnu | i[3-7]86-*-redox*)
     targ_defvec=i386_elf32_vec
-    targ_selvecs=iamcu_elf32_vec
     targ64_selvecs="x86_64_elf64_vec"
     ;;
   *-*-msdosdjgpp* | *-*-go32* )
@@ -615,14 +611,9 @@ case "${targ}" in
     targ_defvec=i386_aout_bsd_vec
     targ_underscore=yes
     ;;
-  i[3-7]86-*-dragonfly*)
-    targ_defvec=i386_elf32_vec
-    targ_selvecs=iamcu_elf32_vec
-    targ64_selvecs="x86_64_elf64_vec"
-    ;;
   i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
     targ_defvec=i386_elf32_fbsd_vec
-    targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_pei_vec i386_coff_vec"
+    targ_selvecs="i386_elf32_vec i386_pei_vec i386_coff_vec"
     targ64_selvecs="x86_64_elf64_fbsd_vec x86_64_elf64_vec x86_64_pe_vec x86_64_pei_vec"
     # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
     case "${targ}" in
@@ -630,32 +621,17 @@ case "${targ}" in
 	targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;;
     esac
     ;;
-  i[3-7]86-*-netbsd* | i[3-7]86-*-knetbsd*-gnu)
-    targ_defvec=i386_elf32_vec
-    targ_selvecs="iamcu_elf32_vec"
-    targ64_selvecs="x86_64_elf64_vec"
-    ;;
-  i[3-7]86-*-openbsd*)
-    targ_defvec=i386_elf32_vec
-    targ_selvecs="iamcu_elf32_vec"
-    ;;
   i[3-7]86-*-linux-*)
     targ_defvec=i386_elf32_vec
-    targ_selvecs="iamcu_elf32_vec i386_pei_vec"
+    targ_selvecs="i386_pei_vec"
     targ64_selvecs="x86_64_elf64_vec x86_64_elf32_vec x86_64_pe_vec x86_64_pei_vec"
     ;;
-  i[3-7]86-*-redox*)
-    targ_defvec=i386_elf32_vec
-    targ_selvecs=
-    targ64_selvecs=x86_64_elf64_vec
-    ;;
   i[3-7]86-*-lynxos*)
     targ_defvec=i386_elf32_vec
-    targ_selvecs="iamcu_elf32_vec i386_coff_lynx_vec i386_aout_lynx_vec"
+    targ_selvecs="i386_coff_lynx_vec i386_aout_lynx_vec"
     ;;
-  i[3-7]86-*-gnu*)
+  i[3-7]86-*-aros* | i[3-7]86-*-gnu* | i[3-7]86-*-openbsd*)
     targ_defvec=i386_elf32_vec
-    targ_selvecs=iamcu_elf32_vec
     ;;
   i[3-7]86-*-msdos*)
     targ_defvec=i386_aout_vec
@@ -663,7 +639,7 @@ case "${targ}" in
     ;;
   i[3-7]86-*-moss*)
     targ_defvec=i386_elf32_vec
-    targ_selvecs="iamcu_elf32_vec i386_msdos_vec i386_aout_vec"
+    targ_selvecs="i386_msdos_vec i386_aout_vec"
     ;;
   i[3-7]86-*-beospe*)
     targ_defvec=i386_pe_vec
@@ -671,7 +647,7 @@ case "${targ}" in
     ;;
   i[3-7]86-*-beos*)
     targ_defvec=i386_elf32_vec
-    targ_selvecs="iamcu_elf32_vec i386_pe_vec i386_pei_vec"
+    targ_selvecs="i386_pe_vec i386_pei_vec"
     ;;
   i[3-7]86-*-haiku*)
     targ_defvec=i386_elf32_vec
@@ -683,13 +659,9 @@ case "${targ}" in
     # FIXME: This should eventually be checked at runtime.
     targ_cflags=-DSTRICT_PE_FORMAT
     ;;
-  i[3-7]86-*-rdos*)
-    targ_defvec=i386_elf32_vec
-    targ_selvecs="iamcu_elf32_vec i386_coff_vec"
-    ;;
   i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
     targ_defvec=i386_pe_vec
-    targ_selvecs="i386_pe_vec i386_pe_big_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec pdb_vec"
+    targ_selvecs="i386_pe_vec i386_pe_big_vec i386_pei_vec i386_elf32_vec pdb_vec"
     targ_underscore=yes
     ;;
   i[3-7]86-*-vxworks*)
@@ -1040,7 +1012,7 @@ case "${targ}" in
 
   pjl-*-*)
     targ_defvec=pj_elf32_le_vec
-    targ_selvecs="pj_elf32_le_vec pj_elf32_vec i386_elf32_vec iamcu_elf32_vec"
+    targ_selvecs="pj_elf32_le_vec pj_elf32_vec i386_elf32_vec"
     ;;
 
   powerpc-*-aix5.[01] | rs6000-*-aix5.[01])
@@ -1405,48 +1377,29 @@ case "${targ}" in
     targ_archs="$targ_archs bfd_powerpc_arch bfd_rs6000_arch"
     want64=true
     ;;
-  x86_64-*-dicos*)
-    targ_defvec=x86_64_elf64_vec
-    targ_selvecs="i386_elf32_vec iamcu_elf32_vec"
-    want64=true
-    ;;
-  x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia | x86_64-*-genode*)
-    targ_defvec=x86_64_elf64_vec
-    targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec"
-    case "${targ}" in
-      x86_64-*-rtems*)
-    targ_selvecs="${targ_selvecs} x86_64_pe_vec x86_64_pei_vec"
-    esac
-    want64=true
-    ;;
-  x86_64-*-dragonfly*)
+  x86_64-*-dicos* | x86_64-*-dragonfly* | x86_64-*-haiku* | x86_64-*-redox*)
     targ_defvec=x86_64_elf64_vec
-    targ_selvecs="i386_elf32_vec iamcu_elf32_vec"
+    targ_selvecs="i386_elf32_vec"
     want64=true
     ;;
   x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
     targ_defvec=x86_64_elf64_fbsd_vec
-    targ_selvecs="i386_elf32_fbsd_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec x86_64_pe_vec x86_64_pei_vec i386_elf32_vec x86_64_elf64_vec"
-    want64=true
-    ;;
-  x86_64-*-haiku*)
-    targ_defvec=x86_64_elf64_vec
-    targ_selvecs="i386_elf32_vec"
+    targ_selvecs="i386_elf32_fbsd_vec i386_coff_vec i386_pei_vec x86_64_pe_vec x86_64_pei_vec i386_elf32_vec x86_64_elf64_vec"
     want64=true
     ;;
   x86_64-*-netbsd* | x86_64-*-openbsd*)
     targ_defvec=x86_64_elf64_vec
-    targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec x86_64_pe_vec x86_64_pei_vec"
+    targ_selvecs="i386_elf32_vec i386_coff_vec i386_pei_vec x86_64_pe_vec x86_64_pei_vec"
     want64=true
     ;;
   x86_64-*-linux-*)
     targ_defvec=x86_64_elf64_vec
-    targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec i386_pei_vec x86_64_pe_vec x86_64_pei_vec"
+    targ_selvecs="i386_elf32_vec x86_64_elf32_vec i386_pei_vec x86_64_pe_vec x86_64_pei_vec"
     want64=true
     ;;
   x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin)
     targ_defvec=x86_64_pe_vec
-    targ_selvecs="x86_64_pe_vec x86_64_pei_vec x86_64_pe_big_vec x86_64_elf64_vec i386_pe_vec i386_pe_big_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec pdb_vec"
+    targ_selvecs="x86_64_pe_vec x86_64_pei_vec x86_64_pe_big_vec x86_64_elf64_vec i386_pe_vec i386_pe_big_vec i386_pei_vec i386_elf32_vec pdb_vec"
     want64=true
     targ_underscore=no
     ;;
@@ -1454,9 +1407,9 @@ case "${targ}" in
     targ_defvec=x86_64_elf64_vec
     want64=true
     ;;
-  x86_64-*-redox*)
+  x86_64-*-rtems*)
     targ_defvec=x86_64_elf64_vec
-    targ_selvecs=i386_elf32_vec
+    targ_selvecs="i386_elf32_vec x86_64_elf32_vec x86_64_pe_vec x86_64_pei_vec"
     want64=true
     ;;
   x86_64-*-solaris2*)
@@ -1464,9 +1417,9 @@ case "${targ}" in
     targ_selvecs="i386_elf32_sol2_vec x86_64_elf64_vec i386_elf32_vec"
     want64=true
     ;;
-  x86_64-*-gnu*)
+  x86_64-*-elf* | x86_64-*-fuchsia | x86_64-*-genode* | x86_64-*-gnu*)
     targ_defvec=x86_64_elf64_vec
-    targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec"
+    targ_selvecs="i386_elf32_vec x86_64_elf32_vec"
     want64=true
     ;;
 #endif
@@ -1540,13 +1493,6 @@ case "${targ_defvec} ${targ_selvecs}" in
     ;;
 esac
 
-# If we support Intel MCU target, then add support for bfd_iamcu_arch.
-case "${targ_defvec} ${targ_selvecs}" in
-  *iamcu_elf32*)
-    targ_archs="$targ_archs bfd_iamcu_arch"
-    ;;
-esac
-
 case "${targ}" in
   mipsisa32r6* | mipsisa64r6* | mips*-img-*)
     targ_cflags="$targ_cflags -DMIPS_DEFAULT_R6=1"
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index f63f5df703e..fdf0e4ac0be 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -812,7 +812,7 @@ if [gas_32_check] then {
 	    run_list_test "code64-inval" "-I${srcdir}/$subdir -al"
 	}
 
-	if {!([istarget "*-*-solaris2*"] || [istarget "*-*-vxworks*"])} then {
+	if { [istarget "i*86-*-elfiamcu"] } then {
 	    run_dump_test "iamcu-1"
 	    run_dump_test "iamcu-2"
 	    run_dump_test "iamcu-3"
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 3e158913b89..808581566a7 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -342,10 +342,8 @@ i[3-7]86-*-msdosdjgpp*) targ_emul=i386go32
 i[3-7]86-*-lynxos*)	targ_emul=i386lynx
 			;;
 i[3-7]86-*-aros*)	targ_emul=elf_i386
-			targ_extra_emuls=elf_iamcu
 			;;
 i[3-7]86-*-rdos*)	targ_emul=elf_i386
-			targ_extra_emuls=elf_iamcu
 			;;
 i[3-7]86-*-bsd)		targ_emul=i386bsd
 			targ_extra_ofiles=
@@ -357,7 +355,6 @@ i[3-7]86-*-bsdi*)	targ_emul=i386bsd
 			targ_extra_ofiles=
 			;;
 i[3-7]86-*-linux-*)	targ_emul=elf_i386
-			targ_extra_emuls="elf_iamcu"
 			targ64_extra_libpath="elf_x86_64 elf32_x86_64"
 			;;
 i[3-7]86-*-redox*)	targ_emul=elf_i386
@@ -378,24 +375,21 @@ i[3-7]86-*-netbsd*-gnu* | \
 i[3-7]86-*-knetbsd*-gnu | \
 i[3-7]86-*-openbsd*)
 			targ_emul=elf_i386
-			targ_extra_emuls="elf_iamcu"
 			;;
 i[3-7]86-*-elfiamcu)	targ_emul=elf_iamcu
 			targ_extra_emuls=elf_i386
 			;;
 i[3-7]86-*-elf* | i[3-7]86-*-rtems* | i[3-7]86-*-genode*)
 			targ_emul=elf_i386
-			targ_extra_emuls=elf_iamcu
 			;;
 i[3-7]86-*-dragonfly*)	targ_emul=elf_i386
-			targ_extra_emuls="elf_iamcu i386bsd"
+			targ_extra_emuls="i386bsd"
 			;;
 i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
 			targ_emul=elf_i386_fbsd
-			targ_extra_emuls="elf_i386 elf_iamcu i386bsd"
+			targ_extra_emuls="elf_i386 i386bsd"
 			;;
 i[3-7]86-*-gnu*)	targ_emul=elf_i386
-			targ_extra_emuls=elf_iamcu
 			;;
 i[3-7]86-*-msdos*)	targ_emul=i386msdos
 			targ_extra_emuls=i386aout
@@ -653,7 +647,7 @@ pdp11-*-*)		targ_emul=pdp11
 			targ_extra_ofiles=
 			;;
 pjl*-*-*)		targ_emul=pjlelf
-			targ_extra_emuls="elf_i386 elf_iamcu"
+			targ_extra_emuls="elf_i386"
 			;;
 pj*-*-*)		targ_emul=pjelf
 			targ_extra_ofiles=ldelfgen.o
@@ -953,12 +947,10 @@ x86_64-*-haiku*)	targ_emul=elf_x86_64_haiku
 			targ_extra_emuls="elf_x86_64 elf_i386_haiku"
 			;;
 x86_64-*-linux-gnux32)	targ_emul=elf32_x86_64
-			targ_extra_libpath="elf_i386 elf_iamcu elf_x86_64"
-			tdir_elf_iamcu=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
+			targ_extra_libpath="elf_i386 elf_x86_64"
 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
 			;;
 x86_64-*-linux-*)	targ_emul=elf_x86_64
-			targ_extra_emuls=elf_iamcu
 			targ_extra_libpath="elf_i386 elf32_x86_64"
 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
 			;;
@@ -972,28 +964,24 @@ x86_64-*-solaris2*)
 			;;
 x86_64-*-netbsd* | x86_64-*-openbsd*)
 			targ_emul=elf_x86_64
-			targ_extra_emuls="elf_i386 elf_iamcu"
-			tdir_elf_iamcu=`echo ${targ_alias} | \
-			    sed -e 's/x86_64/i386/' -e 's/aout//'`
+			targ_extra_emuls="elf_i386"
 			tdir_elf_i386=`echo ${targ_alias} | \
 			    sed -e 's/x86_64/i386/' -e 's/aout//'`
 			;;
 x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia* | x86_64-*-genode*)
 			targ_emul=elf_x86_64
-			targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64"
+			targ_extra_libpath="elf_i386 elf32_x86_64"
 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
 			;;
 x86_64-*-dragonfly*)	targ_emul=elf_x86_64
-			targ_extra_emuls="elf_i386 elf_iamcu"
+			targ_extra_emuls="elf_i386"
 			;;
 x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
 			targ_emul=elf_x86_64_fbsd
-			targ_extra_emuls="elf_x86_64 elf_i386 elf_iamcu"
+			targ_extra_emuls="elf_x86_64 elf_i386"
 			targ_extra_libpath="elf_i386_fbsd"
 			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/'`
 			;;
@@ -1011,7 +999,6 @@ x86_64-*-mingw*)	targ_emul=i386pep ;
 			targ_extra_ofiles="deffilep.o pdb.o pep-dll.o pe-dll.o"
 			;;
 x86_64-*-gnu*)		targ_emul=elf_x86_64
-			targ_extra_emuls=elf_iamcu
 			targ_extra_libpath="elf_i386 elf32_x86_64"
 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
 			;;
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 54c80604f24..807bb8e9fc4 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -283,7 +283,10 @@ proc iamcu_tests {} {
     run_dump_test "iamcu-4"
 }
 
-iamcu_tests
+set status [catch "exec $LD -V -melf_iamcu" got]
+if { $status == 0 } {
+    iamcu_tests
+}
 
 run_ld_link_tests $i386tests
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.