Enable memtag sanitizer in all AArch64 toolchains
authorMomchil Velikov <momchil.velikov@arm.com>
Tue, 13 Aug 2019 14:20:23 +0000 (14:20 +0000)
committerMomchil Velikov <momchil.velikov@arm.com>
Tue, 13 Aug 2019 14:20:23 +0000 (14:20 +0000)
That sanitizer does not have runtime library or other dependencies.

Differential Revision: https://reviews.llvm.org/D65642

llvm-svn: 368697

clang/lib/Driver/ToolChain.cpp
clang/lib/Driver/ToolChains/Linux.cpp

index d0513a7..4379da9 100644 (file)
@@ -923,6 +923,9 @@ SanitizerMask ToolChain::getSupportedSanitizers() const {
   if (getTriple().getArch() == llvm::Triple::x86_64 ||
       getTriple().getArch() == llvm::Triple::aarch64)
     Res |= SanitizerKind::ShadowCallStack;
+  if (getTriple().getArch() == llvm::Triple::aarch64 ||
+      getTriple().getArch() == llvm::Triple::aarch64_be)
+    Res |= SanitizerKind::MemTag;
   return Res;
 }
 
index 7f59bc7..0877838 100644 (file)
@@ -1029,8 +1029,6 @@ SanitizerMask Linux::getSupportedSanitizers() const {
     Res |= SanitizerKind::HWAddress;
     Res |= SanitizerKind::KernelHWAddress;
   }
-  if (IsAArch64)
-    Res |= SanitizerKind::MemTag;
   return Res;
 }