[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-25 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham added a comment. In D151308#4367704 , @peter.smith wrote: > I note that this is also broken in -fsanitize=kcfi [*] > (https://reviews.llvm.org/D135411) although fixing that is a separate patch. > Would you be able to raise a github issue t

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-25 Thread Peter Smith via Phabricator via cfe-commits
peter.smith added a comment. In D151308#4369828 , @MaskRay wrote: > In D151308#4367704 , @peter.smith > wrote: > >> This looks good to me. Will be worth waiting for a day to give the US time >> zone time to leav

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-25 Thread Simon Tatham via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG20d6dee40d50: -fsanitize=function: fix alignment fault on Arm targets. (authored by simon_tatham). Changed prior to commit: https://reviews.llvm.org/D151308?vs=525111&id=525479#toc Repository: rG LLV

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-25 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham added a comment. > `-fsanitize=kcfi` only supports aarch64 and x86-64 now. riscv64 is on the > plan. > > % fclang -fsanitize=kcfi --traget=armv7-linux-gnueabi -c a.c > clang: error: unsupported option '--traget=armv7-linux-gnueabi' Sorry to contradict, but that error message onl

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-24 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. LGTM. Comment at: clang/test/CodeGen/ubsan-function.cpp:4 // RUN: %clang_cc1 -triple aarch64_be-linux-gnu -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s +// RUN: %clang_cc1 -triple arm-n

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-24 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D151308#4367704 , @peter.smith wrote: > This looks good to me. Will be worth waiting for a day to give the US time > zone time to leave any comments. Thanks! > I note that this is also broken in -fsanitize=kcfi [*] > (http

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-24 Thread Michael Platings via Phabricator via cfe-commits
michaelplatings accepted this revision. michaelplatings added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151308/new/ https://reviews.llvm.org/D151308 ___ cfe-commits mailing list cf

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-24 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham updated this revision to Diff 525111. simon_tatham added a comment. Clarify mask construction as @michaelplatings suggested. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151308/new/ https://reviews.llvm.org/D151308 Files: clang/lib

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-24 Thread Michael Platings via Phabricator via cfe-commits
michaelplatings added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:5380-5381 +Builder.CreatePtrToInt(CalleePtr, IntPtrTy); +llvm::Value *AlignedCalleeAddress = Builder.CreateAnd( +CalleeAddress, llvm::ConstantInt::get(IntPtrTy, -2)); +

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-24 Thread Peter Smith via Phabricator via cfe-commits
peter.smith added a comment. This looks good to me. Will be worth waiting for a day to give the US time zone time to leave any comments. I note that this is also broken in -fsanitize=kcfi [*] (https://reviews.llvm.org/D135411) although fixing that is a separate patch. Would you be able to rais

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-24 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham updated this revision to Diff 525084. simon_tatham added a comment. How embarrassing. _Really_ upload the clang-formatted version this time. Sorry for the noise. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151308/new/ https://review

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-24 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham updated this revision to Diff 525065. simon_tatham added a comment. (oops, forgot to clang-format) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151308/new/ https://reviews.llvm.org/D151308 Files: clang/lib/CodeGen/CGExpr.cpp clan

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-24 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham added a comment. I think this began going wrong as a result of D148573 , which enabled `-fsanitize=function` on all targets, where previously it hadn't been running on Arm at all. But I'd rather make it work than turn it off again! Repository:

[PATCH] D151308: -fsanitize=function: fix alignment fault on Arm targets.

2023-05-24 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham created this revision. simon_tatham added reviewers: peter.smith, MaskRay, dmgreen. Herald added a subscriber: kristof.beyls. Herald added a project: All. simon_tatham requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Function po