<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - lld fails to find math symbols like __exp_finite under certain conditions"
   href="https://bugs.llvm.org/show_bug.cgi?id=45769">45769</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld fails to find math symbols like __exp_finite under certain conditions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>moritz@bunkus.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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@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@sweet-chili ~/tmp]



Interesting observations:

1. Compiling & linking works fine if I omit "-logg":

[0 mosu@sweet-chili ~/tmp] clang++ -fuse-ld=lld -o test test.cpp -lvorbis
[0 mosu@sweet-chili ~/tmp]

2. Compiling & linking works fine with GNU ld even with "-logg":

[0 mosu@sweet-chili ~/tmp] clang++ -o test test.cpp -lvorbis -logg
[0 mosu@sweet-chili ~/tmp]

3. Explicitly adding "-lm" on top of "-lvorbis -logg" does not change the
output; it fails the same way.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>