public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: YunQiang Su <yunqiang.su@cipunited.com>
To: binutils@sourceware.org
Cc: macro@orcam.me.uk, paul.hua.gm@gmail.com, amodra@gmail.com,
	jbeulich@suse.com, YunQiang Su <yunqiang.su@cipunited.com>
Subject: [PATCH v4 2/7] MIPS: Set r6 as default arch if vendor is img
Date: Fri, 16 Jun 2023 14:34:07 +0800	[thread overview]
Message-ID: <20230616063412.1715024-3-yunqiang.su@cipunited.com> (raw)
In-Reply-To: <20230616063412.1715024-1-yunqiang.su@cipunited.com>

This behavior is used by downstream toolchain since 2014.
We also set the default ABI for mips*-img-elf to O32.
The previous value is NO_ABI, which is not good default ABI.

We don't support mips64*-img* due to GCC doesn't support it,
and we believe that the multilib should be used for this case.
---
 bfd/config.bfd   | 2 +-
 gas/configure    | 8 +++++++-
 gas/configure.ac | 8 +++++++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/bfd/config.bfd b/bfd/config.bfd
index 954837033c8..78752994456 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -1537,7 +1537,7 @@ case "${targ_defvec} ${targ_selvecs}" in
 esac
 
 case "${targ}" in
-  mipsisa32r6* | mipsisa64r6*)
+  mipsisa32r6* | mipsisa64r6* | mips*-img-*)
     targ_cflags="$targ_cflags -DMIPS_DEFAULT_R6=1"
     ;;
 esac
diff --git a/gas/configure b/gas/configure
index 868f4a911a9..580022d858d 100755
--- a/gas/configure
+++ b/gas/configure
@@ -12211,6 +12211,12 @@ _ACEOF
 	    use_e_mips_abi_o32=1
 	    ;;
 	esac
+	# If Vendor is IMG, then MIPSr6 is used
+	case ${target} in
+	  mips*-img-*)
+	    mips_cpu=mips32r6
+	    ;;
+	esac
 	# Decide whether to generate 32-bit or 64-bit code by default.
 	# Used to resolve -march=from-abi when an embedded ABI is selected.
 	case ${target} in
@@ -12230,7 +12236,7 @@ _ACEOF
 	  | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
 	    mips_default_abi=N32_ABI
 	    ;;
-	  mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
+	  mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu | mips*-img-elf)
 	    mips_default_abi=O32_ABI
 	    ;;
 	  mips64*-openbsd*)
diff --git a/gas/configure.ac b/gas/configure.ac
index 03728ffce4d..c1571a49fbb 100644
--- a/gas/configure.ac
+++ b/gas/configure.ac
@@ -380,6 +380,12 @@ changequote([,])dnl
 	    use_e_mips_abi_o32=1
 	    ;;
 	esac
+	# If Vendor is IMG, then MIPSr6 is used
+	case ${target} in
+	  mips*-img-*)
+	    mips_cpu=mips32r6
+	    ;;
+	esac
 	# Decide whether to generate 32-bit or 64-bit code by default.
 	# Used to resolve -march=from-abi when an embedded ABI is selected.
 	case ${target} in
@@ -399,7 +405,7 @@ changequote([,])dnl
 	  | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
 	    mips_default_abi=N32_ABI
 	    ;;
-	  mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
+	  mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu | mips*-img-elf)
 	    mips_default_abi=O32_ABI
 	    ;;
 	  mips64*-openbsd*)
-- 
2.30.2


  parent reply	other threads:[~2023-06-16  6:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16  6:34 [PATCH v4 0/7] Some MIPS changes and testsuite fixes YunQiang Su
2023-06-16  6:34 ` [PATCH v4 1/7] MIPS: Gas: alter 64 or 32 for mipsisa triples if march is implicit YunQiang Su
2023-06-29 10:12   ` YunQiang Su
2023-06-16  6:34 ` YunQiang Su [this message]
2023-06-16  6:34 ` [PATCH v4 3/7] MIPS: Fix r6 testsuites YunQiang Su
2023-06-16  6:34 ` [PATCH v4 4/7] MIPS: Fix -gnuabi64 testsuite YunQiang Su
2023-06-16  6:34 ` [PATCH v4 5/7] MIPS: Fix some ld testcases with compiler YunQiang Su
2023-06-19  6:44   ` Alan Modra
2023-06-19 10:43     ` YunQiang Su
2023-06-20  0:00       ` Alan Modra
2023-06-20  1:40         ` YunQiang Su
2023-06-20  2:34           ` Alan Modra
2023-06-20  3:17             ` YunQiang Su
2023-06-20  3:57               ` Alan Modra
2023-06-21  5:05                 ` YunQiang Su
2023-06-21 10:53                   ` YunQiang Su
2023-06-21 10:59                     ` Xi Ruoyao
2023-06-21 11:03                       ` YunQiang Su
2023-06-29 14:17       ` YunQiang Su
2023-06-20  2:58     ` Alan Modra
2023-07-03  4:00     ` YunQiang Su
2023-06-16  6:34 ` [PATCH v4 6/7] MIPS: Disable fix-rm7000-2 and llpscp-64 if not has_newabi YunQiang Su
2023-06-16  6:34 ` [PATCH v4 7/7] MIPS: Fix Irix gas testcases YunQiang Su
2023-08-15  4:40   ` YunQiang Su
2023-08-15  6:13     ` Jan Beulich
2023-08-15 10:14       ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230616063412.1715024-3-yunqiang.su@cipunited.com \
    --to=yunqiang.su@cipunited.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    --cc=macro@orcam.me.uk \
    --cc=paul.hua.gm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).