[PATCH] Always add LLVMgold.so plugin if it's present in the standard location

Tom Roeder tmroeder at google.com
Tue Feb 18 11:25:56 PST 2014

The attached patch changes the behavior of the driver to always add
LLVMgold.so if it can find it in ../lib/LLVMgold.so. This is the
location it was already using if the -flto flag was passed.

The goal here is to make it easier to apply -flto in large codebases
containing multiple projects. E.g., when I was working on building
Chromium with LTO, one of the problems I encountered is that some
projects would end up depending on files that had been built as
bitcode. And these projects then needed to be modified to add -flto so
they could use the bitcode files. It seems natural, at least to me,
that clang should be able to handle .o or .a files that are bitcode
without requiring -flto explicitly.

This is my first patch sent to cfe-commits, and I don't know the clang
part of the codebase as well as the LLVM bits, so please let me know
if I'm missing something here. I thought it was going to be more
complicated to change this behavior, and I find it hard to believe
that it's quite as simple as this patch makes it seem.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: autogold.patch
Type: text/x-patch
Size: 2426 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140218/e9665815/attachment.bin>

More information about the cfe-commits mailing list