[PATCH] D147983: [lld][driver] Add `--relax-gp`/`no-relax-gp` flags for GNU compatibility

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 13:00:11 PDT 2023


MaskRay added a comment.

In D147983#4259079 <https://reviews.llvm.org/D147983#4259079>, @mcgrathr wrote:

> In D147983#4259054 <https://reviews.llvm.org/D147983#4259054>, @MaskRay wrote:
>
>> Thank for the patch, but we can just wait for GP relaxation which should land soon.
>
> If it's not landing literally by tomorrow, then we should land this first to unblock other work that needs to rely on RISC-V linkers accepting these flags since GNU linkers have `--relax-gp` as the default state and we need target-specific driver logic to be able to override that. This seems far preferable to making such driver logic temporarily omit the option when it thinks it's running LLD.

Thank you for weighing in in shadow call stack. Apologies if I have missed any previous discussions as I had been travelling for quite a while for the past 30 days and just came back and started to check emails.

However, I don't think this is needed to unblock any dependent work.
I added `--[no-]relax-gp` to GNU ld recently, which isn't in a released binutils version yet.
Clang Driver passing `--no-relax-gp` to ld will break most GNU ld users.

This patch has some other issues that should be addressed before being in a ready state. For ignored options, we use `silent-ignore.test` as a convention.
For ignored options, we don't need to use TableGen names `defm relax_gp`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147983/new/

https://reviews.llvm.org/D147983



More information about the llvm-commits mailing list