Finite math, fftw3, lld and Arch Linux

Jean-Michaël Celerier jeanmichael.celerier@gmail.com
Wed May 13 08:11:06 GMT 2020


Hello,
regarding the issues mentioned in the "Math changes in glibc 2.31" thread (
https://sourceware.org/pipermail/libc-alpha/2020-May/113835.html)

I am getting a related issue on Arch Linux with FFTW. But ! FFTW does link
against -lm explicitly.

$ lddtree /usr/lib/libfftw3.so
/usr/lib/libfftw3.so (interpreter => None)
    libm.so.6 => /usr/lib/libm.so.6
        ld-linux-x86-64.so.2 => /usr/lib/ld-linux-x86-64.so.2
    libc.so.6 => /usr/lib/libc.so.6

$ readelf -dW /usr/lib64/libfftw3.so
Dynamic section at offset 0x2445d0 contains 24 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000e (SONAME)             Library soname: [libfftw3.so.3]

$ objdump -T /usr/lib64/libfftw3.so | grep finite
0000000000000000      DF *UND* 0000000000000000  GLIBC_2.15  __log_finite


In particular, the following fails :
$ echo 'int main() { }' > foo.cpp
$ clang++ foo.cpp -lfftw3 -fuse-ld=lld -lm
ld.lld: error:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../lib64/libfftw3.so:
undefined reference to __log_finite

What would be the correct solution in that case ? Since everything seems to
link against -lm...


Kind regards,
Jean-Michaël


More information about the Libc-alpha mailing list