All of lore.kernel.org
 help / color / mirror / Atom feed
* g++ lib problem
@ 2009-03-12  9:52 Frans Meulenbroeks
  2009-03-12 17:37 ` Khem Raj
  0 siblings, 1 reply; 7+ messages in thread
From: Frans Meulenbroeks @ 2009-03-12  9:52 UTC (permalink / raw)
  To: openembedded-devel

Hi,

I was trying to port a program that used asinl etc. but apparently
asinl is not in our env.
However if I look at
~/oe/tmp/staging/armv7a-angstrom-linux-gnueabi/usr/include/c++/cmath I
see around line 123

  inline long double
  asin(long double __x)
  { return __builtin_asinl(__x); }

questions:
shouldn't this have been a double asin? (probably not too important as
the result will be casted)
and if asin is long double, then why is there no asinl?
normally it is

double asin(double x);
long double asinl(long double x);

guess this is something in the way our libs are generated, but I could
not find the proper way to fix it.

Anyone a suggestion?

Frans.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g++ lib problem
  2009-03-12  9:52 g++ lib problem Frans Meulenbroeks
@ 2009-03-12 17:37 ` Khem Raj
  2009-03-12 20:34   ` Frans Meulenbroeks
  0 siblings, 1 reply; 7+ messages in thread
From: Khem Raj @ 2009-03-12 17:37 UTC (permalink / raw)
  To: openembedded-devel

On Thu, Mar 12, 2009 at 2:52 AM, Frans Meulenbroeks
<fransmeulenbroeks@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 ?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g++ lib problem
  2009-03-12 17:37 ` Khem Raj
@ 2009-03-12 20:34   ` Frans Meulenbroeks
  2009-03-12 21:58     ` Khem Raj
  0 siblings, 1 reply; 7+ messages in thread
From: Frans Meulenbroeks @ 2009-03-12 20:34 UTC (permalink / raw)
  To: openembedded-devel

2009/3/12 Khem Raj <raj.khem@gmail.com>:
> On Thu, Mar 12, 2009 at 2:52 AM, Frans Meulenbroeks
> <fransmeulenbroeks@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).

Frans.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g++ lib problem
  2009-03-12 20:34   ` Frans Meulenbroeks
@ 2009-03-12 21:58     ` Khem Raj
  2009-03-13 15:15       ` Frans Meulenbroeks
  0 siblings, 1 reply; 7+ messages in thread
From: Khem Raj @ 2009-03-12 21:58 UTC (permalink / raw)
  To: openembedded-devel

On Thu, Mar 12, 2009 at 1:34 PM, Frans Meulenbroeks
<fransmeulenbroeks@gmail.com> wrote:
> 2009/3/12 Khem Raj <raj.khem@gmail.com>:
>> On Thu, Mar 12, 2009 at 2:52 AM, Frans Meulenbroeks
>> <fransmeulenbroeks@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@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g++ lib problem
  2009-03-12 21:58     ` Khem Raj
@ 2009-03-13 15:15       ` Frans Meulenbroeks
  2009-03-13 17:40         ` Khem Raj
  0 siblings, 1 reply; 7+ messages in thread
From: Frans Meulenbroeks @ 2009-03-13 15:15 UTC (permalink / raw)
  To: openembedded-devel

2009/3/12 Khem Raj <raj.khem@gmail.com>:
[...]
>
> 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
[...]

Khem,

Thanks for the explanation.
Should we change the glibc package to resolve this?

Frans



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g++ lib problem
  2009-03-13 15:15       ` Frans Meulenbroeks
@ 2009-03-13 17:40         ` Khem Raj
  2009-03-14 11:00           ` Frans Meulenbroeks
  0 siblings, 1 reply; 7+ messages in thread
From: Khem Raj @ 2009-03-13 17:40 UTC (permalink / raw)
  To: openembedded-devel

On Fri, Mar 13, 2009 at 8:15 AM, Frans Meulenbroeks
<fransmeulenbroeks@gmail.com> wrote:
> 2009/3/12 Khem Raj <raj.khem@gmail.com>:
> [...]
>>
>> 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
> [...]
>
> Khem,
>
> Thanks for the explanation.
> Should we change the glibc package to resolve this?
>

hmmm IMO I think you should fix the application to not ask for long
double functions on platforms where long double is
not different than double and fixing glibc could be ok too. Care for a patch :)
> Frans
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: g++ lib problem
  2009-03-13 17:40         ` Khem Raj
@ 2009-03-14 11:00           ` Frans Meulenbroeks
  0 siblings, 0 replies; 7+ messages in thread
From: Frans Meulenbroeks @ 2009-03-14 11:00 UTC (permalink / raw)
  To: openembedded-devel

True but why not add long double function prototypes to glibc as we have them.
Might save someone some headache later on.

For my specific problem:
In the package I added a patch for this, and I raised the issue with
the author of the sw who informed me that the long double accuracy was
not really needed, so guess the problem will be gone in the next
release anyway.

Frans

2009/3/13 Khem Raj <raj.khem@gmail.com>:
> On Fri, Mar 13, 2009 at 8:15 AM, Frans Meulenbroeks
> <fransmeulenbroeks@gmail.com> wrote:
>> 2009/3/12 Khem Raj <raj.khem@gmail.com>:
>> [...]
>>>
>>> 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
>> [...]
>>
>> Khem,
>>
>> Thanks for the explanation.
>> Should we change the glibc package to resolve this?
>>
>
> hmmm IMO I think you should fix the application to not ask for long
> double functions on platforms where long double is
> not different than double and fixing glibc could be ok too. Care for a patch :)
>> Frans
>>
>> _______________________________________________
>> Openembedded-devel mailing list
>> Openembedded-devel@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-03-14 11:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12  9:52 g++ lib problem Frans Meulenbroeks
2009-03-12 17:37 ` Khem Raj
2009-03-12 20:34   ` Frans Meulenbroeks
2009-03-12 21:58     ` Khem Raj
2009-03-13 15:15       ` Frans Meulenbroeks
2009-03-13 17:40         ` Khem Raj
2009-03-14 11:00           ` Frans Meulenbroeks

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.