[clang] [PAC][clang] Enable `-fptrauth-indirect-gotos` as part of pauthtest ABI (PR #100480)

2024-07-24 Thread Anton Korobeynikov via cfe-commits
asl wrote: /cherry-pick 3f6eb13abf643afec17a73448ede380606531226 https://github.com/llvm/llvm-project/pull/100480 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang] Enable `-fptrauth-indirect-gotos` as part of pauthtest ABI (PR #100480)

2024-07-24 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/100480 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PAC][Driver] Support `pauthtest` ABI for AArch64 Linux triples (PR #97237)

2024-07-16 Thread Anton Korobeynikov via cfe-commits
@@ -324,6 +324,9 @@ ARMTargetInfo::ARMTargetInfo(const llvm::Triple &Triple, case llvm::Triple::GNU: setABI("apcs-gnu"); break; +case llvm::Triple::PAuthTest: asl wrote: Do we really need to touch 32-bit ARM? https://github.com/llvm/llvm-p

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-16 Thread Anton Korobeynikov via cfe-commits
@@ -333,7 +338,8 @@ void CodeGenFunction::registerGlobalDtorWithLLVM(const VarDecl &VD, llvm::FunctionCallee Dtor, llvm::Constant *Addr) { // Create a function which calls the d

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-16 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/98276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-16 Thread Anton Korobeynikov via cfe-commits
asl wrote: > I notice the r+, but I haven't fully addressed this feedback - are you > suggesting corrections in a follow up patch, or just conceptually approving > with this PR? :D I think this patch is fine to go as-is. We can re-consider that `MaybeSigned` abstraction further on if it could

[clang] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-07-16 Thread Anton Korobeynikov via cfe-commits
@@ -14,10 +14,144 @@ #ifndef LLVM_CLANG_BASIC_POINTERAUTHOPTIONS_H #define LLVM_CLANG_BASIC_POINTERAUTHOPTIONS_H +#include "clang/Basic/LLVM.h" +#include "clang/Basic/LangOptions.h" +#include "llvm/ADT/STLForwardCompat.h" +#include "llvm/Support/ErrorHandling.h" +#include "llv

[clang] [test][PAC][clang] Add missing tests against linux triples (PR #99482)

2024-07-18 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/99482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Fix a crash when signing a pointer to a function with an incomplete enum parameter (PR #99595)

2024-07-18 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/99595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Authenticate function pointers in UBSan type checks (PR #99590)

2024-07-18 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/99590 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Authenticate function pointers in UBSan type checks (PR #99590)

2024-07-18 Thread Anton Korobeynikov via cfe-commits
@@ -13,6 +15,8 @@ void fun() {} // ARM: ptrtoint ptr {{.*}} to i32, !nosanitize !5 // ARM: and i32 {{.*}}, -2, !nosanitize !5 // ARM: inttoptr i32 {{.*}} to ptr, !nosanitize !5 +// 64e: %[[STRIPPED:.*]] = ptrtoint ptr {{.*}} to i64, !nosanitize +// 64e: call i64 @llvm

[clang] [PAC] Incorrect codegen for constant global init with polymorphic MI (PR #99741)

2024-07-19 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Neat! https://github.com/llvm/llvm-project/pull/99741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Incorrect codegen for constant global init with polymorphic MI (PR #99741)

2024-07-21 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl closed https://github.com/llvm/llvm-project/pull/99741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement function pointer signing and authenticated function calls (PR #93906)

2024-07-21 Thread Anton Korobeynikov via cfe-commits
asl wrote: @ahatanak Will you please take a look into all these issues? https://github.com/llvm/llvm-project/pull/93906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][test] Add function type discrimination tests to static destructor tests (PR #99604)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
asl wrote: @ojhunt Close or rebase? https://github.com/llvm/llvm-project/pull/99604 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
asl wrote: FWIW, we are seeing authentication fails when running musl with pauth enabled and this PR. Working on reproducer. https://github.com/llvm/llvm-project/pull/97647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl requested changes to this pull request. https://github.com/llvm/llvm-project/pull/97647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
@@ -10685,6 +10689,26 @@ SDValue AArch64TargetLowering::LowerBR_JT(SDValue Op, return DAG.getNode(ISD::BRIND, DL, MVT::Other, JTInfo, SDValue(Dest, 0)); } +SDValue AArch64TargetLowering::LowerBRIND(SDValue Op, SelectionDAG &DAG) const { + MachineFunction &MF = DAG.getMachi

[clang] [llvm] [PAC][Driver] Support `pauthtest` ABI for AArch64 Linux triples (PR #97237)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
asl wrote: Thanks @smithp35 I opened https://github.com/llvm/llvm-project/issues/99950 to track this https://github.com/llvm/llvm-project/pull/97237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [PAC] Implement authentication for C++ member function pointers (PR #99576)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/99576 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
@@ -10685,6 +10689,26 @@ SDValue AArch64TargetLowering::LowerBR_JT(SDValue Op, return DAG.getNode(ISD::BRIND, DL, MVT::Other, JTInfo, SDValue(Dest, 0)); } +SDValue AArch64TargetLowering::LowerBRIND(SDValue Op, SelectionDAG &DAG) const { + MachineFunction &MF = DAG.getMachi

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-22 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/97647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG2486 (`noexcept` and function pointer conversion) (PR #107131)

2024-09-03 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/107131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)

2024-07-08 Thread Anton Korobeynikov via cfe-commits
asl wrote: > Under the proposed ABI, `&&A-&&B` is actually "sign(A)-sign(B)". Which is a > constant, but not one which can be represented as a relocation (as far as I > know). Right. The difference should be not be signed IMO as stated above. https://github.com/llvm/llvm-project/pull/97647 __

[clang] [clang] Ensure pointers passed to runtime support functions are correctly signed (PR #98276)

2024-07-10 Thread Anton Korobeynikov via cfe-commits
@@ -333,7 +338,8 @@ void CodeGenFunction::registerGlobalDtorWithLLVM(const VarDecl &VD, llvm::FunctionCallee Dtor, llvm::Constant *Addr) { // Create a function which calls the d

[clang] [PAC][clang] Enhance preprocessor ptrauth tests (PR #98862)

2024-07-15 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks https://github.com/llvm/llvm-project/pull/98862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MSP430][Clang] Update list of MCUs (PR #91258)

2024-05-06 Thread Anton Korobeynikov via cfe-commits
asl wrote: > The python script should likely be up streamed as well. But where? You could just put into `Target/MSP430`. https://github.com/llvm/llvm-project/pull/91258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [MSP430][Clang] Update list of MCUs (PR #91258)

2024-05-07 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl edited https://github.com/llvm/llvm-project/pull/91258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MSP430][Clang] Update list of MCUs (PR #91258)

2024-05-07 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/91258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MSP430][Clang] Update list of MCUs (PR #91258)

2024-05-07 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl closed https://github.com/llvm/llvm-project/pull/91258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libunwind] [libunwind][WebAssembly] Make libunwind compilable (PR #92192)

2024-05-17 Thread Anton Korobeynikov via cfe-commits
@@ -20,7 +20,7 @@ .text #endif -#if !defined(__USING_SJLJ_EXCEPTIONS__) +#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__) asl wrote: You are defining `__USING_WASM_EXCEPTIONS__`. Why you are not using it here and everywhere else? https://gith

[clang] [libunwind] [libunwind][WebAssembly] Make libunwind compilable (PR #92192)

2024-05-17 Thread Anton Korobeynikov via cfe-commits
@@ -20,7 +20,7 @@ .text #endif -#if !defined(__USING_SJLJ_EXCEPTIONS__) +#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__) asl wrote: Ok. Then does the clang change really belong here? `LIBUNWIND_USES_WASM_EXCEPTIONS` also seems to be unused.

[clang] [libunwind] [libunwind][WebAssembly] Make libunwind compilable (PR #92192)

2024-05-21 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Ok from the generic point of view. I cannot judge if wasm-related part is ok though :) https://github.com/llvm/llvm-project/pull/92192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [llvm] Revert "demangle function names in trace files (#87626)" (PR #102274)

2024-08-07 Thread Anton Korobeynikov via cfe-commits
asl wrote: @tru @nikic @MaskRay should this be backported to 19 release branch? https://github.com/llvm/llvm-project/pull/102274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Wire -fptrauth-returns to "ptrauth-returns" fn attribute. (PR #102416)

2024-08-07 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/102416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement -fptrauth-auth-traps. (PR #102417)

2024-08-07 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/102417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PAC][ELF][AArch64] Encode several ptrauth features in PAuth core info (PR #102508)

2024-08-08 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. https://github.com/llvm/llvm-project/pull/102508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PAC][ELF][AArch64] Encode several ptrauth features in PAuth core info (PR #102508)

2024-08-08 Thread Anton Korobeynikov via cfe-commits
asl wrote: But please wait for @MaskRay or other reviwers https://github.com/llvm/llvm-project/pull/102508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang][Driver] Add signed GOT flag (PR #96160)

2024-06-21 Thread Anton Korobeynikov via cfe-commits
asl wrote: > Do we want a lot of `-fptrauth-xxx` instead of > `-fptrauth-something=xxx,yyy,zzz`? I would lean towards a single flag. However, I do not know how this would affect Apple downstream and what are preferences there. Tagging @ahmedbougacha @ahatanak @ojhunt https://github.com/llv

[clang] [compiler-rt] [llvm] [PAC][AArch64] Support init/fini array signing (PR #96478)

2024-06-24 Thread Anton Korobeynikov via cfe-commits
asl wrote: Can we have LLVM IR test as well? https://github.com/llvm/llvm-project/pull/96478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][Driver] Add `-faarch64-jump-table-hardening` flag (PR #113149)

2024-10-21 Thread Anton Korobeynikov via cfe-commits
asl wrote: This looks reasonable to me. @ahmedbougacha @ahatanak any objections? https://github.com/llvm/llvm-project/pull/113149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] Revert "[libc++][modules] Rewrite the modulemap to have fewer top-level modules (#107638)" (PR #110384)

2024-09-28 Thread Anton Korobeynikov via cfe-commits
asl wrote: @llvm-beanz The changes to clang/include/clang/AST/Expr.h seems to be unrelated, no? https://github.com/llvm/llvm-project/pull/110384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [PAC] Re-sign a pointer to a noexcept member function when it is converted to a pointer to a member function without noexcept (PR #109056)

2024-09-17 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. This looks good to me, thanks! https://github.com/llvm/llvm-project/pull/109056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind][AArch64] Protect PC within libunwind's context. (PR #113368)

2024-11-06 Thread Anton Korobeynikov via cfe-commits
@@ -1845,8 +1884,14 @@ class _LIBUNWIND_HIDDEN Registers_arm64 { uint64_t getSP() const { return _registers.__sp; } void setSP(uint64_t value) { _registers.__sp = value; } - uint64_t getIP() const { return _registers.__pc; } - void setIP(uint6

[clang] [MSP430] Default to unsigned char (PR #115964)

2024-11-14 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl closed https://github.com/llvm/llvm-project/pull/115964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MSP430] Default to unsigned char (PR #115964)

2024-11-14 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/115964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Do not support some values of branch-protection with ptrauth-returns (PR #125280)

2025-02-10 Thread Anton Korobeynikov via cfe-commits
https://github.com/asl milestoned https://github.com/llvm/llvm-project/pull/125280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC] Do not support some values of branch-protection with ptrauth-returns (PR #125280)

2025-02-10 Thread Anton Korobeynikov via cfe-commits
asl wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/84b0c128a751acfbf5b439edc724ba27d1da653e https://github.com/llvm/llvm-project/pull/125280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [PAC] Ignore noexcept on function type when computing discriminator of member function pointers (PR #109056)

2025-01-16 Thread Anton Korobeynikov via cfe-commits
asl wrote: Looks like ignoring `noexcept` made the everything even more cleaner :) https://github.com/llvm/llvm-project/pull/109056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [libcxx] [lldb] [llvm] [doc] Add Discord invite link alongside channel links (PR #126352)

2025-02-09 Thread Anton Korobeynikov via cfe-commits
@@ -12,7 +12,8 @@ The LLVM C Library LLVM-libc is not fully complete right now. Some programs may fail to build due to missing functions. If you would like to help us finish LLVM-libc, check out "`Contributing to the libc project `__" in the sidebar - or ask on `discord

[clang] [PAC] Add support for __ptrauth type qualifier (PR #100830)

2025-02-20 Thread Anton Korobeynikov via cfe-commits
@@ -803,17 +809,18 @@ class Qualifiers { static_assert(sizeof(PointerAuthQualifier) == sizeof(uint32_t), "PointerAuthQualifier must be 32 bits"); + static constexpr uint64_t PtrAuthShift = 32; + static constexpr uint64_t PtrAuthMask = uint64_t(0x) <

[clang] [clang] Add builtin_get_vtable_pointer and virtual_member_address (PR #135469)

2025-04-11 Thread Anton Korobeynikov via cfe-commits
@@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-calls -emit-llvm -no-enable-noundef-analysis -o - %s | FileCheck %s --check-prefixes CHECK,CHECK-AUTH +// RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm -no-enable-noundef-analysis -o - %s | FileCheck %

<    1   2