[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-31 Thread Ying Yi via Phabricator via cfe-commits
MaggieYi added a comment. Thanks @MaskRay. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158614/new/ https://reviews.llvm.org/D158614 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-30 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Basic/Sanitizers.cpp:130 +if (A->getOption().matches(clang::driver::options::OPT_mexecute_only) && +llvm::ARM::supportedExecuteOnly(Triple)) { + return true; MaskRay wrote: > I don't think we n

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-30 Thread Ying Yi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9ef536a12ea6: [UBSan] Disable the function and kcfi sanitizers on an execute-only target. (authored by MaggieYi). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-30 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham accepted this revision. simon_tatham added a comment. Yes, this looks good to me too. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158614/new/ https://reviews.llvm.org/D158614 ___ cfe-commits mailing list cfe-commits@lis

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-30 Thread Ying Yi via Phabricator via cfe-commits
MaggieYi updated this revision to Diff 554665. MaggieYi marked 5 inline comments as done. MaggieYi added a comment. Thanks @MaskRay. The patch is updated. Hi @simon_tatham, are you happy with the patch? Thanks CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158614/new/ https://reviews.l

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-29 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. This revision is now accepted and ready to land. Thanks! Comment at: clang/lib/Basic/Sanitizers.cpp:126 + // execute-only output (no data access to code sections). + if (const llvm::opt::Arg *A = + Args.getLast

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-29 Thread Ying Yi via Phabricator via cfe-commits
MaggieYi added inline comments. Comment at: clang/include/clang/Basic/DiagnosticCommonKinds.td:326 def err_unsupported_abi_for_opt : Error<"'%0' can only be used with the '%1' ABI">; +def err_unsupported_opt_for_execute_only_target +: Error<"unsupported option '%0' for the

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-29 Thread Ying Yi via Phabricator via cfe-commits
MaggieYi updated this revision to Diff 554474. MaggieYi marked 7 inline comments as done. MaggieYi added a comment. Thanks @MaskRay, I have updated the patch following your suggestions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158614/new/ https://reviews.llvm.org/D158614 Files:

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-25 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/include/clang/Basic/DiagnosticCommonKinds.td:326 def err_unsupported_abi_for_opt : Error<"'%0' can only be used with the '%1' ABI">; +def err_unsupported_opt_for_execute_only_target +: Error<"unsupported option '%0' for the e

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-25 Thread Ying Yi via Phabricator via cfe-commits
MaggieYi added a comment. Thanks @simon_tatham and @MaskRay for the quick code review. When I work on this issue, I want to add an error for both clang and clang -cc1. `-mexecute-only` is an ARM-only compiler option. The clang Driver will convert `-mexecute-only` to `-target-feature +execute-

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-25 Thread Ying Yi via Phabricator via cfe-commits
MaggieYi updated this revision to Diff 553409. MaggieYi edited the summary of this revision. MaggieYi added a comment. Herald added subscribers: llvm-commits, hiraditya. Herald added a project: LLVM. The changes include: 1. Added an ARM::supportedExecuteOnly function to avoid the duplicated code.

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-23 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/include/clang/Basic/DiagnosticCommonKinds.td:326 def err_unsupported_abi_for_opt : Error<"'%0' can only be used with the '%1' ABI">; +def err_unsupported_opt_for_execute_only_target +: Error<"unsupported option '%0' for the e

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-23 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham added inline comments. Comment at: clang/lib/Basic/Sanitizers.cpp:134-143 + if ((A && + A->getOption().matches(clang::driver::options::OPT_mexecute_only)) || + (std::find(Features.begin(), Features.end(), "+execute-only") != + Features.end())) { +

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-23 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham added a comment. I think this is also true of `-fsanitize=kcfi`, isn't it? That also works by writing a cookie just before the function entry point. If we're diagnosing incompatibilities with execute-only, then perhaps we should do it for both. Repository: rG LLVM Github Monorep

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-23 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a comment. The PS5 bits LGTM, but as I'm not familiar with the ARM aspects I won't give final approval. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158614/new/ https://reviews.llvm.org/D158614 ___

[PATCH] D158614: [UBSan] Disable the function sanitizer on an execute-only target.

2023-08-23 Thread Ying Yi via Phabricator via cfe-commits
MaggieYi created this revision. MaggieYi added reviewers: MaskRay, peter.smith, vitalybuka, probinson, pgousseau, glandium, uabelho. Herald added a project: All. MaggieYi requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. PR for https://githu