diff options
author | Daniil Kovalev <dkovalev@accesssoftek.com> | 2024-07-22 21:18:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-22 21:18:39 +0300 |
commit | 146fd7cd454d71afb94d5d7ad7a3dbd6f3344d04 (patch) | |
tree | 1f7ea2b21c2b511b96b59a0bbe535ae356a8ccf6 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | bee2654300a8f524e05dd4cad41411d597246ac0 (diff) | |
download | llvm-146fd7cd454d71afb94d5d7ad7a3dbd6f3344d04.zip llvm-146fd7cd454d71afb94d5d7ad7a3dbd6f3344d04.tar.gz llvm-146fd7cd454d71afb94d5d7ad7a3dbd6f3344d04.tar.bz2 |
[PAC][Driver] Support `pauthtest` ABI for AArch64 Linux triples (#97237)
When `pauthtest` is either passed as environment part of AArch64 Linux
triple
or passed via `-mabi=`, enable the following ptrauth flags:
- `intrinsics`;
- `calls`;
- `returns`;
- `auth-traps`;
- `vtable-pointer-address-discrimination`;
- `vtable-pointer-type-discrimination`;
- `init-fini`.
Some related stuff is still subject to change, and the ABI itself might
be changed, so end users are not expected to use this and the ABI name
has 'test' suffix.
If `-mabi=pauthtest` option is used, it's normalized to effective
triple.
When the environment part of the effective triple is `pauthtest`, try
to use `aarch64-linux-pauthtest` as multilib directory.
The following is not supported:
- combination of `pauthtest` ABI with any branch protection scheme
except BTI;
- explicit set of environment part of the triple to a value different
from `pauthtest` in combination with `-mabi=pauthtest`;
- usage on non-Linux OS.
---------
Co-authored-by: Anatoly Trosinenko <atrosinenko@accesssoftek.com>
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 71192cb..63ed5b4 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -149,6 +149,8 @@ createTargetCodeGenInfo(CodeGenModule &CGM) { return createWindowsAArch64TargetCodeGenInfo(CGM, AArch64ABIKind::Win64); else if (Target.getABI() == "aapcs-soft") Kind = AArch64ABIKind::AAPCSSoft; + else if (Target.getABI() == "pauthtest") + Kind = AArch64ABIKind::PAuthTest; return createAArch64TargetCodeGenInfo(CGM, Kind); } |