This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Work around conflicting declarations of math functions
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 9 Nov 2015 22:25:12 +0000
- Subject: Re: [PATCH] Work around conflicting declarations of math functions
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1511050049220 dot 18787 at digraph dot polyomino dot org dot uk> <5640BD9A dot 3090000 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1511091620320 dot 18468 at digraph dot polyomino dot org dot uk> <5640F6EF dot 2060202 at redhat dot com>
On Mon, 9 Nov 2015, Florian Weimer wrote:
> On 11/09/2015 05:24 PM, Joseph Myers wrote:
> > On Mon, 9 Nov 2015, Florian Weimer wrote:
> >
> >> On 11/05/2015 01:49 AM, Joseph Myers wrote:
> >>> bits/math-finite.h declares -ffinite-math-only variants of various
> >>> functions under conditions not matching those under which the normal
> >>> versions are declared.
> >>
> >> Joseph,
> >>
> >> I may be seeing build failures related to this change, on armhfp (which
> >> is, I think, ARMv7 with hardware floating point). Specifically, this:
> >
> > I think this comes from -D_Mlong_double_=double in math-CPPFLAGS, in which
> > case undefining _Mlong_double_ in test-signgam-finite-c99.c ought to allow
> > the test to build OK
>
> I can confirm that the attached patch fixes the build issue on armhfp I
> was seeing. Thanks!
This patch is OK.
> I need some help with the commit message, though.
I don't think there is a simple explanation for the commit message. I
suspect the -D_Mlong_double_=double could in fact be removed as *only*
doing anything in the case where it breaks things (tests that undefine
_LIBC) - it was added by
Mon Jul 8 13:37:40 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* math/math.h (_Mfloat_, _Mlong_double_): New macros, defined iff not
already defined to float, long double. Use those macros for _Mdouble_
defns when including mathcalls.h.
* math/Makefile [$(long-double-fcts) != yes] (CPPFLAGS): Append
-D_Mlong_double_=double.
and may have been obsoleted by
1998-11-05 Ulrich Drepper <drepper@cygnus.com>
* math/math.h: Unconditionally include bits/mathdef.h. Declare
long double functions only if __NO_LONG_DOUBLE_MATH is not
defined.
* sysdeps/generic/bits/mathdef.h: Define only if __USE_ISOC9X.
Define __NO_LONG_DOUBLE_MATH.
* sysdeps/m68k/fpu/bits/mathdef.h: Define only if __USE_ISOC9X.
* sysdeps/i386/fpu/bits/mathdef.h: Likewise.
(after that, the long double functions shouldn't be prototyped at all when
building libm before they get defined as aliases for the double functions)
- but that would require further analysis to make sure.
--
Joseph S. Myers
joseph@codesourcery.com