bfd linker 2.26 works fine with LLVMgold.so. As I mentioned in a previous email, 2.26 ar and ranlib also works fine as long as LLVMgold.so is put in a path binutils know about : $(bindir)/../lib/bfd-plugins/ David On Sun, Oct 2, 2016 at 3:59 AM, Carsten Mattner <carstenmattner at gmail.com> wrote:> On Sun, Oct 2, 2016 at 6:52 AM, Teresa Johnson <tejohnson at google.com> > wrote: > > > But something is odd then - if the builds aren't using gold then I don't > > see how ThinLTO could have been kicking in? > > I'm not an expert on LLVM's build process, but it's important to note that > the > failure was immediately upon trying to run cmake with the extended LDFLAGS, > which now includes the extra flags to enable more pruning. > > My understaning was that ld.gold is required for the plugin to do ThinLTO, > and given my observation before/after enabling llvm-ar/llvm-ranlib to make > LTO work, and how long the ld processes took for executables and DSOs, > I'm under the impression that ld.gold was actually used. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161002/bbda371e/attachment.html>
On Sun, Oct 2, 2016 at 5:45 PM, Xinliang David Li <xinliangli at gmail.com> wrote:> bfd linker 2.26 works fine with LLVMgold.so. As I mentioned in a previous > email, 2.26 ar and ranlib also works fine as long as LLVMgold.so is put in a > path binutils know about : $(bindir)/../lib/bfd-plugins/I don't want to put a copy or symlink my user LLVMgold.so in the system owned /usr. My system has binutils 2.27. AFAIU, if I explicitly tell cmake to use llvm-ar/llvm-ranlib, then it will do the right thing for ThinLTO and make LLVMgold plugin will be used.
On Sun, Oct 2, 2016 at 8:52 AM, Carsten Mattner <carstenmattner at gmail.com> wrote:> On Sun, Oct 2, 2016 at 5:45 PM, Xinliang David Li <xinliangli at gmail.com> > wrote: > > bfd linker 2.26 works fine with LLVMgold.so. As I mentioned in a > previous > > email, 2.26 ar and ranlib also works fine as long as LLVMgold.so is put > in a > > path binutils know about : $(bindir)/../lib/bfd-plugins/ > > I don't want to put a copy or symlink my user LLVMgold.so in > the system owned /usr. > > My system has binutils 2.27. >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). This just explains why thinLTO works without using gold linker.> AFAIU, if I explicitly tell cmake to use llvm-ar/llvm-ranlib, then it will > do the right thing for ThinLTO and make LLVMgold plugin will be > used. >Yes, that is fine too. David -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161002/a2c9a03f/attachment.html>
On Sun, Oct 2, 2016 at 8:45 AM, Xinliang David Li <xinliangli at gmail.com> wrote:> bfd linker 2.26 works fine with LLVMgold.so. As I mentioned in a > previous email, 2.26 ar and ranlib also works fine as long as LLVMgold.so > is put in a path binutils know about : $(bindir)/../lib/bfd-plugins/ >That's interesting. I did not know LLVMgold.so could be used with the bfd linker. According to http://llvm.org/docs/GoldPlugin.html, LLVM LTO requires the gold linker. I've never tested with the bfd linker, and will need to build one and try with it as my system has 2.24. Teresa David> > On Sun, Oct 2, 2016 at 3:59 AM, Carsten Mattner <carstenmattner at gmail.com> > wrote: > >> On Sun, Oct 2, 2016 at 6:52 AM, Teresa Johnson <tejohnson at google.com> >> wrote: >> >> > But something is odd then - if the builds aren't using gold then I don't >> > see how ThinLTO could have been kicking in? >> >> I'm not an expert on LLVM's build process, but it's important to note >> that the >> failure was immediately upon trying to run cmake with the extended >> LDFLAGS, >> which now includes the extra flags to enable more pruning. >> >> My understaning was that ld.gold is required for the plugin to do ThinLTO, >> and given my observation before/after enabling llvm-ar/llvm-ranlib to make >> LTO work, and how long the ld processes took for executables and DSOs, >> I'm under the impression that ld.gold was actually used. >> > >-- Teresa Johnson | Software Engineer | tejohnson at google.com | 408-460-2413 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161003/c58f7b89/attachment.html>