This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: HEAD and gcc4 build fixes for MIPS
On Thu, Feb 10, 2005 at 02:42:50PM +0000, Maciej W. Rozycki wrote:
> On Wed, 9 Feb 2005, Daniel Jacobowitz wrote:
>
> > @@ -162,6 +164,24 @@ la_symbind64 (Elf64_Sym *sym, unsigned i
> > # define La_regs La_ia64_regs
> > # define La_retval La_ia64_retval
> > # define int_retval lrv_r8
> > +#elif defined __mips__ && _MIPS_SIM == _ABIO32
> > +# define pltenter la_mips_o32_gnu_pltenter
> > +# define pltexit la_mips_o32_gnu_pltexit
> > +# define La_regs La_mips_32_regs
> > +# define La_retval La_mips_32_retval
> > +# define int_retval lrv_v0
> > +#elif defined __mips__ && _MIPS_SIM == _ABIN32
> > +# define pltenter la_mips_n32_gnu_pltenter
> > +# define pltexit la_mips_n32_gnu_pltexit
> > +# define La_regs La_mips_64_regs
> > +# define La_retval La_mips_64_retval
> > +# define int_retval lrv_v0
> > +#elif defined __mips__ && _MIPS_SIM == _ABIN64
> > +# define pltenter la_mips_n64_gnu_pltenter
> > +# define pltexit la_mips_n64_gnu_pltexit
> > +# define La_regs La_mips_64_regs
> > +# define La_retval La_mips_64_retval
> > +# define int_retval lrv_v0
> > #else
> > # error "architecture specific code needed"
> > #endif
>
> AFAIK the agreed rule is to use _MIPS_SIM_ABI32, _MIPS_SIM_NABI32 and
> _MIPS_SIM_ABI64 respectively.
All that, and you didn't even notice the _ABIN64 typo! I was just
about to send a corrected patch.
> And checking what's going on I've discovered, to my surprise, the
> _ABIO32, _ABIN32 and _ABIN64 macros are still used. Apparently an
> incorrect patch was applied under the following ChangeLog entry:
>
> 2004-11-05 Maciej W. Rozycki <macro@mips.com>
>
> See the thread starting at:
> http://sources.redhat.com/ml/libc-alpha/2004-11/msg00034.html for details
> and: http://sources.redhat.com/ml/libc-alpha/2004-11/msg00083.html for the
> final patch.
>
> I've prepared a fix reverting the bad change and applying the intended
> one that I will send separately once testing concludes. It's a pity it
> wasn't spotted before 2.3.4 was released.
Grr, and I just finished updating to the "new" style.
However, Maciej, I think we should stay with the _ABI macros. Richard
Sandiford pointed something interesting out. In the message you
referenced above you wrote:
> Unfortunately, after a closer look I've noticed these _ABI* macros get
> actually defined only if they are going to be used for the value of
> _MIPS_SIM, that is one at a time. So after removing my addition of them
> from <sgidefs.h> conditionals that refer to them suddenly stop working.
> So let's just scrap my proposal as it does not make sense anymore.
But that's not true. While only one will be defined, it will always
have a non-zero value. So:
-mabi=32 -mabi=64
#if _MIPS_SIM == _ABIO32 1 == 1 3 == 0
#if _MIPS_SIM != _ABIO32 1 != 1 3 != 0
#if _MIPS_SIM == _ABIN32 1 == 0 3 == 0
#if _MIPS_SIM != _ABIN32 1 != 0 3 != 0
#if _MIPS_SIM == _ABI64 1 == 0 3 == 3
#if _MIPS_SIM != _ABI64 1 != 0 3 != 3
The conditionals always come out right.
--
Daniel Jacobowitz
CodeSourcery, LLC