[MSan] Define %clang_kmsan for KMSAN tests
@@ -20,11 +20,17 @@ if config.host_os == 'FreeBSD':
clang_msan_cflags += ["-lexecinfo"]
clang_msan_cxxflags = config.cxx_mode_flags + clang_msan_cflags
+# Flags for KMSAN invocation. This is C-only, we're not interested in C++.
+clang_kmsan_cflags = (["-fsanitize=kernel-memory"] +
+ [config.target_cflags] +
+ config.debug_info_flags)
+
def build_invocation(compile_flags):
return " " + " ".join([config.clang] + compile_flags) + " "
config.substitutions.append( ("%clang_msan ", build_invocation(clang_msan_cflags)) )
config.substitutions.append( ("%clangxx_msan ", build_invocation(clang_msan_cxxflags)) )
+config.substitutions.append( ("%clang_kmsan ", build_invocation(clang_kmsan_cflags)) )
# Default test suffixes.
config.suffixes = ['.c', '.cc', '.cpp']
