[clang] 5a64a82 - [Driver] Allow -fsanitize=kcfi with -fsanitize-minimal-runtime

Sami Tolvanen via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 5 13:41:25 PDT 2023


Author: Sami Tolvanen
Date: 2023-06-05T20:39:45Z
New Revision: 5a64a826b9f0efab4ba7a8cdab4857794bbf07f3

URL: https://github.com/llvm/llvm-project/commit/5a64a826b9f0efab4ba7a8cdab4857794bbf07f3
DIFF: https://github.com/llvm/llvm-project/commit/5a64a826b9f0efab4ba7a8cdab4857794bbf07f3.diff

LOG: [Driver] Allow -fsanitize=kcfi with -fsanitize-minimal-runtime

Having both UBSan with the minimal runtime and KCFI enabled can be
useful in low-level software. As there are no conflicts between the
flags, add KCFI to the list of compatible sanitizers.

Added: 
    

Modified: 
    clang/lib/Driver/SanitizerArgs.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/SanitizerArgs.cpp b/clang/lib/Driver/SanitizerArgs.cpp
index 91efe7f5488be..65c0bbeecc3b6 100644
--- a/clang/lib/Driver/SanitizerArgs.cpp
+++ b/clang/lib/Driver/SanitizerArgs.cpp
@@ -77,7 +77,7 @@ static const SanitizerMask CFIClasses =
 static const SanitizerMask CompatibleWithMinimalRuntime =
     TrappingSupported | SanitizerKind::Scudo | SanitizerKind::ShadowCallStack |
     SanitizerKind::MemtagStack | SanitizerKind::MemtagHeap |
-    SanitizerKind::MemtagGlobals;
+    SanitizerKind::MemtagGlobals | SanitizerKind::KCFI;
 
 enum CoverageFeature {
   CoverageFunc = 1 << 0,


        


More information about the cfe-commits mailing list