[Patch] Fix libstdc++ build when using uclibc instead of glibc

Jonathan Wakely jwakely@redhat.com
Thu Jan 7 21:51:00 GMT 2016


On 07/01/16 13:37 -0800, Steve Ellcey wrote:
>On Thu, 2016-01-07 at 20:56 +0100, Bernhard Reutner-Fischer wrote:
>> On January 7, 2016 12:23:49 PM GMT+01:00, Jonathan Wakely <jwakely@redhat.com> wrote:
>> >On 07/01/16 07:28 +0100, Marc Glisse wrote:
>> >>On Wed, 6 Jan 2016, Jonathan Wakely wrote:
>> >>
>> >>>On 06/01/16 12:45 -0800, Steve Ellcey wrote:
>> >>>>On Wed, 2016-01-06 at 20:34 +0000, Jonathan Wakely wrote:
>> >>>>>On 05/01/16 14:43 -0800, Steve Ellcey  wrote:
>> >>>>>>While trying to build GCC with uclibc instead of glibc I ran into
>> >a build
>> >>>>>>failure in libstdc++.  uclibc doesn't seem to provide the
>> >>>>>isfinite function
>>
>> uClibc provides an infinite macro. Make sure to enable C99 math though.

(You mean isfinite, not infinite, right? C99 doesn't define an "infinite"
macro.)

>> OK?
>>
>> TIA,
>
>But is there any reason to use the infinite macro instead of the
>__builtin_isfinite function?  I think that if I used the infinite macro

The isfinite macro doesn't exist in C++, if the C library defines it
we #undef it in <cmath>, because the C++ standard requires those C99
math functions to be real functions, not macros. So that's a good
reason to use the builtin :-)

(Currently if you #include <math.h> instead of <cmath> then you get
the macro, because <math.h> comes from the C library, but I'm in the
process of fixing that so the C++ library will provide its own
<math.h> wrapper that does the #undef.)

>I would also have to check for NAN since NAN is neither finite nor
>infinite.  Here is what I tested last night with no failures.  Is this
>version OK to checkin?

Yes, this is OK, thanks.



More information about the Libstdc++ mailing list