[v4] MIPS: Use 64-bit a ABI by default for `mipsisa64*-*-linux*' targets

Message ID 20231117090310.3014726-1-yunqiang.su@cipunited.com
State New
Headers
Series [v4] MIPS: Use 64-bit a ABI by default for `mipsisa64*-*-linux*' targets |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Testing passed

Commit Message

YunQiang Su Nov. 17, 2023, 9:03 a.m. UTC
  Following the arrangement in GCC select a 64-bit ABI by default, either
n32 or n64, rather than o32 for `mipsisa64*-*-linux*' targets, just as
with the corresponding `mips64*-*-linux*' targets.
---
 bfd/config.bfd                                     |  8 ++++----
 binutils/testsuite/binutils-all/mips/mips.exp      |  3 ++-
 binutils/testsuite/binutils-all/objcopy.exp        |  2 +-
 binutils/testsuite/binutils-all/remove-relocs-01.d |  2 +-
 binutils/testsuite/binutils-all/remove-relocs-04.d |  2 +-
 binutils/testsuite/binutils-all/remove-relocs-05.d |  2 +-
 binutils/testsuite/binutils-all/remove-relocs-06.d |  2 +-
 gas/configure                                      |  6 +++---
 gas/configure.ac                                   |  6 +++---
 gas/testsuite/gas/mips/compact-eh-eb-7.d           |  2 +-
 gas/testsuite/gas/mips/compact-eh-el-7.d           |  2 +-
 ld/configure.tgt                                   | 10 ++++++----
 12 files changed, 25 insertions(+), 22 deletions(-)
  

Comments

YunQiang Su Nov. 29, 2023, 6:13 a.m. UTC | #1
YunQiang Su <yunqiang.su@cipunited.com> 于2023年11月17日周五 17:04写道:
>
> Following the arrangement in GCC select a 64-bit ABI by default, either
> n32 or n64, rather than o32 for `mipsisa64*-*-linux*' targets, just as
> with the corresponding `mips64*-*-linux*' targets.
> ---

ping
  
Nick Clifton Nov. 30, 2023, 1:40 p.m. UTC | #2
Hi YunQiang Su,

>> Following the arrangement in GCC select a 64-bit ABI by default, either
>> n32 or n64, rather than o32 for `mipsisa64*-*-linux*' targets, just as
>> with the corresponding `mips64*-*-linux*' targets.
>> ---
> 
> ping

Sorry - I meant to post that I am leaving this one to Maciej.  I am concerned
that changing the target matching for those targets might affect already
existing users who are expecting the old behaviour.  I do not know if this is
possible/likely however, so I would prefer to leave the decision to someone
who has much more knowledge of the MIPS target than myself, ie Maciej.

Cheers
   Nick
  
YunQiang Su Dec. 1, 2023, 12:56 a.m. UTC | #3
在 2023/11/30 21:40, Nick Clifton 写道:
> Hi YunQiang Su,
> 
>>> Following the arrangement in GCC select a 64-bit ABI by default, either
>>> n32 or n64, rather than o32 for `mipsisa64*-*-linux*' targets, just as
>>> with the corresponding `mips64*-*-linux*' targets.
>>> ---
>>
>> ping
> 
> Sorry - I meant to post that I am leaving this one to Maciej.  I am 
> concerned
> that changing the target matching for those targets might affect already
> existing users who are expecting the old behaviour.  I do not know if 
> this is
> possible/likely however, so I would prefer to leave the decision to someone
> who has much more knowledge of the MIPS target than myself, ie Maciej.
> 

https://sourceware.org/pipermail/binutils/2023-August/128758.html
In this post, Maciej suggested that we can limit mips*64-* to 
mipsisa64*-linux*.

> Cheers
>    Nick
>
  
YunQiang Su Jan. 2, 2024, 9:30 a.m. UTC | #4
YunQiang Su <wzssyqa@gmail.com> 于2023年12月1日周五 08:56写道:
>
>
>
> 在 2023/11/30 21:40, Nick Clifton 写道:
> > Hi YunQiang Su,
> >
> >>> Following the arrangement in GCC select a 64-bit ABI by default, either
> >>> n32 or n64, rather than o32 for `mipsisa64*-*-linux*' targets, just as
> >>> with the corresponding `mips64*-*-linux*' targets.
> >>> ---
> >>
> >> ping
> >
> > Sorry - I meant to post that I am leaving this one to Maciej.  I am
> > concerned
> > that changing the target matching for those targets might affect already
> > existing users who are expecting the old behaviour.  I do not know if
> > this is
> > possible/likely however, so I would prefer to leave the decision to someone
> > who has much more knowledge of the MIPS target than myself, ie Maciej.
> >
>
> https://sourceware.org/pipermail/binutils/2023-August/128758.html
> In this post, Maciej suggested that we can limit mips*64-* to
> mipsisa64*-linux*.
>

ping.
This config has been in gcc since 2008, with this commit:
     f2d6ca5081ba8fb31b5d03545f45cce12ac67b3f


> > Cheers
> >    Nick
> >
  

Patch

diff --git a/bfd/config.bfd b/bfd/config.bfd
index 08129e6a8cb..55fd02e787c 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -956,21 +956,21 @@  case "${targ}" in
     targ_defvec=mips_elf32_be_vec
     targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
     ;;
-  mips64*el-*-linux*-gnuabi64)
+  mips64*el-*-linux*-gnuabi64 | mipsisa64*el-*-linux*-gnuabi64)
     targ_defvec=mips_elf64_trad_le_vec
     targ_selvecs="mips_elf64_trad_be_vec mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec"
     want64=true
     ;;
-  mips64*el-*-linux*)
+  mips64*el-*-linux* | mipsisa64*el-*-linux*)
     targ_defvec=mips_elf32_ntrad_le_vec
     targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
     ;;
-  mips64*-*-linux*-gnuabi64)
+  mips64*-*-linux*-gnuabi64 | mipsisa64*-*-linux*-gnuabi64)
     targ_defvec=mips_elf64_trad_be_vec
     targ_selvecs="mips_elf64_trad_le_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec"
     want64=true
     ;;
-  mips64*-*-linux*)
+  mips64*-*-linux* | mipsisa64*-*-linux*)
     targ_defvec=mips_elf32_ntrad_be_vec
     targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
     ;;
diff --git a/binutils/testsuite/binutils-all/mips/mips.exp b/binutils/testsuite/binutils-all/mips/mips.exp
index fdab97180e3..dc4450db74a 100644
--- a/binutils/testsuite/binutils-all/mips/mips.exp
+++ b/binutils/testsuite/binutils-all/mips/mips.exp
@@ -121,7 +121,8 @@  set abi_ldflags(eabi) ""
 # Override as needed.
 if {[istarget *-*-openbsd*] } {
     set irixemul 0
-} elseif { [istarget mips64*-*-linux*] } {
+} elseif { [istarget mips64*-*-linux*] \
+     || [istarget mipsisa64*-*-linux*] } {
     if [istarget *el-*-*] {
 	set abi_asflags(o32) -32
 	set abi_ldflags(o32) -melf32ltsmip
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 34a9b3ff5b2..e9b5eb4e3a7 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -1276,7 +1276,7 @@  if [is_elf_format] {
     run_dump_test "strip-12"
 
     if { [istarget "mips64*-*-openbsd*"] \
-	 || [istarget "mips64*-*-*-gnuabi64"] } {
+	 || [istarget "mipsisa64*-*-*-gnuabi64"] } {
 	set reloc_format mips64
     }
     # A relocation type not supported by any target
diff --git a/binutils/testsuite/binutils-all/remove-relocs-01.d b/binutils/testsuite/binutils-all/remove-relocs-01.d
index aeceba117d1..1ef10374232 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-01.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-01.d
@@ -2,7 +2,7 @@ 
 #source: remove-relocs-01.s
 #objcopy: --remove-relocations=.data.relocs.01
 #readelf: -r
-#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64
+#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64 mipsisa64*-*-*-gnuabi64
 
 Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
 .*
diff --git a/binutils/testsuite/binutils-all/remove-relocs-04.d b/binutils/testsuite/binutils-all/remove-relocs-04.d
index 4ae7a90f0f1..3037423a911 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-04.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-04.d
@@ -2,7 +2,7 @@ 
 #source: remove-relocs-01.s
 #objcopy: --remove-relocations=.data.relocs.0\[12\]
 #readelf: -r
-#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64
+#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64 mipsisa64*-*-*-gnuabi64
 
 Relocation section '\.rela?\.data\.relocs\.03' at offset 0x[0-9a-f]+ contains 3 entries:
 .*
diff --git a/binutils/testsuite/binutils-all/remove-relocs-05.d b/binutils/testsuite/binutils-all/remove-relocs-05.d
index 0f3591786b3..847f39f3b25 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-05.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-05.d
@@ -2,7 +2,7 @@ 
 #source: remove-relocs-01.s
 #objcopy: --remove-section=.rela.data.relocs.01 --remove-section=.rel.data.relocs.01
 #readelf: -r
-#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64
+#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64 mipsisa64*-*-*-gnuabi64
 
 Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
 .*
diff --git a/binutils/testsuite/binutils-all/remove-relocs-06.d b/binutils/testsuite/binutils-all/remove-relocs-06.d
index f530d300087..363b0934a65 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-06.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-06.d
@@ -2,7 +2,7 @@ 
 #source: remove-relocs-01.s
 #objcopy: --remove-relocations=.data.relocs.* --remove-relocations=!.data.relocs.02
 #readelf: -r
-#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64
+#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64 mipsisa64*-*-*-gnuabi64
 
 Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
 .*
diff --git a/gas/configure b/gas/configure
index 6a2f56f928a..9c692119083 100755
--- a/gas/configure
+++ b/gas/configure
@@ -12276,11 +12276,11 @@  _ACEOF
 	esac
 	# Decide which ABI to target by default.
 	case ${target} in
-	  mips64*-openbsd* | mips64*-linux-gnuabi64)
+	  mips64*-openbsd* | mips64*-linux-gnuabi64 | mipsisa64*-linux-gnuabi64)
 	    mips_default_abi=N64_ABI
 	    ;;
-	  mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \
-	  | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
+	  mips64*-linux* | mipsisa64*-linux* | mips-sgi-irix6* \
+	  | mips64*-freebsd* | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
 	    mips_default_abi=N32_ABI
 	    ;;
 	  mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
diff --git a/gas/configure.ac b/gas/configure.ac
index d0b4cfb0310..d756974e0c2 100644
--- a/gas/configure.ac
+++ b/gas/configure.ac
@@ -394,11 +394,11 @@  changequote([,])dnl
 	esac
 	# Decide which ABI to target by default.
 	case ${target} in
-	  mips64*-openbsd* | mips64*-linux-gnuabi64)
+	  mips64*-openbsd* | mips64*-linux-gnuabi64 | mipsisa64*-linux-gnuabi64)
 	    mips_default_abi=N64_ABI
 	    ;;
-	  mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \
-	  | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
+	  mips64*-linux* | mipsisa64*-linux* | mips-sgi-irix6* \
+	  | mips64*-freebsd* | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
 	    mips_default_abi=N32_ABI
 	    ;;
 	  mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
diff --git a/gas/testsuite/gas/mips/compact-eh-eb-7.d b/gas/testsuite/gas/mips/compact-eh-eb-7.d
index 973e69fe31a..4e53e57e626 100644
--- a/gas/testsuite/gas/mips/compact-eh-eb-7.d
+++ b/gas/testsuite/gas/mips/compact-eh-eb-7.d
@@ -2,7 +2,7 @@ 
 #name: Compact EH EB #7 with personality id and fallback FDE
 #source: compact-eh-7.s
 #as: -EB -mno-pdr
-#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64
+#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64 mipsisa64*-*-*-gnuabi64
 
 .*:     file format.*
 
diff --git a/gas/testsuite/gas/mips/compact-eh-el-7.d b/gas/testsuite/gas/mips/compact-eh-el-7.d
index fb7dde9252f..e83e133f9d4 100644
--- a/gas/testsuite/gas/mips/compact-eh-el-7.d
+++ b/gas/testsuite/gas/mips/compact-eh-el-7.d
@@ -2,7 +2,7 @@ 
 #name: Compact EH EL #7 with personality id and fallback FDE
 #source: compact-eh-7.s
 #as: -EL -mno-pdr
-#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64
+#notarget: mips64*-*-openbsd* mips64*-*-*-gnuabi64 mipsisa64*-*-*-gnuabi64
 
 .*:     file format.*
 
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 3aa595ef130..1a0b88f3f63 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -587,21 +587,23 @@  mips*-*-vxworks*)	targ_emul=elf32ebmipvxworks
 			;;
 mips*-*-windiss)	targ_emul=elf32mipswindiss
 			;;
-mips64*el-*-linux-gnuabi64)
+mips64*el-*-linux-gnuabi64 | mipsisa64*el-*-linux-gnuabi64)
 			targ_emul=elf64ltsmip
 			targ_extra_emuls="elf64btsmip elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip"
 			targ_extra_libpath=$targ_extra_emuls
 			;;
-mips64*el-*-linux-*)	targ_emul=elf32ltsmipn32
+mips64*el-*-linux-* | mipsisa64*el-*-linux-*)
+			targ_emul=elf32ltsmipn32
 			targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
 			targ_extra_libpath=$targ_extra_emuls
 			;;
-mips64*-*-linux-gnuabi64)
+mips64*-*-linux-gnuabi64 | mipsisa64*-*-linux-gnuabi64)
 			targ_emul=elf64btsmip
 			targ_extra_emuls="elf64ltsmip elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip"
 			targ_extra_libpath=$targ_extra_emuls
 			;;
-mips64*-*-linux-*)	targ_emul=elf32btsmipn32
+mips64*-*-linux-* | mipsisa64*-*-linux-*)
+			targ_emul=elf32btsmipn32
 			targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
 			targ_extra_libpath=$targ_extra_emuls
 			;;