[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Inconsistent definition of _GLIBCXX_USE_C99 across arches



Hi,

This appears to inherit somewhere deep. libstdc++ disables ISO C99
compatability due comlex.h missing the "long double" versions of
complex functions[1][2]. With a little bit of preprocessor debugging,
this is because of __NO_LONG_DOUBLE_MATH being set, atleast on arm/armel.

Which, in turn comes from bits/mathdef.h

#ifndef __NO_LONG_DOUBLE_MATH
/* Signal that we do not really have a `long double'.  This disables the
   declaration of all the `long double' function variants.  */
# define __NO_LONG_DOUBLE_MATH  1
#endif

but long double variants _are_ a C99 requirement, and therefor this
would appear to be a bug in glibc.

[1] Looking at the configure for libstdc++:

checking for ISO C99 support in <math.h>... yes
checking complex.h usability... yes
checking complex.h presence... yes
checking for complex.h... yes
checking for ISO C99 support in <complex.h>... no
checking for ISO C99 support in <stdio.h>... yes
checking for ISO C99 support in <stdlib.h>... yes
checking for ISO C99 support in <wchar.h>... yes
checking for fully enabled ISO C99 support... no

[2] Looking at closer from the matching config.log:

configure:7435: checking for ISO C99 support in <complex.h>
configure:7492:  /build/buildd/gcc-4.2-4.2.2/build/./gcc/xgcc -shared-libgcc -B/build/buildd/gcc-4.2-4.2.2/build/./g
cc -nostdinc++ -L/build/buildd/gcc-4.2-4.2.2/build/arm-linux-gnueabi/libstdc++-v3/src -L/build/buildd/gcc-4.2-4.2.2/
build/arm-linux-gnueabi/libstdc++-v3/src/.libs -B/usr/arm-linux-gnueabi/bin/ -B/usr/arm-linux-gnueabi/lib/ -isystem
/usr/arm-linux-gnueabi/include -isystem /usr/arm-linux-gnueabi/sys-include -c -g -O2  -D_GNU_SOURCE  conftest.cc >&5
conftest.cc: In function 'int main()':
conftest.cc:66: error: 'cabsl' was not declared in this scope
conftest.cc:67: error: 'cargl' was not declared in this scope
conftest.cc:68: error: 'ccosl' was not declared in this scope
conftest.cc:69: error: 'ccoshl' was not declared in this scope
conftest.cc:70: error: 'cexpl' was not declared in this scope
conftest.cc:71: error: 'clogl' was not declared in this scope
conftest.cc:72: error: 'csinl' was not declared in this scope
conftest.cc:73: error: 'csinhl' was not declared in this scope
conftest.cc:74: error: 'csqrtl' was not declared in this scope
conftest.cc:76: error: 'ctanl' was not declared in this scope
conftest.cc:76: error: 'ctanhl' was not declared in this scope
conftest.cc:77: error: 'cpowl' was not declared in this scope
configure:7498: $? = 1
configure: failed program was:
| /* confdefs.h.  */
...
| #include <complex.h>
| int
| main ()
| {
| typedef __complex__ float float_type; float_type tmpf;
|                   cabsf(tmpf);
|                   cargf(tmpf);
|                   ccosf(tmpf);
|                   ccoshf(tmpf);
|                   cexpf(tmpf);
|                   clogf(tmpf);
|                   csinf(tmpf);
|                   csinhf(tmpf);
|                   csqrtf(tmpf);
|                   ctanf(tmpf);
|                   ctanhf(tmpf);
|                   cpowf(tmpf, tmpf);
|                   typedef __complex__ double double_type; double_type tmpd;
|                   cabs(tmpd);
|                   carg(tmpd);
|                   ccos(tmpd);
|                   ccosh(tmpd);
|                   cexp(tmpd);
|                   clog(tmpd);
|                   csin(tmpd);
|                   csinh(tmpd);
|                   csqrt(tmpd);
|                   ctan(tmpd);
|                   ctanh(tmpd);
|                   cpow(tmpd, tmpd);
|                   typedef __complex__ long double ld_type; ld_type tmpld;
|                   cabsl(tmpld);
|                   cargl(tmpld);
|                   ccosl(tmpld);
|                   ccoshl(tmpld);
|                   cexpl(tmpld);
|                   clogl(tmpld);
|                   csinl(tmpld);
|                   csinhl(tmpld);
|                   csqrtl(tmpld);
|                   ctanl(tmpld);
|                   ctanhl(tmpld);
|                   cpowl(tmpld, tmpld);
|
|   ;
|   return 0;
| }



-- 
"rm -rf" only sounds scary if you don't have backups



Reply to: