File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -823,6 +823,7 @@ SanitizerMask Linux::getSupportedSanitizers() const {
823823 const bool IsRISCV64 = getTriple ().getArch () == llvm::Triple::riscv64;
824824 const bool IsSystemZ = getTriple ().getArch () == llvm::Triple::systemz;
825825 const bool IsHexagon = getTriple ().getArch () == llvm::Triple::hexagon;
826+ const bool IsAndroid = getTriple ().isAndroid ();
826827 SanitizerMask Res = ToolChain::getSupportedSanitizers ();
827828 Res |= SanitizerKind::Address;
828829 Res |= SanitizerKind::PointerCompare;
@@ -831,7 +832,6 @@ SanitizerMask Linux::getSupportedSanitizers() const {
831832 Res |= SanitizerKind::Fuzzer;
832833 Res |= SanitizerKind::FuzzerNoLink;
833834 Res |= SanitizerKind::KernelAddress;
834- Res |= SanitizerKind::Memory;
835835 Res |= SanitizerKind::Vptr;
836836 Res |= SanitizerKind::SafeStack;
837837 if (IsX86_64 || IsMIPS64 || IsAArch64 || IsLoongArch64)
@@ -857,6 +857,8 @@ SanitizerMask Linux::getSupportedSanitizers() const {
857857 }
858858 if (IsX86_64)
859859 Res |= SanitizerKind::NumericalStability;
860+ if (!IsAndroid)
861+ Res |= SanitizerKind::Memory;
860862
861863 // Work around "Cannot represent a difference across sections".
862864 if (getTriple ().getArch () == llvm::Triple::ppc64)
Original file line number Diff line number Diff line change 399399// RUN: %clang --target=arm-linux-androideabi %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-NO-ASAN
400400// CHECK-ANDROID-NO-ASAN: "-mrelocation-model" "pic"
401401
402+ // RUN: not %clang --target=aarch64-linux-android -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-ANDROID
403+ // RUN: not %clang --target=i386-linux-android -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-ANDROID
404+ // RUN: not %clang --target=x86_64-linux-android -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-ANDROID
405+ // CHECK-MSAN-ANDROID: unsupported option '-fsanitize=memory' for target
406+
402407// RUN: %clang --target=x86_64-linux-gnu %s -fsanitize=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN
403408// RUN: %clang --target=x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN
404409// RUN: %clang --target=x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=all -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN
You can’t perform that action at this time.
0 commit comments