Re: clang+libc++ using missing powl

From: David Chisnall <theraven_at_FreeBSD.org>
Date: Thu, 5 Sep 2013 08:49:51 +0100
On 5 Sep 2013, at 08:14, Baptiste Daroussin <bapt_at_freebsd.org> wrote:

> On Thu, Sep 05, 2013 at 09:05:45AM +0200, Dimitry Andric wrote:
>> On Sep 5, 2013, at 00:38, Baptiste Daroussin <bapt_at_freebsd.org> wrote:
>>> I'm running exp-run to build the whole ports tree with clang using libc++ by
>>> default.
>>> 
>>> As a result we have a lot of fallouts of ports complaining about:
>>> undefined reference to `powl'
>>> 
>>> It seems like libc++ is relying on a function we don't have yet in libm, am I
>>> missing something?
>> 
>> 
>> Do you have a concrete example of a port that gives this result?  We do
>> have powl these days, but maybe some configure script is trying to be
>> smart and does not pass -lm to the linker flags...
>> 
>> -Dimitry
>> 
> 
> http://pb2.nyi.freebsd.org/bulk/nogcc-default/2013-09-04_18h36m06s/logs/errors/domc-0.8.0_1.log

This one doesn't seem to be complaining about powl(), it's a missing -fPIC when building objects that will be linked into a shared object.

> I tried adding -lm to the linker and it failed, when was powl added?

It hasn't been:

https://wiki.freebsd.org/Numerics?highlight=%28powl%29

We are exposing it in math.h though, which is somewhat unfortunate.  We should probably tweak cmath.h to not expose it, or we'll get things trying to use it and then failing to link.

> Here is another example:
> http://pb2.nyi.freebsd.org/bulk/nogcc-default/2013-09-04_18h36m06s/logs/errors/iverilog-0.9.6.log

This is a real example.  Is it actually using powl(), or is it just using std::pow()?  I think if we just comment out the long long version of std::pow() then it should silently fall back to the lower-precision version.  Can you try that?  

David
Received on Thu Sep 05 2013 - 05:50:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:41 UTC