[llvm-dev] Failing compiler-rt LTO test

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Failing compiler-rt LTO test

Robin Eklind via llvm-dev
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
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Failing compiler-rt LTO test

Robin Eklind via llvm-dev


On Mon, Jul 9, 2018 at 1:08 PM David Greene via llvm-dev <[hidden email]> 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 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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


--
Teresa Johnson | Software Engineer | [hidden email] | 408-460-2413

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Failing compiler-rt LTO test

Robin Eklind via llvm-dev
> 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
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Failing compiler-rt LTO test

Robin Eklind via llvm-dev
Great, glad you are planning to use gold (lld also is fine, it hooks directly into the LLVM sources without needing a plugin).

For now I have reverted the change to the doc, to avoid confusion.

Thanks!
Teresa

On Wed, Jul 11, 2018 at 12:15 PM David A. Greene <[hidden email]> wrote:
> 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


--
Teresa Johnson | Software Engineer | [hidden email] | 408-460-2413

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Failing compiler-rt LTO test

Robin Eklind via llvm-dev
Unfortunately lld won't work for us yet due to a lack of linker script
features (sorry, I don't know the details).

Thanks for fixing up the docs.

                       -David

Teresa Johnson via llvm-dev <[hidden email]> writes:

> Great, glad you are planning to use gold (lld also is fine, it hooks
> directly into the LLVM sources without needing a plugin).
>
> For now I have reverted the change to the doc, to avoid confusion.
>
> Thanks!
> Teresa
>
> On Wed, Jul 11, 2018 at 12:15 PM David A. Greene <[hidden email]> wrote:
>
>     > 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
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Failing compiler-rt LTO test

Robin Eklind via llvm-dev
In reply to this post by Robin Eklind via llvm-dev
On Wed, Jul 11, 2018 at 11:20 AM Teresa Johnson via llvm-dev
<[hidden email]> wrote:

>
>
>
> On Mon, Jul 9, 2018 at 1:08 PM David Greene via llvm-dev <[hidden email]> 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
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev