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

    <tr>
        <th>Summary</th>
        <td>
            "Not an int attribute" error when linking objects built by clang-15 with lld-14 and LTO
        </td>
    </tr>

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

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

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

<pre>
    I am using Clang 15.0.1 and lld 14.0.6

An empty source
```cpp
int main() {
    return 0;
}
```
compiled naively produces
```
$ clang++-15 --ld-path=/usr/bin/ld.lld-14 -flto=thin main.cpp -o main.o
ld.lld-14: error: /tmp/main-b7a9b4.o: Opaque pointers are only supported in -opaque-pointers mode (Producer: 'LLVM15.0.1' Reader: 'LLVM 14.0.6')
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

Adding `-Xclang -no-opaque-pointers` leads to following error
```
$ clang++-15 --ld-path=/usr/bin/ld.lld-14 -flto=thin -Xclang -no-opaque-pointers main.cpp -o main.o
ld.lld-14: error: /tmp/main-2d1e49.o: Not an int attribute (Producer: 'LLVM15.0.1' Reader: 'LLVM 14.0.6')
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

Do I use it wrong? Is it a bug or linking LTO modules is not supported when using different major versions of clang and lld?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzVVE1v2zAM_TXyhbDhb8cHH9oFAQp06zAMw66yRSfqFMuT5GT996OspN2KYpdhhwWGYokU-fgezV6Lp-4O-BEWK6c9vFOc1qxK0iQDPglQSkBW0rZm6ZalN2G9mQCPs3sCqxcz4MVUp-EZ5jmcyMnBkcuJ5RuWt8Ca23AO9DPoFjNByorLIWu2r-KE7aCPs1QoYOLyhOoJZqPFMqB905vlJQy-CJbf0hNnFcSxEvHM3YEVW5bvFmto7T2qnRIJFRhnJcSjcpoc3EFOK-aEqoBYh3cdgj-7s-IG0Bht_AvFcceZVu8a9w1v-5JukOVh5t8XhFkTEWgscIOgJyrBLvOsjaOiKFusV7f42e2oBVLUzcdQ6CVJc3__5X1QhjbwCbn4zXSVKW-I6wt1KxG_YlVy-oYGiNOjV3fkK7Nn6Q6AP6QjA6XOfPLFIsQncBosIsE86YE7qafn4K-JD40hhG8jOo2_rtkhnvTrAskKiuBbH33USumzvxRA_jNR_wDorwTPRYZlGwT_oB19NeD7njtnZL-4_1XJrYY78Fcp1tlon30Hd9ZvOfTLHrRZMXjl7j8_-KZdFJLdwkQsvHT4-YDTZboIOY5ocJ0Kj3T_RNwTEAt6DPpeRw7lirDL6rqomk2T5ZHoCtEWLY-cdAo7ludvUU3HgaCQ9ApP9484OEuopXLQP4VcvotWui7N4lNTIdFiVHdwbrbEMmlMz568lj4hqn13qdP1L6ZJ5CPTVlq70ETKd4Q3a6JDV9c4tMNYFpuhKXiLNBXStq96xLEZaiEixXtUtmPVLau2kezyNM_TNiOvLKvypM7aHrOqF2KzGXnJWZkitZtKfOJEm31kuhUDSWHJqKR19sXIrZX7CfEany_uoE13kkR-tILtVqQ_AYwN2Dw">