mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
Disable thread safe statics in clang-cl, they call the CRT
Also remove the needless static that was using them. llvm-svn: 276327
This commit is contained in:
@@ -198,7 +198,7 @@ if(MSVC)
|
||||
# VS 2015 (version 1900) added support for thread safe static initialization.
|
||||
# However, ASan interceptors run before CRT initialization, which causes the
|
||||
# new thread safe code to crash. Disable this feature for now.
|
||||
if (MSVC_VERSION GREATER 1899)
|
||||
if (MSVC_VERSION GREATER 1899 OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
list(APPEND SANITIZER_COMMON_CFLAGS /Zc:threadSafeInit-)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -235,7 +235,7 @@ void AsanOnDeadlySignal(int, void *siginfo, void *context) {
|
||||
// Exception handler for dealing with shadow memory.
|
||||
static LONG CALLBACK
|
||||
ShadowExceptionHandler(PEXCEPTION_POINTERS exception_pointers) {
|
||||
static uptr page_size = GetPageSizeCached();
|
||||
uptr page_size = GetPageSizeCached();
|
||||
// Only handle access violations.
|
||||
if (exception_pointers->ExceptionRecord->ExceptionCode !=
|
||||
EXCEPTION_ACCESS_VIOLATION) {
|
||||
|
||||
Reference in New Issue
Block a user