Hi, I'm trying to build clang/LLVM and am hitting a test failure in compiler-rt/test/safestack/lto.c. I believe the issue is that we've configured clang to use ld.bfd as the linker. ld.bfd has plugin support as described here: https://llvm.org/docs/GoldPlugin.html compiler-rt/test/lit.common.cfg isn't set up to know about ld.bfd: elif config.host_os == 'Linux' and is_linux_lto_supported(): config.lto_supported = True config.lto_launch = [] if config.use_lld: config.lto_flags = ["-fuse-ld=lld"] else: config.lto_flags = ["-fuse-ld=gold"] The test ends up passing -fuse-ld=gold and clang barfs. It seems to me the correct thing to do is update lit.common.cfg to support ld.bfd but I'm not sure exactly how to do that. I can't find where "config" is defined. I think we'd want a config.use_bfd or something. Maybe a config.use_gold as well for good measure. Thoughts? -David
On Mon, Jul 9, 2018 at 1:08 PM David Greene via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi, > > I'm trying to build clang/LLVM and am hitting a test failure in > compiler-rt/test/safestack/lto.c. > > I believe the issue is that we've configured clang to use ld.bfd as the > linker. ld.bfd has plugin support as described here: > > https://llvm.org/docs/GoldPlugin.htmlI 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. Adding Davide, who commented on the associated bug, for thoughts: https://bugs.llvm.org/show_bug.cgi?id=32760. Also looking for comments from others in the community who may have more history or experience on the gold plugin interactions with ld.bfd. 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). Can you use gold or lld instead? Teresa> > compiler-rt/test/lit.common.cfg isn't set up to know about ld.bfd: > > elif config.host_os == 'Linux' and is_linux_lto_supported(): > config.lto_supported = True > config.lto_launch = [] > if config.use_lld: > config.lto_flags = ["-fuse-ld=lld"] > else: > config.lto_flags = ["-fuse-ld=gold"] > > The test ends up passing -fuse-ld=gold and clang barfs. > > It seems to me the correct thing to do is update lit.common.cfg to > support ld.bfd but I'm not sure exactly how to do that. I can't find > where "config" is defined. I think we'd want a config.use_bfd or > something. Maybe a config.use_gold as well for good measure. > > Thoughts? > > -David > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- 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/20180711/9a6909af/attachment.html>
David A. Greene via llvm-dev
2018-Jul-11 19:15 UTC
[llvm-dev] Failing compiler-rt LTO test
> 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). > > Can you use gold or lld instead?Thanks Teresa! We are indeed planning to use gold eventually. At first I thought the tests were failing because ld.bfd wasn't supported but then I saw the web page and got confused. :) I posted the question because I wanted to make sure we hadn't broken anything. For now I'll just ignore the failures knowing they'll go away when we switch. -David
Davide Italiano via llvm-dev
2018-Jul-11 22:55 UTC
[llvm-dev] Failing compiler-rt LTO test
On Wed, Jul 11, 2018 at 11:20 AM Teresa Johnson via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > > > On Mon, Jul 9, 2018 at 1:08 PM David Greene via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> >> Hi, >> >> I'm trying to build clang/LLVM and am hitting a test failure in >> compiler-rt/test/safestack/lto.c. >> >> I believe the issue is that we've configured clang to use ld.bfd as the >> linker. ld.bfd has plugin support as described here: >> >> https://llvm.org/docs/GoldPlugin.html > > > 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. > > Adding Davide, who commented on the associated bug, for thoughts: https://bugs.llvm.org/show_bug.cgi?id=32760. > Also looking for comments from others in the community who may have more history or experience on the gold plugin interactions with ld.bfd. >My take is that the change should be reverted, but you already did it , so, thanks. In general, we shouldn't really document combinations we don't test using bots or document as best-effort/not-officially-supported. Thank you, -- Davide