This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [patch, mips] Fix stubs files for hard float vs. soft float
On Tue, 2012-10-23 at 14:32 -0700, Roland McGrath wrote:
> > * sysdeps/mips/preconfigure: Create default_abi.make.
>
> We use dashes in file names for the most part, not underscores.
OK, that is easy enough to change.
> > --- a/ports/sysdeps/mips/preconfigure
> > +++ b/ports/sysdeps/mips/preconfigure
> > @@ -1,3 +1,24 @@
> > +
> > +cat > conftest.c <<EOF
> > +#if defined(__mips_soft_float) && (_MIPS_SIM == _ABIO32)
> > +o32_soft
> > +#elif defined(__mips_hard_float) && (_MIPS_SIM == _ABIO32)
> > +o32_hard
> > +#elif defined(__mips_soft_float) && (_MIPS_SIM == _ABIN32)
> > +n32_soft
> > +#elif defined(__mips_hard_float) && (_MIPS_SIM == _ABIN32)
> > +n32_hard
> > +#elif defined(__mips_soft_float) && (_MIPS_SIM == _ABI64)
> > +n64_soft
> > +#elif defined(__mips_hard_float) && (_MIPS_SIM == _ABI64)
> > +n64_hard
> > +#else
> > +ERROR
> > +#endif
> > +EOF
> > +default_abi=`$CC $CFLAGS $CPPFLAGS -E -P conftest.c`
> > +echo "default-abi := $default_abi" >> default_abi.make
>
> This should fail at configure time if something goes wrong,
> not produce bogus results.
OK, so I'll get rid of the #else/ERROR lines and then have the script
print an error message and 'exit 1' if default_abi does not get set.
That should also catch problems where the CC fails to execute or aborts
for some reason.
> Why does this need to be in preconfigure instead of configure?
It doesn't have to be. I just put it there because that script was
already using CC and CFLAGS. Is there are reason why it shouldn't
be there? I guess I could put it in
ports/sysdeps/unix/sysv/linux/mips/configure.in instead since the
Makefile that includes the generated Makefile is in
ports/sysdeps/unix/sysv/linux/mips. Would that be better?
Steve Ellcey
sellcey@mips.com