<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 crashes when linking libcryptopp with -O2 -flto"
   href="https://bugs.llvm.org/show_bug.cgi?id=50646">50646</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLD crashes when linking libcryptopp with -O2 -flto
          </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>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>ELF
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>krzpyrkosz@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24934" name="attach_24934" title="Build log">attachment 24934</a> <a href="attachment.cgi?id=24934&action=edit" title="Build log">[details]</a></span>
Build log

Hello, building the library with -O2 and -flto causes the lld to crash. Using
exclusively either -O2 or -flto works just well. I remember that I ran into
this problem a couple of months ago already using older lld too.

Source:
<a href="https://github.com/weidai11/cryptopp">https://github.com/weidai11/cryptopp</a>

Evironment:
$ clang --version
clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
9b92ae01ee57e332e52d14c073fa3235498a9f2c)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

$ uname -a
Linux vps 5.4.0-74-generic #83-Ubuntu SMP Sat May 8 02:35:39 UTC 2021 x86_64
x86_64 x86_64 GNU/Linux

Build commands:
CFLAGS='-O2 -flto' CXXFLAGS='-O2 -flto' LDFLAGS='-flto' CC=clang CXX=clang++
make shared 2>&1 | tee buildlog_O2_flto

Buildlog is attached</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>