[llvm-branch-commits] [clang] [PAC][Driver] Support ptrauth flags only on ARM64 Darwin or with pauthtest ABI (PR #113152)
Daniil Kovalev via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Dec 17 12:33:38 PST 2024
================
@@ -15,50 +16,85 @@
// RUN: -fno-ptrauth-indirect-gotos -fptrauth-indirect-gotos \
// RUN: -fno-ptrauth-init-fini -fptrauth-init-fini \
// RUN: -fno-ptrauth-init-fini-address-discrimination -fptrauth-init-fini-address-discrimination \
+// RUN: -fno-ptrauth-elf-got -fptrauth-elf-got \
// RUN: -fno-aarch64-jump-table-hardening -faarch64-jump-table-hardening \
-// 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" "-fptrauth-type-info-vtable-pointer-discrimination" "-fptrauth-indirect-gotos" "-fptrauth-init-fini" "-fptrauth-init-fini-address-discrimination" "-faarch64-jump-table-hardening"
+// RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL-LINUX-PAUTHTEST
+// RUN: %clang -### -c --target=aarch64-linux-pauthtest \
+// RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \
+// RUN: -fno-ptrauth-calls -fptrauth-calls \
+// RUN: -fno-ptrauth-returns -fptrauth-returns \
+// RUN: -fno-ptrauth-auth-traps -fptrauth-auth-traps \
+// RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-address-discrimination \
+// RUN: -fno-ptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-type-discrimination \
+// RUN: -fno-ptrauth-type-info-vtable-pointer-discrimination -fptrauth-type-info-vtable-pointer-discrimination \
+// RUN: -fno-ptrauth-indirect-gotos -fptrauth-indirect-gotos \
+// RUN: -fno-ptrauth-init-fini -fptrauth-init-fini \
+// RUN: -fno-ptrauth-init-fini-address-discrimination -fptrauth-init-fini-address-discrimination \
+// RUN: -fno-ptrauth-elf-got -fptrauth-elf-got \
+// RUN: -fno-aarch64-jump-table-hardening -faarch64-jump-table-hardening \
+// RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL-LINUX-PAUTHTEST
+// ALL-LINUX-PAUTHTEST: "-cc1"{{.*}} "-fptrauth-intrinsics" "-fptrauth-calls" "-fptrauth-returns" "-fptrauth-auth-traps" "-fptrauth-vtable-pointer-address-discrimination" "-fptrauth-vtable-pointer-type-discrimination" "-fptrauth-type-info-vtable-pointer-discrimination" "-fptrauth-indirect-gotos" "-fptrauth-init-fini" "-fptrauth-init-fini-address-discrimination" "-fptrauth-elf-got"{{.*}} "-faarch64-jump-table-hardening"
-// RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI1
-// RUN: %clang -### -c --target=aarch64-linux-pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI1
-// PAUTHABI1: "-cc1"{{.*}} "-triple" "aarch64-unknown-linux-pauthtest"
-// PAUTHABI1-SAME: "-fptrauth-intrinsics" "-fptrauth-calls" "-fptrauth-returns" "-fptrauth-auth-traps" "-fptrauth-vtable-pointer-address-discrimination" "-fptrauth-vtable-pointer-type-discrimination" "-fptrauth-type-info-vtable-pointer-discrimination" "-fptrauth-indirect-gotos" "-fptrauth-init-fini" "-fptrauth-init-fini-address-discrimination" "-faarch64-jump-table-hardening"
-// PAUTHABI1-SAME: "-target-abi" "pauthtest"
-// PAUTHABI1-NOT: "-fptrauth-function-pointer-type-discrimination"
+// RUN: %clang -### -c --target=aarch64-linux \
+// RUN: -fno-aarch64-jump-table-hardening -faarch64-jump-table-hardening \
+// RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL-LINUX
+// ALL-LINUX: "-cc1"{{.*}} "-faarch64-jump-table-hardening"
+
+//// Some -fptrauth-* flags are supported for ARM64 Darwin.
+// RUN: %clang -### -c --target=arm64-darwin \
+// RUN: -fno-ptrauth-intrinsics -fptrauth-intrinsics \
+// RUN: -fno-ptrauth-calls -fptrauth-calls \
+// RUN: -fno-ptrauth-returns -fptrauth-returns \
+// RUN: -fno-ptrauth-auth-traps -fptrauth-auth-traps \
+// RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fptrauth-vtable-pointer-address-discrimination \
+// RUN: -fno-ptrauth-vtable-pointer-type-discrimination -fptrauth-vtable-pointer-type-discrimination \
+// RUN: -fno-ptrauth-type-info-vtable-pointer-discrimination -fptrauth-type-info-vtable-pointer-discrimination \
+// RUN: -fno-ptrauth-indirect-gotos -fptrauth-indirect-gotos \
+// RUN: -fno-aarch64-jump-table-hardening -faarch64-jump-table-hardening \
+// RUN: %s 2>&1 | FileCheck %s --check-prefix=ALL-DARWIN
+// ALL-DARWIN: "-cc1"{{.*}} "-fptrauth-intrinsics" "-fptrauth-calls" "-fptrauth-returns" "-fptrauth-auth-traps" "-fptrauth-vtable-pointer-address-discrimination" "-fptrauth-vtable-pointer-type-discrimination" "-fptrauth-type-info-vtable-pointer-discrimination" "-fptrauth-indirect-gotos"{{.*}} "-faarch64-jump-table-hardening"
+
+// RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST1
+// RUN: %clang -### -c --target=aarch64-linux-pauthtest %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST1
+// PAUTHTEST1: "-cc1"{{.*}} "-triple" "aarch64-unknown-linux-pauthtest"
+// PAUTHTEST1-SAME: "-fptrauth-intrinsics" "-fptrauth-calls" "-fptrauth-returns" "-fptrauth-auth-traps" "-fptrauth-vtable-pointer-address-discrimination" "-fptrauth-vtable-pointer-type-discrimination" "-fptrauth-type-info-vtable-pointer-discrimination" "-fptrauth-indirect-gotos" "-fptrauth-init-fini" "-fptrauth-init-fini-address-discrimination" "-faarch64-jump-table-hardening"
+// PAUTHTEST1-SAME: "-target-abi" "pauthtest"
+// PAUTHTEST1-NOT: "-fptrauth-function-pointer-type-discrimination"
// RUN: %clang -### -c --target=aarch64-linux -mabi=pauthtest -fno-ptrauth-intrinsics \
// RUN: -fno-ptrauth-calls -fno-ptrauth-returns -fno-ptrauth-auth-traps \
// RUN: -fno-ptrauth-vtable-pointer-address-discrimination -fno-ptrauth-vtable-pointer-type-discrimination \
// RUN: -fno-ptrauth-type-info-vtable-pointer-discrimination -fno-ptrauth-indirect-gotos \
// RUN: -fno-ptrauth-init-fini -fno-ptrauth-init-fini-address-discrimination \
-// RUN: -fno-aarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=PAUTHABI2
+// RUN: -fno-aarch64-jump-table-hardening %s 2>&1 | FileCheck %s --check-prefix=PAUTHTEST2
----------------
kovdan01 wrote:
Changed back to PAUTHABI, thanks
https://github.com/llvm/llvm-project/pull/113152
More information about the llvm-branch-commits
mailing list