[PATCH] D148573: Allow -fsanitize=function on all targets

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 12:59:22 PDT 2023


MaskRay added a comment.

In D148573#4361894 <https://reviews.llvm.org/D148573#4361894>, @sbc100 wrote:

> In D148573#4361509 <https://reviews.llvm.org/D148573#4361509>, @MaskRay wrote:
>
>> In D148573#4361396 <https://reviews.llvm.org/D148573#4361396>, @sbc100 wrote:
>>
>>> This change seems to be causing problems on the emscripten auto-roller:  https://ci.chromium.org/ui/p/emscripten-releases/builders/try/linux/b8780394114149321217/overview
>>>
>>> Failures show up in ubsan tests and look like this:
>>>
>>>   error: symbol '_Z4testi' unsupported subtraction expression used in relocation in code section.
>>>   error: symbol '__main_argc_argv' unsupported subtraction expression used in relocation in code section.
>>>   fatal error: error in backend: function sections must contain one function each
>>>
>>> It seems like enabling this sanitizer perhaps uses features we don't yet support?  I will keep investigating but perhaps we can find a way to revert he effect on the wasm backend for now?
>>
>> wasm seems to use `-fsanitize=undefined`, which includes `-fsanitize=function`.
>> wasm doesn't allow data words before the function entry, so we need to unsupport `-fsanitize=function` for wasm...
>
> That makes sense to me.     The wasm specification (and therefore the wasm runtimes) already enforce signature checking for indirect function calls so there should be no need for this sanitizer there anyway.    Do you want to make that change or should I?

Thanks for the additional context (and I shall learn about it). Having been done in 39ba913d13ab15c76cb6b5aa066fa111ddfe944b <https://reviews.llvm.org/rG39ba913d13ab15c76cb6b5aa066fa111ddfe944b>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148573



More information about the cfe-commits mailing list