<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 can't handle gcc LTO files"
href="https://bugs.llvm.org/show_bug.cgi?id=42446">42446</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>lld can't handle gcc LTO files
</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>Linux
</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>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>bero@lindev.ch
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
</td>
</tr></table>
<p>
<div>
<pre>lld tends to works well with clang LTO files and gcc non-LTO files these days,
but can't it can't handle gcc LTO:
$ cat test.c
#include <stdio.h>
int main(int argc, char **argv) {
puts("test");
}
$ clang -fuse-ld=lld -flto test.c && echo good
good
$ gcc -fuse-ld=bfd -flto test.c && echo good
good
$ gcc -fuse-ld=lld test.c && echo good
good
$ gcc -fuse-ld=lld -flto test.c && echo good
ld.lld: error: undefined symbol: main
<span class="quote">>>> referenced by start.S:110 (../sysdeps/x86_64/start.S:110)
>>> /usr/lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/../../../../lib64/crt1.o:(_start)</span >
collect2: error: ld returned 1 exit status</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>