[PATCH] Always add LLVMgold.so plugin if it's present in the standard location

Tom Roeder tmroeder at google.com
Mon Feb 24 10:43:36 PST 2014


On Fri, Feb 21, 2014 at 4:57 PM, Chandler Carruth <chandlerc at google.com> wrote:
>
> On Fri, Feb 21, 2014 at 4:53 PM, Rafael EspĂ­ndola
> <rafael.espindola at gmail.com> wrote:
>>
>> >> That is probably fine. Note that we always try to make llvm and clang
>> >> build options be just the default value of a runtime option. Not sure
>> >> if that would be strictly needed in here since the compile time option
>> >> would just be what -flto is during link time.
>> >
>> >
>> > Could we just detect whether the linker is gold in the driver?
>> >
>> > That would let us:
>> >
>> > 1) produce an error if using BFD ld and -flto
>> > 2) pass the plugin argument safely in all cases where it would be useful
>>
>> Current versions of BFD support plugins. Gold (and BFD) can also be
>> compiled without plugin support, so the detection is not trivial. We
>> would also have to run the linker twice, no? Once to find if it
>> supports plugins and then again to actually link.
>
>
> Bleh. That's rather annoying.
>
> I don't have any good ideas here (other than "LLD will fix this!" which
> isn't terribly helpful). I wonder if the current behavior isn't the best
> default.

I agree that we probably should leave the default behavior as it is.
Are you opposed to adding the always-pass-gold feature behind a build
flag?




More information about the cfe-commits mailing list