[llvm-dev] ThinLTO and the C API

Peter Collingbourne via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 12 14:55:17 PDT 2017


Hi Paul,

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.

Mehdi was working on the new C API here: https://reviews.llvm.org/D31898
I'm not sure if he will have time to finish it, though.

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.
http://llvm-cs.pcc.me.uk/tools/clang/lib/Driver/ToolChains/Clang.cpp#2073

Peter

On Wed, Jul 12, 2017 at 2:29 PM, Robinson, Paul via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Our ThinLTO testing was inoperative for a while, and now that it's running
> again, we're seeing the linker step reporting "Expected a single module."
> Note that our linker is using the C API to read bitcode.
>
> It looks like the ThinLTO writer now emits two modules, but AFAICT most of
> the APIs in BitcodeReader.cpp expect to see only one.  Is this just an
> oversight in supporting ThinLTO from the C API?
>
> I am a little bemused because I had thought Apple's "ld64" also used the
> C API and supported ThinLTO.
>
> Any help/guidance/tips welcome (other than "switch to the C++ API").
> Thanks,
> --paulr
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>



-- 
-- 
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170712/c0f16c24/attachment.html>


More information about the llvm-dev mailing list