<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/85602>85602</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang LTO doesn't work for armv6 because ld64 doesn't recognize armv6k as armv6
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Un1q32
</td>
</tr>
</table>
<pre>
Linking a binary for armv6 with LTO normally gives this error
```
ld: warning: ignoring file /tmp/vi-1e7fe9.o, lto file was built for unknown bitcode architecture which is not the architecture being linked (armv6): /tmp/vi-1e7fe9.o
Undefined symbols for architecture armv6:
"_main", referenced from:
start in crt1.3.1.o
ld: symbol(s) not found for architecture armv6
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
however doing this can make it work:
disassemble the llvm object with `llvm-dis`
replace the line `target triple = "armv6k-apple-ios"` with `target triple = "armv6-apple-ios"`
rebuild the object with `llvm-as`
repeat for each object
link the objects with lto
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VE2PqzYU_TVmc5UIDCGwYDF9o6ye1E1nXRn7ArcYO7VN0vTXVzbMNG80g5AxcD_OOffIwnsaDWLHTr-x02sm1jBZ172Z4u-SZ71Vj-4nmZnMCAJ6MsI9YLAOhFtuNdwpTPDzj9_BWLcIrR8w0g09hIk8oHPWsfyV5S_7Wuf7nV61YuUL3IUzZMa4pdFYFzsNpBEYv4TlyvjlRocCzwO2R8v4D9DBbgF34aFfSYcEaDWzsXcDPQVpFYJwcqKAMqwO4T6RnIA8GBsgTJ_-9hibajIzKmC8SdwYbyOmL1Ek-G9G4UAGFfjH0lvtd12eCm-Fyp0-AOP8z0WQYZxHJg4HdGgkKhicXZ4C4-WDcAHIgHShOJbH4r3xptvWlPHGM94mXoNdjfoORMqUWmxKb6MpXzbSDqRdFhGTBWlU21jxHwqQpCyiKKtHONwgWPCIQOZmpQhkTdTpq-lu62TveEMHykaJky2kMLCIGYEC3K2bP2hvqyIvvMel15gmpfVtAdv_hTJsuFidx28HRf6jmcOrFnJPIIMxKAg3YoDg6BrdVL5G-ZMY80FcrxoPZH2cRJ1_FP4-53PKe99oQJX6foVR_AIRxWZVFHLaw_eJkpmfavitiA42U12p2rIVGXbFucjPZcubIpu6usITFk1TnbCpeYt1WXNZKdk3asCKnzPqeM6rvCya_MQLXhxl0bRFm8sz50pWeGZVjosgfYxAj9aNGXm_Ytec6pxnWvSo_fuh4LrEpl9Hz6pckw_-_7RAQWP3I1orHQXKojeMn7fpPh0WPUoRXaRVXT1FOZR2NPTv7tQZhN922ep0N4Vw9dEi_ML4ZaQwrf1R2oXxS0SwPw5XZ5Oc_JJYeMYvich_AQAA__-kNpHk">