Don't search for third party libraries while using MSan
authorReid Kleckner <rnk@google.com>
Thu, 19 Nov 2015 00:05:21 +0000 (00:05 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 19 Nov 2015 00:05:21 +0000 (00:05 +0000)
On the average user's system, those libraries will not be compiled with
MSan. Prior to this change, the LLVM test suite was full of false
positives from calls from third party libraries to MSan interceptors
like strlen.

We can remove this check if MSan ever grows a suppression mechanism
similar to TSan's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253526 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/config-ix.cmake

index c9ad80e..c984a19 100755 (executable)
@@ -105,6 +105,12 @@ if( NOT PURE_WINDOWS )
   endif()
   check_library_exists(dl dlopen "" HAVE_LIBDL)
   check_library_exists(rt clock_gettime "" HAVE_LIBRT)
+endif()
+
+# Don't look for these libraries on Windows. Also don't look for them if we're
+# using MSan, since uninstrmented third party code may call MSan interceptors
+# like strlen, leading to false positives.
+if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
   if (LLVM_ENABLE_ZLIB)
     check_library_exists(z compress2 "" HAVE_LIBZ)
   else()