<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 - llvm's handling of 'llvm.linker.options' is incompatible with how clang uses it and causes crashes when building on linux"
href="https://bugs.llvm.org/show_bug.cgi?id=39743">39743</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>llvm's handling of 'llvm.linker.options' is incompatible with how clang uses it and causes crashes when building on linux
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Common Code Generator Code
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>akyrtzi@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=21138" name="attach_21138" title="test files">attachment 21138</a> <a href="attachment.cgi?id=21138&action=edit" title="test files">[details]</a></span>
test files
Changes in r323783
(<a href="https://llvm.org/viewvc/llvm-project?view=revision&revision=323783">https://llvm.org/viewvc/llvm-project?view=revision&revision=323783</a>) introduced
handling of 'llvm.linker.options' to pass linker options on ELF but the
expected format is incompatible with how clang was already emitting
'llvm.linker.options' for module linker options per r305227
(<a href="https://llvm.org/viewvc/llvm-project?view=revision&revision=305227">https://llvm.org/viewvc/llvm-project?view=revision&revision=305227</a>).
The result is that clang crashes on linux when using '-fmodules' and a module
map uses auto-link.
To reproduce use the attached test files. When running clang on linux you'll
see this:
fatal error: error in backend: invalid llvm.linker.options
clang will emit this llvm IR:
!llvm.linker.options = !{!0}
!0 = !{!"-lsomelib"}
which will be rejected due to TargetLoweringObjectFileELF::emitModuleMetadata()
expecting a (key, value) pair instead.
This was tested using TOT llvm (r347143) and clang (r347141)</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>