[oe] g++ lib problem

Khem Raj raj.khem at gmail.com
Thu Mar 12 21:58:00 UTC 2009


On Thu, Mar 12, 2009 at 1:34 PM, Frans Meulenbroeks
<fransmeulenbroeks at gmail.com> wrote:
> 2009/3/12 Khem Raj <raj.khem at gmail.com>:
>> On Thu, Mar 12, 2009 at 2:52 AM, Frans Meulenbroeks
>> <fransmeulenbroeks at gmail.com> wrote:
>>> Hi,
>>>
>>> I was trying to port a program that used asinl etc. but apparently
>>> asinl is not in our env.
>>
>> Did you link with -lm ?
>>
> It didn't get that far. the compiler already complains about asinl not found.
> On opensuse this compiles ok. Apparently when generating the c++ lib
> or header it is decided that the function is not there, although the
> header file links asin to __builtin__asinl or something like that).
>

I see it gets it from libm but g++ specifiies -lm for you where as gcc
does not. I think the problem is that ARM have same precision for
double and long double so glibc defines __NO_LONG_DOUBLE_MATH for ARM
as a result the prototypes for the *l functions are not emitted into
math.h. Although in glibc they are aliases for the corresponding
double functions I dont know why they are not exported in math.h too.
may be they want to make it difficult for people to use them on
platforms where they are not really different then double
counterparts.

So if you use gcc -lm it works because gcc does not barf on missing
prototypes but it wont compile with g++ because g++ does not find the
prototype for asinl in math.h and gives error.

> Frans.
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>




More information about the Openembedded-devel mailing list