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 {
823
823
const bool IsRISCV64 = getTriple ().getArch () == llvm::Triple::riscv64;
824
824
const bool IsSystemZ = getTriple ().getArch () == llvm::Triple::systemz;
825
825
const bool IsHexagon = getTriple ().getArch () == llvm::Triple::hexagon;
826
+ const bool IsAndroid = getTriple ().isAndroid ();
826
827
SanitizerMask Res = ToolChain::getSupportedSanitizers ();
827
828
Res |= SanitizerKind::Address;
828
829
Res |= SanitizerKind::PointerCompare;
@@ -831,7 +832,6 @@ SanitizerMask Linux::getSupportedSanitizers() const {
831
832
Res |= SanitizerKind::Fuzzer;
832
833
Res |= SanitizerKind::FuzzerNoLink;
833
834
Res |= SanitizerKind::KernelAddress;
834
- Res |= SanitizerKind::Memory;
835
835
Res |= SanitizerKind::Vptr;
836
836
Res |= SanitizerKind::SafeStack;
837
837
if (IsX86_64 || IsMIPS64 || IsAArch64 || IsLoongArch64)
@@ -857,6 +857,8 @@ SanitizerMask Linux::getSupportedSanitizers() const {
857
857
}
858
858
if (IsX86_64)
859
859
Res |= SanitizerKind::NumericalStability;
860
+ if (!IsAndroid)
861
+ Res |= SanitizerKind::Memory;
860
862
861
863
// Work around "Cannot represent a difference across sections".
862
864
if (getTriple ().getArch () == llvm::Triple::ppc64)
Original file line number Diff line number Diff line change 399
399
// RUN: %clang --target=arm-linux-androideabi %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-NO-ASAN
400
400
// CHECK-ANDROID-NO-ASAN: "-mrelocation-model" "pic"
401
401
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
+
402
407
// RUN: %clang --target=x86_64-linux-gnu %s -fsanitize=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN
403
408
// RUN: %clang --target=x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN
404
409
// 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