Author: eugenis Date: Wed Apr 4 16:48:06 2018 New Revision: 329241 URL: http://llvm.org/viewvc/llvm-project?rev=329241&view=rev Log: Enable msan unconditionally on Linux.
Memory sanitizer compatibility are already done in MemorySanitizer::doInitialization. It verifies whether the necessary offsets exist and bails out if not. For this reason it is no good to duplicate two checks in two projects. This patch removes clang check and postpones msan compatibility validation till MemorySanitizer::doInitialization. Another reason for this patch is to allow using msan with any CPU (given compatible runtime) and custom mapping provided via the arguments added by https://reviews.llvm.org/D44926. Patch by vit9696. Differential Revision: https://reviews.llvm.org/D44927 Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp cfe/trunk/test/Driver/fsanitize.c Modified: cfe/trunk/lib/Driver/ToolChains/Linux.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Linux.cpp?rev=329241&r1=329240&r2=329241&view=diff ============================================================================== --- cfe/trunk/lib/Driver/ToolChains/Linux.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp Wed Apr 4 16:48:06 2018 @@ -884,6 +884,7 @@ SanitizerMask Linux::getSupportedSanitiz Res |= SanitizerKind::Fuzzer; Res |= SanitizerKind::FuzzerNoLink; Res |= SanitizerKind::KernelAddress; + Res |= SanitizerKind::Memory; Res |= SanitizerKind::Vptr; Res |= SanitizerKind::SafeStack; if (IsX86_64 || IsMIPS64 || IsAArch64) @@ -892,8 +893,6 @@ SanitizerMask Linux::getSupportedSanitiz Res |= SanitizerKind::Leak; if (IsX86_64 || IsMIPS64 || IsAArch64 || IsPowerPC64) Res |= SanitizerKind::Thread; - if (IsX86_64 || IsMIPS64 || IsPowerPC64 || IsAArch64) - Res |= SanitizerKind::Memory; if (IsX86_64 || IsMIPS64) Res |= SanitizerKind::Efficiency; if (IsX86 || IsX86_64) Modified: cfe/trunk/test/Driver/fsanitize.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fsanitize.c?rev=329241&r1=329240&r2=329241&view=diff ============================================================================== --- cfe/trunk/test/Driver/fsanitize.c (original) +++ cfe/trunk/test/Driver/fsanitize.c Wed Apr 4 16:48:06 2018 @@ -308,9 +308,6 @@ // CHECK-DIAG1: unsupported argument 'zzz' to option 'fsanitize=' // CHECK-DIAG1-NOT: unsupported argument 'zzz' to option 'fsanitize=' -// RUN: %clang -target i686-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-X86 -// CHECK-MSAN-X86: error: unsupported option '-fsanitize=memory' for target 'i686--linux-gnu' - // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-DARWIN // CHECK-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10' _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits