<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 2, 2016 at 8:52 AM, Carsten Mattner <span dir="ltr"><<a href="mailto:carstenmattner@gmail.com" target="_blank">carstenmattner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sun, Oct 2, 2016 at 5:45 PM, Xinliang David Li <<a href="mailto:xinliangli@gmail.com">xinliangli@gmail.com</a>> wrote:<br>
> bfd linker 2.26 works fine with LLVMgold.so.   As I mentioned in a previous<br>
> email, 2.26 ar and ranlib also works fine as long as LLVMgold.so is put in a<br>
> path binutils know about : $(bindir)/../lib/bfd-plugins/<br>
<br>
</span>I don't want to put a copy or symlink my user LLVMgold.so in<br>
the system owned /usr.<br>
<br>
My system has binutils 2.27.<br></blockquote><div><br></div><div>I meant 2.26 and above  so your bfd ld should work well with thinLTO. Note that clang driver will pass -plugin path option to the linker command line, so for linking step, you don't need to rely on having LLVMgold.so installed in your /usr location (which is unlike ar and ranlib for which -plugin option is not passed to them).</div><div><br></div><div>This just explains why thinLTO works without using gold linker.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
AFAIU, if I explicitly tell cmake to use llvm-ar/llvm-ranlib, then it will<br>
do the right thing for ThinLTO and make LLVMgold plugin will be<br>
used.<br></blockquote><div><br></div><div>Yes, that is fine too. </div><div><br></div><div>David</div></div><br></div></div>