diff options
author | Leonard Chan <leonardchan@google.com> | 2019-10-28 14:19:38 -0700 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2019-10-28 14:19:38 -0700 |
commit | 85b718f53a3575bca2f1b7fdb1b3aaa6df7c10e3 (patch) | |
tree | 3392f2898f6d50b35c051340808fd52a665cd283 /clang/lib/Driver/ToolChains/Fuchsia.cpp | |
parent | 91095fe0726e7d6bdd9c147a734f1287eb8eb8a4 (diff) | |
download | bcm5719-llvm-85b718f53a3575bca2f1b7fdb1b3aaa6df7c10e3.tar.gz bcm5719-llvm-85b718f53a3575bca2f1b7fdb1b3aaa6df7c10e3.zip |
[Driver] Enable ShadowCallStack, not SafeStack, by default on AArch64 Fuchsia
Submitted for mcgrathr.
On AArch64, Fuchsia fully supports both SafeStack and ShadowCallStack ABIs.
The latter is now preferred and will be the default. It's possible to
enable both simultaneously, but ShadowCallStack is believed to have most
of the practical benefit of SafeStack with less cost.
Differential Revision: https://reviews.llvm.org/D66712
Diffstat (limited to 'clang/lib/Driver/ToolChains/Fuchsia.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/Fuchsia.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains/Fuchsia.cpp b/clang/lib/Driver/ToolChains/Fuchsia.cpp index e7d38ff9f22..df2b4724dc2 100644 --- a/clang/lib/Driver/ToolChains/Fuchsia.cpp +++ b/clang/lib/Driver/ToolChains/Fuchsia.cpp @@ -343,5 +343,10 @@ SanitizerMask Fuchsia::getSupportedSanitizers() const { } SanitizerMask Fuchsia::getDefaultSanitizers() const { - return SanitizerKind::SafeStack; + SanitizerMask Res; + if (getTriple().getArch() == llvm::Triple::aarch64) + Res |= SanitizerKind::ShadowCallStack; + else + Res |= SanitizerKind::SafeStack; + return Res; } |