<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 regression: LTO references unused compiler builtins symbols, raising binary libgcc requirements"
   href="https://bugs.llvm.org/show_bug.cgi?id=40045">40045</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld regression: LTO references unused compiler builtins symbols, raising binary libgcc requirements
          </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>All
          </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>alex@crichton.co
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org, peter@pcc.me.uk, ruiu@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hello! We've recently discovered a regression [1] in the downstream
rust-lang/rust project about how the rustc binary we're producing has a higher
binary version requirement than intended. We build in a super-old CentOS
container for a very low glibc (2.5) and libgcc binary requirement. When we
updated our build to use LLVM 7 to compile LLVM [2], however, we noticed that
our compiler required symbols like `__floatuntitf` with the symbol version
`GCC_4.3.0` which it didn't before. This in turn causes the compiler to be not
runnable on these old systems because libgcc doesn't have the symbols within.

Some bisection on our end has turned up [3] as the culprit. It looks like
that's injecting references to even unused symbols, which seems to be raising
our binary requirement. 

I've cc'd those on the diff for that, and I'm curious if y'all have thoughts on
this? Is it a bug in LLD that it's referencing these symbols in the final
binary when the binary itself doesn't need the symbols? Or is this a bug on our
end where we just shouldn't enable LTO (or more specifically, ThinLTO in our
case)


[1]: <a href="https://github.com/rust-lang/rust/issues/56849">https://github.com/rust-lang/rust/issues/56849</a>
[2]: <a href="https://github.com/rust-lang/rust/pull/55952">https://github.com/rust-lang/rust/pull/55952</a>
[3]: <a href="https://reviews.llvm.org/D50017">https://reviews.llvm.org/D50017</a></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>