[3/4] x86-64: improve gas diagnostic when no 32-bit target is configured

Message ID 778a4bcd-ac39-6512-38d2-782e4eb1eea9@suse.com
State Unresolved
Headers
Series x86: (mostly) testsuite adjustments |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Jan Beulich May 19, 2023, 1:52 p.m. UTC
  Make this similar to --64 and --x32: Check whether a suitable target
exists.
  

Patch

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -14186,7 +14186,21 @@  md_parse_option (int c, const char *arg)
 #endif
 
     case OPTION_32:
-      default_arch = "i386";
+      {
+	const char **list, **l;
+
+	list = bfd_target_list ();
+	for (l = list; *l != NULL; l++)
+	  if (strstr (*l, "-i386")
+	      || strstr (*l, "-go32"))
+	    {
+	      default_arch = "i386";
+	      break;
+	    }
+	if (*l == NULL)
+	  as_fatal (_("no compiled in support for ix86"));
+	free (list);
+      }
       break;
 
     case OPTION_DIVIDE: