When considering MT, asan is implemented as a static library: clang-rt_asan-arch.lib , which is linked to the main executable.
Also, a static library clang-rt_asan_dll_thunk-arch.lib, is linked for dlls. Mainly, it uses interception to get a pointer to asan's functions in the main executable.
In this diff, I update current implementation of the interception in clang-rt_asan_dll_thunk-arch.lib, to consider the special case of weak functions.
First we check if the client has redefined the function in the main executable (for example: __sanitizer_cov_trace_pc_guard). It we can't find it, then we look for the default implementation (__sanitizer_cov_trace_pc_guard__def). The default implementation is always available because clang-rt_asan-arch.lib is linked to the main executable.
After this diff, sanitizer coverage is fixed for MT on Windows. In particular, we could provide a version of libFuzzer for MT.
libFuzzer has its own custom implementation for all sanitizer coverage's weak functions, and they will be considered by all client's instrumented dlls.