This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Work around conflicting declarations of math functions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]