[patch] MIPS/Linux: Let one select the default ABI for 64-bit

Maciej W. Rozycki macro@ds2.pg.gda.pl
Thu May 22 12:23:00 GMT 2003


On 21 May 2003, Ian Lance Taylor wrote:

> > Uh, n32 support should either be complete in binutils right now, or
> > should be "shortly."
> 
> I think the issue isn't whether or not n32 support is complete, but
> that when using n32 you can't fully exploit the 64 bit address space.

 That's exactly what I meant.

> However, I tend to agree that n32 should be the default since it ought
> to be more efficient in most cases.  On the other hand, in principle,
> it would be good to have a configuration which would make n64 the
> default.  It just wouldn't be the configuration returned by
> config.guess.

 I do think it should be returned by config.guess under specific
conditions.  Actually I think whenever config.guess detects a mips64 host
it should perform an additional check of the toolchain configuration and
return an appropriate quintuple depending on what ABI is the default,
assuming big-endian for the purpose of this consideration, it would be one
of: "mips-unknown-linux-gnu" for o32, "mips64-unknown-linux-gnu-abin32"
for n32 and "mips64-unknown-linux-gnu-abi64" for (n)64.  This way user
would get the same kind of binaries he already has on his system, that
should lead to the least surprise.

 Additionally, I think config.sub should explicitly expand "mips64-linux" 
(plus variations, as appropriate) into "mips64-unknown-linux-gnu-abin32" 
so that it's immediately visible from the configure output that n32 is
used. 

> On Intel ia32, the compiler always generates i386 code by default, no
> matter how it is configured.  You need to use -march to get anything
> else.  If only we had made similar choices for MIPS long ago.

 Being brought up with the i386 and Alpha it's natural for me and I'm just
fine with the analogy for MIPS as well.  I always use generic
configurations, assuming "mips" stands for the oldest 32-bit configuration
(i.e. MIPS-I or R2000) and "mips64" -- for the oldest 64-bit one (i.e. 
MIPS-III or R4000).  Everything else I resolve with appropriate CFLAGS
(which unfortunately have a convoluted history, too).

 Only the ABI selection doesn't fit there well, it would seem -- for me
the natural consequence of these generic assumptions is the (n)64 ABI
being capable of making full use of the CPU's architecture is the right
choice for "mips64", but others prefer a practical approach based on the
"most widely used" assumption. 

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +



More information about the Binutils mailing list