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

    <tr>
        <th>Summary</th>
        <td>
            lld crash while linking certain files with (thin)LTO: linking module flags 'override-stack-alignment': IDs have conflicting values
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    While upgrading our toolchain from 11.x to 15.0.7, I ran into a crash in lld. Immediately before the crash, this error is displayed:

```
LLVM ERROR: Function Import: link error: linking module flags 'override-stack-alignment': IDs have conflicting values in '/home/tamas/.conan_plex/.conan/data/x264/161-1086f45-26/plex/stable/package/3657df0fb8418322c0d0e70c61c2a8e673a57092/lib/libx264.a(api.o at 291080)' and 'libavcodec/libx264.o-libx264_encoder.o'
```

Everything is built with the same toolchain (although not necessarily same flags - I'm still digging). The printed stacktrace is the following: https://gist.github.com/sztomi/88bbdaaad52ce325418216b6aee83c7e 

The minimal invocation (apart from -v) that reproduces the crash is this:

```
ld.lld -v  -shared libx264.o-libx264_encoder.o -L. -lx264 
```

I don't know how to minimize the input files, so I'm uploading them here in case they are useful: https://drive.google.com/file/d/1KOuPYxJzjFCeHQHudWg9zNJ9j6zOoCx2/view?usp=share_link

I've built a debug version of lld and reproduced the crash and got a core dump. This is the unpacked apport output that was collected during the crash, so there are a couple of additional files that may be useful: https://drive.google.com/file/d/1Cu0pUE82ceTqzWkIggtaVAqmjKi-gdXP/view?usp=share_link

I realize this report is a bit incomplete / hard to repro with just depending on these files so any advice on what information I can collect would be appreciated.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1VU1v2zgQ_TX2hbAgUZZkH3zoJjXqNrtpg26zewpGIiUxoUSVpOwkv34fJafNfqBYLLCALVLikDPz3pthacTT7rZVWrJxaCwJ1TfMjJZ5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