<div dir="ltr">Hi Paul,<div><br></div><div>The current C LTO API wraps a legacy C++ implementation of the LTO API, which does not support multi-module bitcode files, and we do not intend to teach it to do so. We planned to replace the old API with a new C API that wraps the new resolution-based C++ API, but that hasn't happened yet.</div><div><br></div><div>Mehdi was working on the new C API here: <a href="https://reviews.llvm.org/D31898" target="_blank">https://reviews.llvm.org/<wbr>D31898</a></div><div>I'm not sure if he will have time to finish it, though.</div><div><br></div><div>To deal with Apple's linker the clang driver passes a flag to the frontend on Darwin which prevents it from creating multi-module bitcode files.</div><div><a href="http://llvm-cs.pcc.me.uk/tools/clang/lib/Driver/ToolChains/Clang.cpp#2073" target="_blank">http://llvm-cs.pcc.me.uk/tools<wbr>/clang/lib/Driver/ToolChains/<wbr>Clang.cpp#2073</a><br></div><div><br></div><div>Peter</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 12, 2017 at 2:29 PM, Robinson, Paul via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Our ThinLTO testing was inoperative for a while, and now that it's running<br>
again, we're seeing the linker step reporting "Expected a single module."<br>
Note that our linker is using the C API to read bitcode.<br>
<br>
It looks like the ThinLTO writer now emits two modules, but AFAICT most of<br>
the APIs in BitcodeReader.cpp expect to see only one.  Is this just an<br>
oversight in supporting ThinLTO from the C API?<br>
<br>
I am a little bemused because I had thought Apple's "ld64" also used the<br>
C API and supported ThinLTO.<br>
<br>
Any help/guidance/tips welcome (other than "switch to the C++ API").<br>
Thanks,<br>
--paulr<br>
<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div>