build: disable ubsan for SIMD C++ files on MSVC

The SIMD C++ files reference __ubsan_handle_* symbols when compiled
in debug mode, but we do not link or bundle the ubsan runtime on
MSVC. This matches what the highway and simdutf packages already do
in their own build files.
This commit is contained in:
Mitchell Hashimoto
2026-03-23 12:31:17 -07:00
parent b4c529a827
commit 63260ec722

View File

@@ -812,6 +812,14 @@ pub fn addSimd(
"-std=c++17",
);
// Disable ubsan for MSVC to avoid undefined references to
// __ubsan_handle_* symbols that require a runtime we don't link
// and bundle. Hopefully we can fix this one day since ubsan is nice!
if (target.result.abi == .msvc) try flags.appendSlice(b.allocator, &.{
"-fno-sanitize=undefined",
"-fno-sanitize-trap=undefined",
});
m.addCSourceFiles(.{
.files = &.{
"src/simd/base64.cpp",