[PATCH] D73070: Add function attribute "patchable-function-prefix" to support -fpatchable-function-entry=N,M where M>0

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 11:28:23 PST 2020


MaskRay added a comment.

In D73070#1834291 <https://reviews.llvm.org/D73070#1834291>, @kristof.beyls wrote:

> In D73070#1834196 <https://reviews.llvm.org/D73070#1834196>, @nickdesaulniers wrote:
>
> > I don't mind landing this without aarch64 bti interplay matching GCC precisely; I think it can be done in a follow up.  I just request we don't try to land this in the clang-10 release unless that is also resolved.  Otherwise clang-11.
>
>
> I think these "patchable function entry" sequences are effectively binary interface, i.e. ABI, as other binary processing tools that use these patchable function entries will make assumptions about the structure of these sequences.
>  Therefore, I think it's important that clang and gcc do produce the same sequences, otherwise we're causing de-facto ABI incompatibility.


Not considering AArch64 BTI, we don't have a compatibility issue. I shall also mention that nobody on their side considers endbr64 yet.

For AArch64 BTI users, due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424 , the Linux kernel may adopt a better configure-time test than a simple `if $(cc-option,-fpatchable-function-entry=2)`.
Eventually the two compilers should be compatible, but I don't want to say that we should give up and follow their decision;-) I think they should give x86 folks a chance to chime in. They don't want to change the .Lpatch placement in GCC 10 but that may be changed at git HEAD. In any case, the issues in question exist in previous GCC releases.

-fpatchable-function-entry=2,0 is included in the release/10.x branch. I don't want to push the N,M where M>0 changes to release/10.x.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73070





More information about the llvm-commits mailing list