Index: lib/asan/asan_win_dynamic_runtime_thunk.cc =================================================================== --- lib/asan/asan_win_dynamic_runtime_thunk.cc +++ lib/asan/asan_win_dynamic_runtime_thunk.cc @@ -25,9 +25,27 @@ // simplifies the build procedure. #ifdef ASAN_DYNAMIC_RUNTIME_THUNK #include "sanitizer_common/sanitizer_win_defs.h" +#include "sanitizer_common/sanitizer_interface_internal.h" #define WIN32_LEAN_AND_MEAN #include +// Define weak alias for all weak functions from sanitizer coverage. +// For each function "fun", WEAK_DEF_NAME(fun) is the default implementation +// exported by the dll. +#define WEAK_IMPORT(Name) WIN_WEAK_ALIAS(Name, WEAK_DEF_NAME(Name)) +WEAK_IMPORT(__sanitizer_cov_trace_cmp) +WEAK_IMPORT(__sanitizer_cov_trace_cmp1) +WEAK_IMPORT(__sanitizer_cov_trace_cmp2) +WEAK_IMPORT(__sanitizer_cov_trace_cmp4) +WEAK_IMPORT(__sanitizer_cov_trace_cmp8) +WEAK_IMPORT(__sanitizer_cov_trace_switch) +WEAK_IMPORT(__sanitizer_cov_trace_div4) +WEAK_IMPORT(__sanitizer_cov_trace_div8) +WEAK_IMPORT(__sanitizer_cov_trace_gep) +WEAK_IMPORT(__sanitizer_cov_trace_pc_indir) +WEAK_IMPORT(__sanitizer_cov_trace_pc_guard) +WEAK_IMPORT(__sanitizer_cov_trace_pc_guard_init) + // First, declare CRT sections we'll be using in this file #pragma section(".CRT$XIB", long, read) // NOLINT #pragma section(".CRT$XID", long, read) // NOLINT