More fun building uClibc++, or failing to.

David McCullough David_Mccullough at securecomputing.com
Mon Nov 3 05:51:29 UTC 2008


Jivin Rob Landley lays it down ...
> So I figured out that in order cross compile libsupc++ for the target, I need 
> to:
> 
> A) Add base c++ support to my cross compiler (--enable-languages=c,c++ and a 
> few more configure flags, but still just build all-gcc and install-gcc).
> B) Add CXX_FOR_TARGET="${ARCH}-g++"  to my list of target overrides for the 
> gcc ./configure.
> C) Apply the attached patch to fix a blatant won't cross compile stupidity in 
> the g++ 4.1.2 ./configure (and no, you can't work around it with a configure 
> cache, it's not _checking_ that).
> D) After building all-gcc and install-gcc for the target, then make 
> configure-target-libstdc++-v3
> E) cd into $ARCH-unknown-linux/libstdc++-v3 and "make" in there.
> F) cp .libs/libsuptc++.a out of there.
> 
> Simple, piece of cake.
> 
> Now the problem is that the uClibc++ build is breaking:
> 
> WRAPPER_INCLUDEDIR=-I../include ../bin/g++-uc  -Wall -Wno-trigraphs -pedantic   -ansi  -Os -fPIC -o 
> valarray.o -c valarray.cpp
> ../include/cmath: In function 'long double std::abs(long double)':
> ../include/cmath:130: error: 'fabsl' was not declared in this scope
> ../include/cmath: In function 'long double std::acos(long double)':
> ../include/cmath:133: error: 'acosl' was not declared in this scope
> ../include/cmath: In function 'long double std::asin(long double)':
> ../include/cmath:136: error: 'asinl' was not declared in this scope
> ../include/cmath: In function 'long double std::atan(long double)':
> 
> And rather a lot more.
> 
> The missing functions are:
> 
> fabsl, acosl, asinl, atanl, atan2l, ceill, cosl, coshl, expl, fabsl,
> floorl, frexp, frexpl, fmodl, ldexpl, logl, log10l, modfl,
> powl, sinl, sinhl, sqrtl, tanl, tanhl.
> 
> It #includes <math.h> but they're not in it.  The host version of cmath has 
> lots of __builtin_fabsl(__x); and such, dealing with gcc having this stuff 
> built in apparently?
> 
> I'm out of my depth.  Any ideas?

My builds .config has:

	# UCLIBCXX_HAS_LONG_DOUBLE is not set

I think that get's rid of the ones causing you problems if
you can handle losing that particular support that is. Haven't
needed it and have built a lot of mainstream apps.

Cheers,
Davidm

-- 
David McCullough,  david_mccullough at securecomputing.com,   Ph:+61 734352815
Secure Computing - SnapGear  http://www.uCdot.org   http://www.snapgear.com



More information about the uClibc mailing list