[PATCH] D72363: [PowerPC] Default ppc64 linux-gnu/freebsd to -fno-PIC

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 10:40:18 PST 2020


MaskRay added a comment.

In D72363#1810036 <https://reviews.llvm.org/D72363#1810036>, @sfertile wrote:

> LGTM: I really didn't like setting PIC as the default just to work around some codegen bugs. I believe there are PowerPC codegen tests that will fail with this change though (or perhaps there is a PowerPC leak sanitizer build bot which begins to fail? @stefanp probably knows what exposed the BE issue previously).
>
> A couple minor questions though:  Is there a way to emit a warning if the leak sanitizer is used on ELF powerpc64 and PIC/PIE is not also specified? Where should we document that the leak sanitizer needs additional options for a specific target?


Some sanitizers default to -fPIE. It -fsanitize=leak still has the bug and there is a desire (imho this is not a very good idea to make BE/LE gratuitously different), `getSanitizerArgs().requiresPIE()` can be a candidate to patch:

  bool Linux::isPIEDefault() const {
    return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) ||
            getTriple().isMusl() || getSanitizerArgs().requiresPIE();
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72363





More information about the cfe-commits mailing list