[compiler-rt] ea7695d - [hwasan] Support __lsan_default_options

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 15:07:53 PST 2023


Author: Fangrui Song
Date: 2023-01-30T15:07:46-08:00
New Revision: ea7695dcca53ca7694e347224b68cbdefbc3cc5f

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

LOG: [hwasan] Support __lsan_default_options

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D142938

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan.cpp
    compiler-rt/test/lsan/TestCases/default_options.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan.cpp b/compiler-rt/lib/hwasan/hwasan.cpp
index cdf231c2547e6..b7a95cad99d38 100644
--- a/compiler-rt/lib/hwasan/hwasan.cpp
+++ b/compiler-rt/lib/hwasan/hwasan.cpp
@@ -129,6 +129,9 @@ static void InitializeFlags() {
   // Override from user-specified string.
   if (__hwasan_default_options)
     parser.ParseString(__hwasan_default_options());
+#if CAN_SANITIZE_LEAKS
+  lsan_parser.ParseString(__lsan_default_options());
+#endif
 #if HWASAN_CONTAINS_UBSAN
   const char *ubsan_default_options = __ubsan_default_options();
   ubsan_parser.ParseString(ubsan_default_options);

diff  --git a/compiler-rt/test/lsan/TestCases/default_options.cpp b/compiler-rt/test/lsan/TestCases/default_options.cpp
index 11376e70e575e..3a2942df66393 100644
--- a/compiler-rt/test/lsan/TestCases/default_options.cpp
+++ b/compiler-rt/test/lsan/TestCases/default_options.cpp
@@ -1,11 +1,8 @@
 // RUN: %clangxx_lsan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
 
-// Fixme: remove once test passes with hwasan
-// UNSUPPORTED: hwasan
-
 extern "C"
 const char *__lsan_default_options() {
-  // CHECK: Available flags for {{Leak|Address}}Sanitizer:
+  // CHECK: Available flags for {{Leak|Address|HWAddress}}Sanitizer:
   return "verbosity=1 help=1";
 }
 


        


More information about the llvm-commits mailing list