[llvm-bugs] [Bug 45769] New: lld fails to find math symbols like __exp_finite under certain conditions
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri May 1 00:57:38 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=45769
Bug ID: 45769
Summary: lld fails to find math symbols like __exp_finite under
certain conditions
Product: lld
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedbugs at nondot.org
Reporter: moritz at bunkus.org
CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com
My OS & clang version: clang & lld 10.0.0 on Arch Linux (fully updated system
as of 2020-05-01 09:00 CEST); clang & lld are Arch Linux's packages
This is similar to #45034. Here's how to reproduce:
1. Install the Ogg & Vorbis libraries
2. Create the following short test.cpp file:
#include <vorbis/codec.h>
int main(int argc,char **argv)
{
vorbis_info m_vi;
vorbis_info_init(&m_vi);
return 0;
}
3. Try to compile & link with lld & observe errors:
[0 mosu at sweet-chili ~/tmp] clang++ -fuse-ld=lld -o test test.cpp -lvorbis -logg
ld.lld: error:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libvorbis.so:
undefined reference to __acosf_finite
ld.lld: error:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libvorbis.so:
undefined reference to __exp_finite
ld.lld: error:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libvorbis.so:
undefined reference to __pow_finite
ld.lld: error:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libvorbis.so:
undefined reference to __log_finite
clang-10: error: linker command failed with exit code 1 (use -v to see
invocation)
[1 mosu at sweet-chili ~/tmp]
Interesting observations:
1. Compiling & linking works fine if I omit "-logg":
[0 mosu at sweet-chili ~/tmp] clang++ -fuse-ld=lld -o test test.cpp -lvorbis
[0 mosu at sweet-chili ~/tmp]
2. Compiling & linking works fine with GNU ld even with "-logg":
[0 mosu at sweet-chili ~/tmp] clang++ -o test test.cpp -lvorbis -logg
[0 mosu at sweet-chili ~/tmp]
3. Explicitly adding "-lm" on top of "-lvorbis -logg" does not change the
output; it fails the same way.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200501/81a68eb9/attachment.html>
More information about the llvm-bugs
mailing list