<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 - Support COMDATs in ORC Core"
href="https://bugs.llvm.org/show_bug.cgi?id=45822">45822</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Support COMDATs in ORC Core
</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>All
</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>OrcJIT
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>lhames@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>1101.debian@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>From the llvm-dev mailing list thread "[llvm-dev] C++ JIT Compiler with LLVM on
Windows 10 - part 5":
"""
$"??_7exception@std@@6B@" = comdat largest
The JIT knows how to honor linkages, but it does not know about comdats yet
except in limited circumstances, so it sees these as conflicting definitions.
Adding support for comdats will be non-trivial as their selection rules are
more complex than the selection rules for linkage types.
"""
Actually it's worse than I thought: The IR model for COMDATs (see [1]) isn't
quite the same as the COFF model for COMDATs (see [2]), but we would need
something that can encapsulate both. I *think* COFF COMDATs are the most
general and could cover IR COMDATs, but we should check this with a COFF
expert.
Whatever model we settle on, I think we would need to implement it by
generalizing SymbolFlagsMap as this is our current vehicle for describing
MaterializationUnit interfaces to ORC Core. Once we can describe COMDAT symbols
the JITDylib::defineImpl method can be updated to apply COMDAT selection
criteria to choose which definitions are kept and which are discarded for any
given MaterializationUnit.
[1] <a href="https://llvm.org/docs/LangRef.html#comdats">https://llvm.org/docs/LangRef.html#comdats</a>
[2]
<a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only">https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only</a></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>