[Bug libstdc++/39491] [4.4/4.5 regression] symbol __signbitl@GLIBCXX_3.4 in libstdc++ not exported anymore

dave at hiauly1 dot hia dot nrc dot ca gcc-bugzilla@gcc.gnu.org
Tue Apr 21 17:28:00 GMT 2009



------- Comment #9 from dave at hiauly1 dot hia dot nrc dot ca  2009-04-21 17:28 -------
Subject: Re:  [4.4/4.5 regression] symbol __signbitl@GLIBCXX_3.4 in libstdc++
not exported anymore

> > I believe the problem is the symbol was exported when it shouldn't have been.
> 
> How?

This is probably because __signbitl is not present in libc and libm.
hppa-linux doesn't need __signbitl because sizeof(long double)==sizeof(double).
"l" library functions just call __signbit.  Thus, I believe that the lack
of __signbitl in glibc caused this preoblem.

__signbitl doesn't seem to be required by POSIX.  However, LSB 2.1
specifies it.  If __signbitl should be provided by glibc, then this
is a glibc bug.

The signbit macro is as follows:

/* Return nonzero value if sign of X is negative.  */
# ifdef __NO_LONG_DOUBLE_MATH
#  define signbit(x) \
     (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x))
# else
#  define signbit(x) \
     (sizeof (x) == sizeof (float)                                            \
      ? __signbitf (x)                                                        \
      : sizeof (x) == sizeof (double)                                         \
      ? __signbit (x) : __signbitl (x))
# endif

This will fail if the call to __signbitl isn't optimized away.  So, either
the macro needs to be fixed, or __signbitl needs to be provided by glibc.

The isfinite macro would have the same problem, but in that case
glibc provides __finitel.

> > The signbit macro is provided by math.h.
> 
> But it's not in the baseline files showing that it is exported. This question
> was originally asked here:
> 
> http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00197.html

Why should a macro be exported?

Dave


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39491



More information about the Gcc-bugs mailing list