[PATCH] D102742: [IR] make stack-protector-guard-* flags into module attrs

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 21 10:01:31 PDT 2021


nickdesaulniers added a comment.

In D102742#2773954 <https://reviews.llvm.org/D102742#2773954>, @tejohnson wrote:

> In D102742#2767569 <https://reviews.llvm.org/D102742#2767569>, @nickdesaulniers wrote:
>
>> Obviously needs work/cleanup, changes to x86, and tests, but posting for early feedback about module level attributes vs function level attributes, or possibly something else.  I tested this quickly with thin LTO of the Linux kernel and it worked.
>
> I haven't looked through in too much detail, but I see you have the module flag type set as Warning on conflict. I guess the answer to module level vs function level depends on whether it is valid to link together files compiled with different values of these flags and if so what the expected behavior should be. How does this work on non-LTO? If it works just fine, i.e. the functions from the modules with one value are compiled ok with that value and linked with functions compiled effectively with another value, then that would point to a function attribute so you can mimic the mix-and-match behavior. If it is unexpected, then perhaps better to keep as a module flag but Error? With Warning, the value from the first module being linked is used - would that be surprising?

Good point; it won't work as intended on mismatch. Let me upgrade that to Error.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102742



More information about the cfe-commits mailing list