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/Driver/ToolChain.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/Driver/ToolChain.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChain.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 85ae4d2..20a555a 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -1031,11 +1031,12 @@ std::string ToolChain::ComputeLLVMTriple(const ArgList &Args, } case llvm::Triple::aarch64: { llvm::Triple Triple = getTriple(); + tools::aarch64::setPAuthABIInTriple(getDriver(), Args, Triple); if (!Triple.isOSBinFormatMachO()) - return getTripleString(); + return Triple.getTriple(); if (Triple.isArm64e()) - return getTripleString(); + return Triple.getTriple(); // FIXME: older versions of ld64 expect the "arm64" component in the actual // triple string and query it to determine whether an LTO file can be |