sanitizer_common: link Synchronization.lib on Windows
authorDmitry Vyukov <dvyukov@google.com>
Fri, 16 Jul 2021 17:55:32 +0000 (19:55 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 16 Jul 2021 17:59:04 +0000 (19:59 +0200)
commitdb29c030dfea83bbdaa05408bf37d46461adf008
tree0240615d96c9ce4a67a511055374990584329576
parentcfa4d112da8da97480c3018c68389aa06cb3efb8
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@__sanitizer@@YAXPEAUatomic_uint32_t@1@I@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@__sanitizer@@YAXPEAUatomic_uint32_t@1@I@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@__sanitizer@@YAXPEAUatomic_uint32_t@1@I@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
compiler-rt/lib/sanitizer_common/sanitizer_win.cpp