<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/124516>124516</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Unknown symbols with LTO, lld64 on macOS - hard to reproduce.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lld:MachO,
            platform:macos,
            LTO
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          tru
      </td>
    </tr>
</table>

<pre>
    Hello,

We switched our builds to lld64 and it has been working fine for the most part. Recently we turned on LTO on more configurations and while it works most of the time, some of the CI builds error out with missing symbols that looks odd:

```
ld64.lld: error: undefined symbol: _.str.14.llvm.16174693150110290213
```

There are other missing symbols as well, they seem to be more "normal" symbols (but I don't want to share the full error because of the nature of the application, I can share it privately to someone willing to help).

The .str.14.llvm symbols seem to be some kind of special symbol - maybe autogenerated by LLVM?
I have never been able to reproduce this locally, it only happens 2 out 10 times in the CI. Which also makes it hard to get a reproducer out of it since our builds are very large. The same build works fine on Windows and other platforms.

I found this issue : https://github.com/llvm/llvm-project/issues/57864 - which looks somewhat similar except that I don't see any of the `\1` symbols described in that post.

We are on LLVM 18.1.8 - and while I can upgrade to latest to test, I can't deploy that so I would like to find a more targetted fix for this.

Any ideas? @int3 @keith 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVV2vozYQ_TXOy-giMAGSBx7Su4oa6a5Warfdx2qwh-DG2Mg2Yfn3lYHLvWrfKkVy4o8zM2fOmaD36m6Ialb8woovBxxDZ10d3HhorJzrX0lry_grSy8svfwg8JMKoiMJdnTQjEpLD8GC1rI8AhoJKkCHHhoiA5N1D2Xu0CpD0FoHoSPorQ8woAsJ_EaCTNAzTARhdCbCGnj7_i0uvXUEwppW3UeHQVnjlwBTpzTFMBHdr3C2XaCD6onxV_C2p_e919t7muScdWDHAJMKHfTK-5icn_vGag-hwwDa2ocHKy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