[PATCH] D148573: Port -fsanitize=function to AArch64

2023-04-19 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D148573#4280335 , @peter.smith wrote: > With moving the signature before the function entry this looks good to me. > I'm not so familiar with the code in https://reviews.llvm.org/D148665 would > ideally find someone a bit mo

[PATCH] D148573: Port -fsanitize=function to AArch64

2023-04-19 Thread Peter Smith via Phabricator via cfe-commits
peter.smith accepted this revision. peter.smith added a comment. This revision is now accepted and ready to land. With moving the signature before the function entry this looks good to me. I'm not so familiar with the code in https://reviews.llvm.org/D148665 would ideally find someone a bit more

[PATCH] D148573: Port -fsanitize=function to AArch64

2023-04-18 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 514768. MaskRay edited the summary of this revision. MaskRay added a comment. Make -mbranch-protection=bti -fsanitize=function work. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148573/new/ https://reviews.llv

[PATCH] D148573: Port -fsanitize=function to AArch64

2023-04-18 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D148573#4277573 , @peter.smith wrote: > As it stands I think this may have problems with -mbranch-protection. In that > case we'll need a `BTI c` to be the target of the indirect branch. I'm > guessing something like: > >

[PATCH] D148573: Port -fsanitize=function to AArch64

2023-04-18 Thread Peter Smith via Phabricator via cfe-commits
peter.smith added a comment. One other small thing. The docs page https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html would need the supported architectures updating: -fsanitize=function: Indirect call of a function through a function pointer of the wrong type (Darwin/Linux, C++ and

[PATCH] D148573: Port -fsanitize=function to AArch64

2023-04-18 Thread Peter Smith via Phabricator via cfe-commits
peter.smith added a comment. As it stands I think this may have problems with -mbranch-protection. In that case we'll need a `BTI c` to be the target of the indirect branch. I'm guessing something like: _Z3funv BTI C ; In hint space B . + 8 .word .L__llvm_rtti_proxy-_Z3funv Otherwise

[PATCH] D148573: Port -fsanitize=function to AArch64

2023-04-17 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. MaskRay added reviewers: dmgreen, lenary, pcc, peter.smith. Herald added subscribers: Enna1, hiraditya, kristof.beyls, emaste. Herald added a project: All. MaskRay requested review of this revision. Herald added projects: clang, Sanitizers, LLVM. Herald added subscrib