[compiler-rt] 95bde4b - [MSan] Pass -fsanitize-ignorelist to the instrumented libcxxabi

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 22:14:18 PST 2024


Author: Alexander Richardson
Date: 2024-03-06T22:14:15-08:00
New Revision: 95bde4b9d6fe258ff7fea6da5024b2a8813c1e0c

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

LOG: [MSan] Pass -fsanitize-ignorelist to the instrumented libcxxabi

This ensures that the MSan unit tests are able to pass with an
uninstrumented libunwind. We need to avoid instrumentation for
__gxx_personality_v0, which is part of the default msan_ignorelist.txt
that is installed into the resource directory. However, if we are trying
to test the just-built libraries, this global ignore list may not be
present yet, so we still instrument the function.

Arguably this function should not be on the default ignore list since it
is only a problem when building libcxxabi with MSan instrumentation and
without an instrumented libunwind, so maybe the logic should really be
part of the libcxxabi build. However, that could be done as a follow-up.

See 2f856a36e0b270b184051d10a18d4b4238b4c033 for more context.

Reviewed By: vitalybuka

Pull Request: https://github.com/llvm/llvm-project/pull/83652

Added: 
    

Modified: 
    compiler-rt/lib/msan/tests/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/msan/tests/CMakeLists.txt b/compiler-rt/lib/msan/tests/CMakeLists.txt
index 6ef63ff8216638..412a0f6b3de7f2 100644
--- a/compiler-rt/lib/msan/tests/CMakeLists.txt
+++ b/compiler-rt/lib/msan/tests/CMakeLists.txt
@@ -10,7 +10,8 @@ set(MSAN_LIBCXX_CFLAGS
   -fsanitize-memory-track-origins
   -fno-sanitize-memory-param-retval  # unittests test mostly this mode.
   -Wno-pedantic
-  -Xclang -fdepfile-entry=${COMPILER_RT_OUTPUT_DIR}/share/msan_ignorelist.txt
+    # Do not instrument __gxx_personality_v0 (part of libcxxabi)
+  -fsanitize-ignorelist=${COMPILER_RT_OUTPUT_DIR}/share/msan_ignorelist.txt
   )
 
 # Unittest sources and build flags.


        


More information about the llvm-commits mailing list