This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Build failure on MIPS (strtorx.c) [Patch attached]
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: sellcey at imgtec dot com
- Cc: "Maciej W. Rozycki" <macro at imgtec dot com>, newlib at sourceware dot org
- Date: Tue, 24 Nov 2015 16:50:53 -0500 (EST)
- Subject: Re: Build failure on MIPS (strtorx.c) [Patch attached]
- Authentication-results: sourceware.org; auth=none
- References: <6b3cf942-89f5-43f0-bb0b-33a8f1c8515a at BAMAIL02 dot ba dot imgtec dot org> <alpine dot DEB dot 2 dot 00 dot 1511241814220 dot 6915 at tp dot orcam dot me dot uk> <1448391595 dot 26738 dot 7 dot camel at ubuntu-sellcey>
Please go ahead if you have write access, otherwise I'll check it in for you.
-- Jeff J.
----- Original Message -----
> On Tue, 2015-11-24 at 18:28 +0000, Maciej W. Rozycki wrote:
> > On Mon, 23 Nov 2015, Steve Ellcey wrote:
> >
> > > The recent changes to strtorx.c and strtodg.c seem to have broken the
> > > MIPS newlib build. My build is currently failing while compiling
> > > strtorx.c.
> > > It complains that ldus_QNAN[01234] are undeclared and that the use of
> > > _strtodg_r is an implicit function reference.
> >
> > These macros are for the x86 80-bit extended format (with an explicit
> > leading significand bit). They are irrelevant for the MIPS target.
> >
> > > I am not sure what the correct fix for this is. I see the definitions
> > > of ldus_QNAN* in newlib/libc/stdlib/gd_qnan.h and that it is ifdef'ed
> > > for MIPS. It looks like if __mips is defined then none of the ldus_QNAN
> > > macros are defined but I don't know if they should be defined or if the
> > > uses of them in strtorx.c should be ifdef'ed out for MIPS.
> >
> > The `long double' type is an alias to the `double' type on MIPS/Newlib
> > targets I believe, and the x86 80-bit extended format is not used so I
> > think _LDBL_EQ_DBL is supposed to be defined and strtorx.c excluded from
> > the build if this is the case. I can see this is already the case for the
> > relevant prototypes provided in newlib/libc/stdlib/mprec.h so it looks
> > like a simple bug in importing the changes in commit fbace816.
> >
> > Maciej
>
> That makes sense now, I applied this patch to my local sources and was
> able to build correctly again. Can someone approve this patch for
> checkin?
>
> Steve Ellcey
> sellcey@imgtec.com
>
>
>
>
> 2015-11-24 Steve Ellcey <sellcey@imgtec.com>
>
> * libc/stdlib/strtorx.c: Fix ifdef to check _LDBL_EQ_DBL.
>
>
> diff --git a/newlib/libc/stdlib/strtorx.c b/newlib/libc/stdlib/strtorx.c
> index 85d8722..44f3db2 100644
> --- a/newlib/libc/stdlib/strtorx.c
> +++ b/newlib/libc/stdlib/strtorx.c
> @@ -37,7 +37,7 @@ THIS SOFTWARE.
> #include "gdtoa.h"
> #include "gd_qnan.h"
>
> -#ifdef _HAVE_LONG_DOUBLE
> +#if defined (_HAVE_LONG_DOUBLE) && !defined (_LDBL_EQ_DBL)
>
> #undef _0
> #undef _1
> @@ -126,4 +126,4 @@ _strtorx_r(struct _reent *p, const char *s, char
> **sp, int rounding, void *L)
> return k;
> }
>
> -#endif /* _HAVE_LONG_DOUBLE */
> +#endif /* _HAVE_LONG_DOUBLE && !_LDBL_EQ_DBL */
>
>
>