Index: clang/lib/Driver/ToolChain.cpp =================================================================== --- clang/lib/Driver/ToolChain.cpp +++ clang/lib/Driver/ToolChain.cpp @@ -923,6 +923,9 @@ 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: clang/lib/Driver/ToolChains/Linux.cpp =================================================================== --- clang/lib/Driver/ToolChains/Linux.cpp +++ clang/lib/Driver/ToolChains/Linux.cpp @@ -1029,8 +1029,6 @@ Res |= SanitizerKind::HWAddress; Res |= SanitizerKind::KernelHWAddress; } - if (IsAArch64) - Res |= SanitizerKind::MemTag; return Res; }