[PATCH v4 1/2] MIPS: support mips*64 as CPU and gnuabi64 as ABI

Maciej W. Rozycki macro@orcam.me.uk
Fri Jul 21 11:54:37 GMT 2023


On Fri, 21 Jul 2023, YunQiang Su wrote:

> Maciej W. Rozycki <macro@orcam.me.uk> 于2023年7月21日周五 18:01写道:
> >
> > Nick, please hold on with 2.41 until this incompatible ABI change has been
> > sorted.
> >
> > On Wed, 19 Apr 2023, Richard Sandiford wrote:
> >
> > > > For MIPS64r6 ports, Debian as an example, `mipsisa64r6el` is
> > > > used as the cpu name in triple.
> > > > Let's recognize them by `mips*64*(el)`.
> > > >
> > > > For 64bit Ports, like Debian's mips64el and mips64r6el ports,
> > > > `gnuabi64` is used as the abi section.
> > > > Let's use N64 abi by default for the triple with gnuabi64.
> > > > ---
> > > >  bfd/config.bfd                                     | 14 ++++++++++++--
> > > >  .../testsuite/binutils-all/mips/mips-note-2-n32.d  |  1 +
> > > >  gas/configure                                      |  5 ++++-
> > > >  gas/configure.ac                                   |  5 ++++-
> > > >  gold/configure.tgt                                 | 14 ++++++++++++++
> > > >  ld/configure.tgt                                   | 12 ++++++++++--
> > > >  6 files changed, 45 insertions(+), 6 deletions(-)
> > >
> > > OK, thanks.
> >
> >  So this has changed the default ABI from o32 to n32 for `mipsisa64-*-*'
> 
> I think that maybe you have a misunderstanding.
> 1. It is *not* for `mipsisa64-*-*', it is for `mipsisa64-*-gnuabi64'
> 2. It is not from O32 to N32. It is from N32 to N64.

 Well test results say otherwise.  Please build yourself binutils for 
`mipsisa64-linux' and see what output format it uses with and without this 
change.

 I have:

$ mipsisa64-linux/gas/as-new /dev/null -o null.o
$ file null.o
null.o: ELF 32-bit MSB relocatable, MIPS, MIPS64 version 1 (SYSV), not stripped
$ mipsisa64-linux/ld/ld-new -e 0 null.o -o null
$ file null
null: ELF 32-bit MSB executable, MIPS, MIPS64 version 1 (SYSV), statically linked, not stripped
$ 

as at commit 32f1c80375eb^, and:

$ mipsisa64-linux/gas/as-new /dev/null -o null.o
$ file null.o
null.o: ELF 32-bit MSB relocatable, MIPS, MIPS64 version 1 (SYSV), not stripped
$ mipsisa64-linux/ld/ld-new -e 0 null.o -o null
mipsisa64-linux/ld/ld-new: null.o: ABI is incompatible with that of the selected emulation
mipsisa64-linux/ld/ld-new: failed to merge target specific data of file null.o
$ 

as from commit 32f1c80375eb.  The default format used by LD is now not the
same as one produced by GAS.

  Maciej


More information about the Binutils mailing list