mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-24 05:40:15 +00:00
windows: disable C++ ubsan regardless of ABI
The existing `-fno-sanitize=undefined` flag was gated on `abi == .msvc` to avoid undefined `__ubsan_handle_*` references from simdutf/highway. The same linker error reproduces on Windows GNU ABI for the same reason: the Zig-bundled libraries don't provide a matching UBSan runtime for these C/C++ objects in our build configurations. Widen the condition to `os.tag == .windows` so both MSVC and GNU Windows targets skip ubsan for these C++ deps.
This commit is contained in:
@@ -836,10 +836,11 @@ pub fn addSimd(
|
||||
"-DSIMDUTF_NO_LIBCXX",
|
||||
);
|
||||
|
||||
// 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, &.{
|
||||
// Disable ubsan for Windows C/C++ objects to avoid undefined
|
||||
// __ubsan_handle_* references. The Zig libraries on Windows don't
|
||||
// currently bundle a matching UBSan runtime for these objects in
|
||||
// our build configurations (this affects both MSVC and GNU ABIs).
|
||||
if (target.result.os.tag == .windows) try flags.appendSlice(b.allocator, &.{
|
||||
"-fno-sanitize=undefined",
|
||||
"-fno-sanitize-trap=undefined",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user