Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -201,7 +201,8 @@ endif() if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND - OS_NAME MATCHES "Darwin|Linux|FreeBSD") + OS_NAME MATCHES "Darwin|Linux|FreeBSD" OR + (OS_NAME MATCHES "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 4)) set(COMPILER_RT_HAS_UBSAN TRUE) else() set(COMPILER_RT_HAS_UBSAN FALSE) Index: lib/ubsan/ubsan_value.h =================================================================== --- lib/ubsan/ubsan_value.h +++ lib/ubsan/ubsan_value.h @@ -16,7 +16,7 @@ // For now, only support Linux, FreeBSD and Darwin. Other platforms should // be easy to add, and probably work as-is. -#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__APPLE__) +#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(_WIN32) #error "UBSan not supported for this platform!" #endif