[llvm] r273019 - Change RelaxELFRelocations for llc.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 07:13:48 PDT 2016


On 21 June 2016 at 01:39, James Y Knight <jyknight at google.com> wrote:
> I disagree. I don't think this makes sense. Either the linker you're using
> supports this feature, or it doesn't. Having it enabled for llc if your
> linker doesn't support it is not fun.
>
> Further note that this also affects basically all other code using llvm
> libraries -- other than Clang, which explicitly sets it back to false by
> default, unless you set the ENABLE_X86_RELAX_RELOCATIONS cmake flag to true.
>
> If you want to enable the relax mode across all llvm tools in some
> circumstances, I think it should be via moving the cmake flag from clang
> down into llvm.

But the correct answer is tool dependent.

A nice consequence of this patch is that it found two different cases:

* The gold plugin needs to figure out a way to check the gold version.
For now it just uses the old relocs.
* The LTO support in lld always wants the new relocs since it is part
of lld and knows lld supports them.

> I'm going to revert this commit, since I both think it intrinsically doesn't
> make sense to do this, and because it's breaking some of our tools.

OK. I would be ok with a cmake flag for "assume an unknown user
supports these", but I don't think the cmake option should be used in
TargetOptions.cpp. It should be used in tools where it makes sense. In
tree right now that would be just tools/gold and clang.

Cheers,
Rafael


More information about the llvm-commits mailing list