<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 9, 2018 at 1:08 PM David Greene via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I'm trying to build clang/LLVM and am hitting a test failure in<br>
compiler-rt/test/safestack/lto.c.<br>
<br>
I believe the issue is that we've configured clang to use ld.bfd as the<br>
linker.  ld.bfd has plugin support as described here:<br>
<br>
<a href="https://llvm.org/docs/GoldPlugin.html" rel="noreferrer" target="_blank">https://llvm.org/docs/GoldPlugin.html</a></blockquote><div><br></div><div>I didn't even realize that that doc indicated support for ld.bfd. Looks like the change was made in June 2017, without any associated review. I need to revert at least part of the patch, as it actually removed some instructions for building gold with plugins enabled, and replaced it with instructions for ld.bfd.</div><div><br></div><div>Adding Davide, who commented on the associated bug, for thoughts: <a href="https://bugs.llvm.org/show_bug.cgi?id=32760">https://bugs.llvm.org/show_bug.cgi?id=32760</a>.</div><div>Also looking for comments from others in the community who may have more history or experience on the gold plugin interactions with ld.bfd.</div><div><br></div><div>My understanding in the past is that we didn't officially support using the llvm gold plugin with ld.bfd. We don't have any bots that test that combination (which is why you see the code below in lit.common.cfg). In my mind, that means using the llvm gold plugin with ld.bfd is at your own risk (and therefore I would like to remove the wording around using ld.bfd from the above doc, or at least add that disclaimer).</div><div><br></div><div>Can you use gold or lld instead?</div><div><br></div><div>Teresa</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
compiler-rt/test/lit.common.cfg isn't set up to know about ld.bfd:<br>
<br>
elif config.host_os == 'Linux' and is_linux_lto_supported():<br>
  config.lto_supported = True<br>
  config.lto_launch = []<br>
  if config.use_lld:<br>
    config.lto_flags = ["-fuse-ld=lld"]<br>
  else:<br>
    config.lto_flags = ["-fuse-ld=gold"]<br>
<br>
The test ends up passing -fuse-ld=gold and clang barfs.<br>
<br>
It seems to me the correct thing to do is update lit.common.cfg to<br>
support ld.bfd but I'm not sure exactly how to do that.  I can't find<br>
where "config" is defined.  I think we'd want a config.use_bfd or<br>
something.  Maybe a config.use_gold as well for good measure.<br>
<br>
Thoughts?<br>
<br>
                            -David<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_2903519760694316272gmail_signature"><span style="font-family:Times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td style="border-top:2px solid rgb(213,15,37)">Teresa Johnson |</td><td style="border-top:2px solid rgb(51,105,232)"> Software Engineer |</td><td style="border-top:2px solid rgb(0,153,57)"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td style="border-top:2px solid rgb(238,178,17)"> 408-460-2413</td></tr></tbody></table></span></div></div>