[clang] b4aa71e - Allow -fsanitize-minimal-runtime with memtag sanitizer.
Evgenii Stepanov via cfe-commits
cfe-commits at lists.llvm.org
Thu May 7 13:08:20 PDT 2020
Author: Evgenii Stepanov
Date: 2020-05-07T13:07:46-07:00
New Revision: b4aa71e1bd9aaee377e0ea22cf60a5857e570733
URL: https://github.com/llvm/llvm-project/commit/b4aa71e1bd9aaee377e0ea22cf60a5857e570733
DIFF: https://github.com/llvm/llvm-project/commit/b4aa71e1bd9aaee377e0ea22cf60a5857e570733.diff
LOG: Allow -fsanitize-minimal-runtime with memtag sanitizer.
Summary:
MemTag does not have any runtime at the moment, it's strictly code
instrumentation.
Reviewers: pcc
Subscribers: cryptoad, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79522
Added:
Modified:
clang/lib/Driver/SanitizerArgs.cpp
clang/test/Driver/fsanitize.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/SanitizerArgs.cpp b/clang/lib/Driver/SanitizerArgs.cpp
index c7760f086284..bc186fa5a598 100644
--- a/clang/lib/Driver/SanitizerArgs.cpp
+++ b/clang/lib/Driver/SanitizerArgs.cpp
@@ -68,7 +68,8 @@ static const SanitizerMask CFIClasses =
SanitizerKind::CFIMFCall | SanitizerKind::CFIDerivedCast |
SanitizerKind::CFIUnrelatedCast;
static const SanitizerMask CompatibleWithMinimalRuntime =
- TrappingSupported | SanitizerKind::Scudo | SanitizerKind::ShadowCallStack;
+ TrappingSupported | SanitizerKind::Scudo | SanitizerKind::ShadowCallStack |
+ SanitizerKind::MemTag;
enum CoverageFeature {
CoverageFunc = 1 << 0,
diff --git a/clang/test/Driver/fsanitize.c b/clang/test/Driver/fsanitize.c
index e7094ef93afc..55a5e7a2e2eb 100644
--- a/clang/test/Driver/fsanitize.c
+++ b/clang/test/Driver/fsanitize.c
@@ -781,6 +781,10 @@
// CHECK-UBSAN-MINIMAL: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute),?){17}"}}
// CHECK-UBSAN-MINIMAL: "-fsanitize-minimal-runtime"
+// RUN: %clang -target aarch64-linux-android -march=armv8-a+memtag -fsanitize=memtag -fsanitize-minimal-runtime %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MEMTAG-MINIMAL
+// CHECK-MEMTAG-MINIMAL: "-fsanitize=memtag"
+// CHECK-MEMTAG-MINIMAL: "-fsanitize-minimal-runtime"
+
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize=function -fsanitize-minimal-runtime %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UBSAN-FUNCTION-MINIMAL
// CHECK-UBSAN-FUNCTION-MINIMAL: error: invalid argument '-fsanitize=function' not allowed with '-fsanitize-minimal-runtime'
More information about the cfe-commits
mailing list