[compiler-rt] db29c03 - sanitizer_common: link Synchronization.lib on Windows

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 16 10:59:09 PDT 2021


Author: Dmitry Vyukov
Date: 2021-07-16T19:59:04+02:00
New Revision: db29c030dfea83bbdaa05408bf37d46461adf008

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

LOG: sanitizer_common: link Synchronization.lib on Windows

Windows bot failed with:
sanitizer_win.cpp.obj : error LNK2019: unresolved external symbol WaitOnAddress referenced in function "void __cdecl __sanitizer::FutexWait(struct __sanitizer::atomic_uint32_t *,unsigned int)" (?FutexWait at __sanitizer@@YAXPEAUatomic_uint32_t at 1@I at Z)
sanitizer_win.cpp.obj : error LNK2019: unresolved external symbol WakeByAddressSingle referenced in function "void __cdecl __sanitizer::FutexWake(struct __sanitizer::atomic_uint32_t *,unsigned int)" (?FutexWake at __sanitizer@@YAXPEAUatomic_uint32_t at 1@I at Z)
sanitizer_win.cpp.obj : error LNK2019: unresolved external symbol WakeByAddressAll referenced in function "void __cdecl __sanitizer::FutexWake(struct __sanitizer::atomic_uint32_t *,unsigned int)" (?FutexWake at __sanitizer@@YAXPEAUatomic_uint32_t at 1@I at Z)
https://lab.llvm.org/buildbot/#/builders/127/builds/14046

According to MSDN we need to link Synchronization.lib:
https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress

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

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_win.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
index dcdcba7c6231..dda3b0e07069 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
@@ -44,6 +44,9 @@ TRACELOGGING_DEFINE_PROVIDER(g_asan_provider, "AddressSanitizerLoggingProvider",
 #define TraceLoggingUnregister(x)
 #endif
 
+// For WaitOnAddress
+#  pragma comment(lib, "Synchronization.lib")
+
 // A macro to tell the compiler that this part of the code cannot be reached,
 // if the compiler supports this feature. Since we're using this in
 // code that is called when terminating the process, the expansion of the


        


More information about the llvm-commits mailing list