public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] x86-64: improve gas diagnostic when no 32-bit target is configured
@ 2023-05-26  8:14 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2023-05-26  8:14 UTC (permalink / raw)
  To: bfd-cvs

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

commit 590a0fed02a2e414b83a92128ec8e85a7892a85c
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri May 26 10:14:13 2023 +0200

    x86-64: improve gas diagnostic when no 32-bit target is configured
    
    Make this similar to --64 and --x32: Check whether a suitable target
    exists.

Diff:
---
 gas/config/tc-i386.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 74b2d252381..690f6ee060d 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -14188,7 +14188,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:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-26  8:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26  8:14 [binutils-gdb] x86-64: improve gas diagnostic when no 32-bit target is configured Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).