[clang] [Driver] Mark -arch as TargetSpecific (PR #74365)

2023-12-05 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @MaskRay Unfortunately, the case I was initially trying to fix still has a problem after applying this patch. Consider `LLVM_DEFAULT_TARGET_TRIPLE=aarch64-linux-musl`. In such a case, running `clang -arch arm64e -c test.c -###` will show us `"-triple" "aarch64-unknown-linux-mu

[clang] [Driver] Mark -arch as TargetSpecific (PR #74365)

2023-12-05 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: OK, thanks for such a detailed explanation! Closing https://github.com/llvm/llvm-project/pull/72821 as not needed. https://github.com/llvm/llvm-project/pull/74365 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [clang] Enhance handling of Apple-specific '-arch'/'-target' option values (PR #72821)

2023-12-05 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 closed https://github.com/llvm/llvm-project/pull/72821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Enhance handling of Apple-specific '-arch'/'-target' option values (PR #72821)

2023-11-19 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 created https://github.com/llvm/llvm-project/pull/72821 The '-arch' option itself is Apple-specific, so, if '-target' is not passed explicitely, we try to construct an Apple triple. If the default triple is Apple-specific, we just update it's arch so it matches the

[clang] [clang] Enhance handling of Apple-specific '-arch'/'-target' option values (PR #72821)

2023-11-19 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 edited https://github.com/llvm/llvm-project/pull/72821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Enhance handling of Apple-specific '-arch'/'-target' option values (PR #72821)

2023-12-04 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @MaskRay @TNorthover @Artem-B Would be glad to see you review on the changes https://github.com/llvm/llvm-project/pull/72821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [lld] [clang-tools-extra] [llvm] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-09 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/72714 >From c493d78e6c482bb530189de05b79e7082a224fab Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Thu, 28 Sep 2023 03:14:35 +0300 Subject: [PATCH 1/5] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH

[clang] [lld] [clang-tools-extra] [llvm] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-09 Thread Daniil Kovalev via cfe-commits
@@ -0,0 +1,156 @@ +// REQUIRES: aarch64 + +// RUN: llvm-mc -filetype=obj -triple=aarch64 %p/Inputs/shared2.s -o %t.so.o +// RUN: ld.lld -shared %t.so.o -soname=so -o %t.so +// RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o +// RUN: ld.lld -pie -z nopack-relative-auth-relocs

[clang] [lld] [clang-tools-extra] [llvm] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-09 Thread Daniil Kovalev via cfe-commits
@@ -0,0 +1,156 @@ +// REQUIRES: aarch64 kovdan01 wrote: Renamed aarch64-ptrauth.s to aarch64-reloc-pauth.s to make naming consistent with existing tests, aarch64-feature-pauth.s checks the `.note.AARCH64-PAUTH-ABI-tag` stuff. See b791da9dd02f8b3bf59d2d235181f9

[clang] [lld] [clang-tools-extra] [llvm] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-09 Thread Daniil Kovalev via cfe-commits
@@ -1444,6 +1444,32 @@ template void RelocationScanner::scanOne(RelTy *&i) { } } + if (config->emachine == EM_AARCH64 && type == R_AARCH64_AUTH_ABS64) { +// Assume relocations from relocatable objects are RELA. +assert(RelTy::IsRela); +std::lock_guard lock

[llvm] [clang] [lld] [clang-tools-extra] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-09 Thread Daniil Kovalev via cfe-commits
@@ -566,6 +570,7 @@ constexpr const char *knownZFlags[] = { "origin", "pac-plt", "pack-relative-relocs", +"pack-relative-auth-relocs", kovdan01 wrote: Update on my previous comment: changing `getPackDynRelocs` as I suggested above is probably

[llvm] [clang] [lld] [clang-tools-extra] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-09 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: - Addressed the review comments except https://github.com/llvm/llvm-project/pull/72714/#discussion_r1423345089 (I'll submit a subsequent commit addressing that shortly). - Fixed merge conflict appeared after #77300, see a021f15540300e032446825de805143f0f6214c4. https://github

[clang-tools-extra] [lld] [clang] [llvm] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-10 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/72714 >From c493d78e6c482bb530189de05b79e7082a224fab Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Thu, 28 Sep 2023 03:14:35 +0300 Subject: [PATCH 1/6] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH

[clang-tools-extra] [lld] [clang] [llvm] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-10 Thread Daniil Kovalev via cfe-commits
@@ -1444,6 +1444,32 @@ template void RelocationScanner::scanOne(RelTy *&i) { } } + if (config->emachine == EM_AARCH64 && type == R_AARCH64_AUTH_ABS64) { +// Assume relocations from relocatable objects are RELA. +assert(RelTy::IsRela); +std::lock_guard lock

[lld] [llvm] [clang] [clang-tools-extra] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-10 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @MaskRay Published updates on all issues you've mentioned - would be glad to see your comments on new changes. https://github.com/llvm/llvm-project/pull/72714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] f854434 - [NVPTX] Enhance vectorization of ld.param & st.param

2022-03-24 Thread Daniil Kovalev via cfe-commits
Author: Daniil Kovalev Date: 2022-03-24T12:25:36+03:00 New Revision: f854434f0f2a01027bdaad8e6fdac5a782fce291 URL: https://github.com/llvm/llvm-project/commit/f854434f0f2a01027bdaad8e6fdac5a782fce291 DIFF: https://github.com/llvm/llvm-project/commit/f854434f0f2a01027bdaad8e6fdac5a782fce291.diff

[clang] a034878 - Revert "[NVPTX] Enhance vectorization of ld.param & st.param"

2022-03-24 Thread Daniil Kovalev via cfe-commits
Author: Daniil Kovalev Date: 2022-03-24T12:32:06+03:00 New Revision: a0348785649271e8c63a42bd4a83a2fefa96efe0 URL: https://github.com/llvm/llvm-project/commit/a0348785649271e8c63a42bd4a83a2fefa96efe0 DIFF: https://github.com/llvm/llvm-project/commit/a0348785649271e8c63a42bd4a83a2fefa96efe0.diff

[clang] 828b63c - [NVPTX] Enhance vectorization of ld.param & st.param

2022-03-24 Thread Daniil Kovalev via cfe-commits
Author: Daniil Kovalev Date: 2022-03-24T12:36:52+03:00 New Revision: 828b63c309439d3b0915205f1e5a159c69cb36b8 URL: https://github.com/llvm/llvm-project/commit/828b63c309439d3b0915205f1e5a159c69cb36b8 DIFF: https://github.com/llvm/llvm-project/commit/828b63c309439d3b0915205f1e5a159c69cb36b8.diff

[clang] [PAC][clang] Define ptrauth driver flags and preprocessor features (PR #85232)

2024-03-14 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 created https://github.com/llvm/llvm-project/pull/85232 Define the following clang driver flags: - `-fptrauth-intrinsics`: `PointerAuthIntrinsics` in `LangOptions`, `ptrauth_intrinsics` preprocessor feature; - `-fptrauth-calls`: `PointerAuthCalls` in `LangOptions`,

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-14 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 created https://github.com/llvm/llvm-project/pull/85235 Depends on #85231 and #85232 Emit PAuth ABI compatibility tag values as llvm module flags: - `aarch64-elf-pauthabi-platform` - `aarch64-elf-pauthabi-version` For platform 0x1002 (llvm_linux), the version va

[clang] [PAC][clang] Define ptrauth driver flags and preprocessor features (PR #85232)

2024-03-14 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/85232 >From 1394471c06458bd9de1935d3d546348ba392b452 Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Thu, 14 Mar 2024 12:19:26 +0300 Subject: [PATCH] [PAC][clang] Define ptrauth driver flags and preprocessor feat

[clang] [llvm] [CodeGen][AArch64][FMV] PAC the stub_helper's frame on arm64e (PR #84704)

2024-03-14 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: > Can the triple checks be generalized to checking about pauth-enabled > subtarget feature? This way everything would work for ELF platforms > eventually. @asl Since I'm not sure how particularly ifuncs should be handled, here are two answers for two different cases. If we ne

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-15 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 edited https://github.com/llvm/llvm-project/pull/85235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-15 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/85235 >From 8e65b4402201f74d5312ed257c4abde4a6615964 Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Thu, 14 Mar 2024 12:19:26 +0300 Subject: [PATCH 1/2] [PAC][clang] Define ptrauth driver flags and preprocessor

[clang] [PAC][clang] Define ptrauth driver flags and preprocessor features (PR #85232)

2024-03-15 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 closed https://github.com/llvm/llvm-project/pull/85232 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-18 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/85235 >From eef1d790d1ec8cb9e0dda2b534c4ef19002ade35 Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Thu, 14 Mar 2024 12:19:26 +0300 Subject: [PATCH 1/2] [PAC][clang] Define ptrauth driver flags and preprocessor

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-19 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/85235 >From 919af72c09216838bfe586c3da503f5d74104a7d Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Tue, 19 Mar 2024 23:57:06 +0300 Subject: [PATCH 1/2] [PAC][clang] Define ptrauth driver flags and preprocessor

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-19 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 ready_for_review https://github.com/llvm/llvm-project/pull/85235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-20 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/85235 >From 919af72c09216838bfe586c3da503f5d74104a7d Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Tue, 19 Mar 2024 23:57:06 +0300 Subject: [PATCH 1/3] [PAC][clang] Define ptrauth driver flags and preprocessor

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-03-20 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: A kind reminder regarding the PR - would be glad to see feedback from everyone interested. https://github.com/llvm/llvm-project/pull/84384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-26 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/85235 >From 919af72c09216838bfe586c3da503f5d74104a7d Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Tue, 19 Mar 2024 23:57:06 +0300 Subject: [PATCH 1/7] [PAC][clang] Define ptrauth driver flags and preprocessor

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-26 Thread Daniil Kovalev via cfe-commits
@@ -7203,6 +7203,33 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, options::OPT_fno_ptrauth_intrinsics, false)) CmdArgs.push_back("-fptrauth-intrinsics"); + if (Args.hasFlag(options::OPT_fptrauth_calls, options::OPT_fno_ptrauth_calls,

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-26 Thread Daniil Kovalev via cfe-commits
@@ -0,0 +1,32 @@ +// Check that we can manually enable specific ptrauth features. kovdan01 wrote: Thanks, see f3abb4897fb9cd56b00eb6344489bbc972c40c5b and 4fd37cf125c13982ae0b6eb7254404fa3def6df5 https://github.com/llvm/llvm-project/pull/85235 _

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-26 Thread Daniil Kovalev via cfe-commits
@@ -0,0 +1,32 @@ +// Check that we can manually enable specific ptrauth features. + +// RUN: %clang --target=aarch64 -c %s -### 2>&1 | FileCheck %s --check-prefix NONE +// NONE: "-cc1" +// NONE-NOT: "-fptrauth-intrinsics" kovdan01 wrote: Fixed, thanks, see 4fd37

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI compatibility tag (PR #85235)

2024-03-26 Thread Daniil Kovalev via cfe-commits
@@ -0,0 +1,61 @@ +// REQUIRES: aarch64-registered-target kovdan01 wrote: Ensured that it's not needed and deleted in 2fd8f6606c6d287085582b82145b05a635fbf776, thanks https://github.com/llvm/llvm-project/pull/85235 ___

[clang] [lldb] [PAC][lldb][Dwarf] Support `__ptrauth`-qualified types in user expressions (PR #84387)

2024-03-28 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/84387 >From 728f5644aebfafd2114e7e47a9b83ef057423997 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 20 Feb 2024 10:57:54 -0800 Subject: [PATCH 01/10] Upstream ptrauth changes to DWARFASTParserClang ---

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-03-07 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 created https://github.com/llvm/llvm-project/pull/84384 This brings declarations of `PointerAuthQualifier` class and `PointerAuthenticationMode` enum and related functions required for PAuth support in lldb (see #TODO) from downstream Apple's code. Co-authored-by: Ah

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-03-07 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: I've left 4 commits to distinguish code coming from different sources during review. Here is the origin of the code for each of the commits: - ef23d427b48687b62da9e1062886ddfcc1649b6a: https://github.com/apple/llvm-project/commit/a94321f13043a39b02fa7106b8270767651354cd - 9e296a

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-03-07 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 edited https://github.com/llvm/llvm-project/pull/84384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-03-07 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/84384 >From ef23d427b48687b62da9e1062886ddfcc1649b6a Mon Sep 17 00:00:00 2001 From: John McCall Date: Mon, 16 Dec 2019 20:31:25 -0500 Subject: [PATCH 1/4] Abstract serialization fixes for the Apple Clang changes. ---

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-03-07 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 ready_for_review https://github.com/llvm/llvm-project/pull/84384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [lld] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-31 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/72714 >From c493d78e6c482bb530189de05b79e7082a224fab Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Thu, 28 Sep 2023 03:14:35 +0300 Subject: [PATCH 1/8] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH

[clang-tools-extra] [llvm] [clang] [lld] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-31 Thread Daniil Kovalev via cfe-commits
@@ -0,0 +1,83 @@ +# REQUIRES: aarch64 + +# RUN: rm -rf %t && split-file %s %t && cd %t + +# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu abi-tag1.s -o tag11.o +# RUN: cp tag11.o tag12.o +# RUN: ld.lld -shared tag11.o tag12.o -o tagok.so +# RUN: llvm-readelf -n tagok.so | F

[clang] [llvm] [clang-tools-extra] [lld] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-31 Thread Daniil Kovalev via cfe-commits
@@ -543,7 +553,8 @@ class RelocationBaseSection : public SyntheticSection { static bool classof(const SectionBase *d) { return SyntheticSection::classof(d) && (d->type == llvm::ELF::SHT_RELA || d->type == llvm::ELF::SHT_REL || -d->type == llvm::ELF:

[clang] [clang-tools-extra] [llvm] [lld] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-31 Thread Daniil Kovalev via cfe-commits
@@ -1461,6 +1493,33 @@ template void RelocationScanner::scanOne(RelTy *&i) { } } + // if (config->emachine == EM_AARCH64 && type == R_AARCH64_AUTH_ABS64) { kovdan01 wrote: Ah, thanks, removed that. The logic was moved to `RelocationScanner::processAu

[clang] [clang-tools-extra] [llvm] [lld] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-26 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/72714 >From c493d78e6c482bb530189de05b79e7082a224fab Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Thu, 28 Sep 2023 03:14:35 +0300 Subject: [PATCH 1/6] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH

[clang] [clang-tools-extra] [llvm] [lld] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-26 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @MaskRay Would be glad to see your comments on changes addressing your comments https://github.com/llvm/llvm-project/pull/72714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [clang-tools-extra] [llvm] [lld] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)

2024-01-19 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @MaskRay A kind reminder regarding the PR https://github.com/llvm/llvm-project/pull/72714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-06-30 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 created https://github.com/llvm/llvm-project/pull/97237 Enable the following ptrauth flags when `pauthabi` is passed as branch protection: - `intrinsics`; - `calls`; - `returns`; - `auth-traps`; - `vtable-pointer-address-discrimination`; - `vtable-pointer-type-discr

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-06-30 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 milestoned https://github.com/llvm/llvm-project/pull/97237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-07-01 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: Would be glad to see feedback on the changes from those who are interested. 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-comm

[clang] [llvm] [PAC][ELF][AArch64] Encode signed GOT flag in PAuth core info (PR #96159)

2024-07-01 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: Would be glad to see feedback on the changes from those who are interested. https://github.com/llvm/llvm-project/pull/96159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [llvm] [PAC][ELF][AArch64] Encode signed GOT flag in PAuth core info (PR #96159)

2024-07-01 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @MaskRay Would be glad to see your feedback on the changes https://github.com/llvm/llvm-project/pull/96159 ___ 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-07-01 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @ahmedbougacha > I should mention that in our world we generally don't expect these to be > common (other than in cc1 invocations), and they're generally used for > overriding default ABI behavior inferred from triples and deployment targets > and whatnot. We also don't expe

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-01 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 ready_for_review https://github.com/llvm/llvm-project/pull/97237 ___ 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-07-01 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @MaskRay @ahmedbougacha @asl I suggest to move the discussion on comma-separated flags/current flags to an issue #97320. This PR is intended to introduce the signed GOT flag, and we already have a bunch of similar ptrauth flags, so, if we want to change the flags to a single co

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-03 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/97237 >From 3b4b1b1739b810d758e68f30c48b648963cff740 Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Mon, 1 Jul 2024 00:50:21 +0300 Subject: [PATCH 1/2] [PAC][Driver] Implement `-mbranch-protection=pauthabi` opti

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-03 Thread Daniil Kovalev via cfe-commits
@@ -1484,6 +1484,39 @@ void AddUnalignedAccessWarning(ArgStringList &CmdArgs) { } } +static void handlePAuthABIOption(const ArgList &DriverArgs, kovdan01 wrote: I've added the comment, thanks! See fcd090caac9ede6b915db991819298bed4a5d44e https://github.com/l

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-03 Thread Daniil Kovalev via cfe-commits
@@ -1484,6 +1484,39 @@ void AddUnalignedAccessWarning(ArgStringList &CmdArgs) { } } +static void handlePAuthABIOption(const ArgList &DriverArgs, + ArgStringList &CC1Args, const Driver &D) { + if (!DriverArgs.hasArg(options::OPT_fptrauth_intrins

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-04 Thread Daniil Kovalev via cfe-commits
@@ -1537,11 +1570,16 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args, if (!isAArch64 && PBP.Key == "b_key") D.Diag(diag::warn_unsupported_branch_protection) << "b-key" << A->getAsString(Args); +if (!isAArch64 && PBP.HasPa

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-04 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 edited https://github.com/llvm/llvm-project/pull/97237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-04 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/97237 >From 3b4b1b1739b810d758e68f30c48b648963cff740 Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Mon, 1 Jul 2024 00:50:21 +0300 Subject: [PATCH 1/3] [PAC][Driver] Implement `-mbranch-protection=pauthabi` opti

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-04 Thread Daniil Kovalev via cfe-commits
@@ -13,13 +13,33 @@ // RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL // ALL: "-cc1"{{.*}} "-fptrauth-intrinsics" "-fptrauth-calls" "-fptrauth-returns" "-fptrauth-auth-traps" "-fptrauth-vtable-pointer-address-discrimination" "-fptrauth-vtable-pointer-type-discrimination" "-

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-05 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/97237 >From 3b4b1b1739b810d758e68f30c48b648963cff740 Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Mon, 1 Jul 2024 00:50:21 +0300 Subject: [PATCH 1/4] [PAC][Driver] Implement `-mbranch-protection=pauthabi` opti

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-05 Thread Daniil Kovalev via cfe-commits
@@ -1537,11 +1570,16 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args, if (!isAArch64 && PBP.Key == "b_key") D.Diag(diag::warn_unsupported_branch_protection) << "b-key" << A->getAsString(Args); +if (!isAArch64 && PBP.HasPa

[clang] [llvm] [PAC][Driver] Implement `-mbranch-protection=pauthabi` option (PR #97237)

2024-07-05 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/97237 >From 3b4b1b1739b810d758e68f30c48b648963cff740 Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Mon, 1 Jul 2024 00:50:21 +0300 Subject: [PATCH 1/5] [PAC][Driver] Implement `-mbranch-protection=pauthabi` opti

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

2024-07-05 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: Ping: would be glad to see feedback on the changes from those who are interested. https://github.com/llvm/llvm-project/pull/96160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

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

2024-07-05 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: Ping: would be glad to see feedback on the changes from those who are interested. 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/c

[clang] [llvm] [PAC][ELF][AArch64] Encode signed GOT flag in PAuth core info (PR #96159)

2024-07-05 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: Thanks @tmatheson-arm! I'll merge this as soon as #96478 gets merged - there, we introduce `AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_INITFINIADDRDISC = 7`, so signed GOT should be bit 8. We can't use bit 8 for signed GOT right now since the implementation relies on contiguous

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

2024-07-08 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 edited 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-08 Thread Daniil Kovalev 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-08 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 commented: The changes mostly look reasonable, but there are several comments to be answered before the PR can be merged. Regarding previous @efriedma-quic 's comment about computing the difference between two blockaddresses - I suppose it might be OK just to explic

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

2024-07-08 Thread Daniil Kovalev via cfe-commits
@@ -412,6 +412,15 @@ class AArch64Subtarget final : public AArch64GenSubtargetInfo { /// Choose a method of checking LR before performing a tail call. AArch64PAuth::AuthCheckMethod getAuthenticatedLRCheckMethod() const; + /// Compute the integer discriminator for a given

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

2024-07-08 Thread Daniil Kovalev via cfe-commits
@@ -10704,15 +10728,36 @@ SDValue AArch64TargetLowering::LowerConstantPool(SDValue Op, SDValue AArch64TargetLowering::LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const { - BlockAddressSDNode *BA = cast(Op); + BlockAddressS

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

2024-07-08 Thread Daniil Kovalev via cfe-commits
@@ -1866,6 +1876,20 @@ void AArch64AsmPrinter::LowerMOVaddrPAC(const MachineInstr &MI) { assert(STI->getInstrInfo()->getInstSizeInBytes(MI) >= InstsEmitted * 4); } +const MCExpr * +AArch64AsmPrinter::lowerBlockAddressConstant(const BlockAddress &BA) { + const MCExpr *BAE =

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

2024-07-08 Thread Daniil Kovalev via cfe-commits
@@ -2516,6 +2516,10 @@ bool AArch64FastISel::selectIndirectBr(const Instruction *I) { if (AddrReg == 0) return false; + // Authenticated indirectbr is not implemented yet. kovdan01 wrote: It looks like that a test with FastISel ensuring that we fall b

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

2024-07-08 Thread Daniil Kovalev via cfe-commits
@@ -3461,6 +3470,23 @@ bool AArch64InstructionSelector::select(MachineInstr &I) { return true; } case TargetOpcode::G_BLOCK_ADDR: { +Function *BAFn = I.getOperand(1).getBlockAddress()->getFunction(); +if (std::optional BADisc = +STI.getPtrAuthBlockA

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

2024-07-08 Thread Daniil Kovalev via cfe-commits
@@ -0,0 +1,106 @@ +; RUN: llc -mtriple arm64e-apple-darwin \ +; RUN: -asm-verbose=false -aarch64-enable-collect-loh=false \ +; RUN: -o - %s | FileCheck %s + +; RUN: llc -mtriple arm64e-apple-darwin \ +; RUN: -global-isel -global-isel-abort=1 -verify-machineinstrs \ +; RUN:

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

2024-07-08 Thread Daniil Kovalev via cfe-commits
@@ -1789,6 +1789,9 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args, options::OPT_fno_ptrauth_vtable_pointer_type_discrimination); Args.addOptInFlag(CmdArgs, options::OPT_fptrauth_init_fini, options::OPT_fno_ptrauth_init_fini); + -

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

2024-07-08 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 edited 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-08 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 deleted 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-08 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 deleted 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-08 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 edited 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-08 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @ahmedbougacha I've updated my review: I've misinterpreted logic a bit previously, and thought that a couple of codepaths are not covered by tests. It's not true, everything is OK, but please address @efriedma-quic 's concern described above so this can be approved and merged.

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI core info (PR #85235)

2024-04-08 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 edited https://github.com/llvm/llvm-project/pull/85235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-04-08 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 updated https://github.com/llvm/llvm-project/pull/84384 >From ef23d427b48687b62da9e1062886ddfcc1649b6a Mon Sep 17 00:00:00 2001 From: John McCall Date: Mon, 16 Dec 2019 20:31:25 -0500 Subject: [PATCH 1/5] Abstract serialization fixes for the Apple Clang changes. ---

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-04-08 Thread Daniil Kovalev via cfe-commits
@@ -138,6 +140,165 @@ using CanQualType = CanQual; #define TYPE(Class, Base) class Class##Type; #include "clang/AST/TypeNodes.inc" +/// Pointer-authentication qualifiers. +class PointerAuthQualifier { + enum : uint32_t { +EnabledShift = 0, +EnabledBits = 1, +Enabl

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-04-08 Thread Daniil Kovalev via cfe-commits
@@ -138,6 +140,165 @@ using CanQualType = CanQual; #define TYPE(Class, Base) class Class##Type; #include "clang/AST/TypeNodes.inc" +/// Pointer-authentication qualifiers. +class PointerAuthQualifier { + enum : uint32_t { +EnabledShift = 0, +EnabledBits = 1, +Enabl

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-04-08 Thread Daniil Kovalev via cfe-commits
@@ -138,6 +140,165 @@ using CanQualType = CanQual; #define TYPE(Class, Base) class Class##Type; #include "clang/AST/TypeNodes.inc" +/// Pointer-authentication qualifiers. +class PointerAuthQualifier { + enum : uint32_t { +EnabledShift = 0, +EnabledBits = 1, +Enabl

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-04-08 Thread Daniil Kovalev via cfe-commits
@@ -138,6 +140,165 @@ using CanQualType = CanQual; #define TYPE(Class, Base) class Class##Type; #include "clang/AST/TypeNodes.inc" +/// Pointer-authentication qualifiers. +class PointerAuthQualifier { + enum : uint32_t { +EnabledShift = 0, +EnabledBits = 1, +Enabl

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-04-08 Thread Daniil Kovalev via cfe-commits
@@ -251,15 +423,16 @@ class Qualifiers { } // Deserialize qualifiers from an opaque representation. - static Qualifiers fromOpaqueValue(unsigned opaque) { + static Qualifiers fromOpaqueValue(uint64_t Opaque) { Qualifiers Qs; -Qs.Mask = opaque; +Qs.Mask = uin

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-04-08 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: > Are there unittests where we could exercise these types? @Michael137 Could you clarify a bit, what is the correct place for such a unit test? As for `ASTContext` methods similar to newly proposed `getPointerAuthType` (like `getQualifiedType` and `getCVRQualifiedType`), I've

[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

2024-04-08 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: Although functions in this file use different code styles for function arguments (both `camelCase` and `PascalCase`), I've changed the code style for function arguments of newly added functions to `PascalCase` as described in https://llvm.org/docs/CodingStandards.html#name-type

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI core info (PR #85235)

2024-04-12 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @MaskRay A kind reminder regarding the PR - please let me know if latest updates address your previous comments and if there are other issues still present. https://github.com/llvm/llvm-project/pull/85235 ___ cfe-commits mailing list

[clang] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)

2024-06-20 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 approved this pull request. https://github.com/llvm/llvm-project/pull/93903 ___ 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 signed GOT flag in PAuth core info (PR #96159)

2024-06-20 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 created https://github.com/llvm/llvm-project/pull/96159 Depends on #96158 Treat 7th bit of version value for llvm_linux platform as signed GOT flag. - clang: define `PointerAuthELFGOT` LangOption and set 7th bit of `aarch64-elf-pauthabi-version` LLVM module flag co

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

2024-06-20 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 created https://github.com/llvm/llvm-project/pull/96160 Depends on #96159 Add `-fptrauth-elf-got` clang driver flag and set `ptrauth_elf_got` preprocessor feature and `PointerAuthELFGOT` LangOption correspondingly. For non-ELF triples, the driver flag is ignored an

[clang] [llvm] [PAC][ELF][AArch64] Encode signed GOT flag in PAuth core info (PR #96159)

2024-06-20 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 edited https://github.com/llvm/llvm-project/pull/96159 ___ 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 signed GOT flag in PAuth core info (PR #96159)

2024-06-20 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 ready_for_review https://github.com/llvm/llvm-project/pull/96159 ___ 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-20 Thread Daniil Kovalev via cfe-commits
https://github.com/kovdan01 ready_for_review https://github.com/llvm/llvm-project/pull/96160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   >