This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cmath call builtin sqrtf but many platforms seem miss that(was Re: lrint lrintf problems )
- From: Gunther Nikl <gni at gecko dot de>
- To: gcc at gcc dot gnu dot org
- Cc: Bernd Roesch <nospamname at web dot de>
- Date: Fri, 27 Mar 2009 20:34:36 +0100
- Subject: Re: cmath call builtin sqrtf but many platforms seem miss that(was Re: lrint lrintf problems )
- References: <yam11403.113.281338832@mail.gmx.net>
Bernd Roesch schrieb:
without changed headers old ompiler and libs do not work, because for C
there is no
sqrtf and other C99 funcs and many C++ programs get also many errors.
Ok, you are trying to add C99 functions to your libc. Apparently you
made a mistake if you get linker errors.
i see old libstdc++ contain sqrtf but get many other linker errors.
What is an "old libstdc++"? AFAICT there was/is no sqrtf function in
libstdc++. In the sqrt case there are inline wrapper functions with
either a float or a double arg. These inlines use an appropriate sqrt
builtin. Since these builtins do not exist for your target the compiler
generates a call to the real function without the __builtin prefix.
there is also a sqrtf not undef in cmath as many other functions are.
When i define sqrtf in math.h then the sqrtf func in libstdc++ is maybe not
add and this strange linker error come.but wy it work not correct when i
add sqrtf to libc i dont know.only solution below work.
libstdc++ _requires_ real functions to be present in your libc. If you
get linker errors then the linker cannot locate functions. There really
is no need to play #define games on __builtin names to get it work.
Gunther