diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt index d1d229e3e6d40..7d07ec765c005 100644 --- a/compiler-rt/lib/asan/CMakeLists.txt +++ b/compiler-rt/lib/asan/CMakeLists.txt @@ -106,6 +106,12 @@ if(MSVC) endif() set(ASAN_CFLAGS ${SANITIZER_COMMON_CFLAGS}) +# Win/ASan relies on the runtime functions being hotpatchable. See +# https://github.com/llvm/llvm-project/pull/149444 +if(MSVC) + list(APPEND ASAN_CFLAGS /hotpatch) +endif() + append_list_if(MSVC /Zl ASAN_CFLAGS) set(ASAN_COMMON_DEFINITIONS "")