From 69f82ec7511950eef3d5f52c738d5da6bcac9b0c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 23 Mar 2026 11:12:19 -0700 Subject: [PATCH] build: disable bundled ubsan runtime on Windows Zig's ubsan runtime emits /exclude-symbols linker directives that are incompatible with the MSVC linker, causing LNK4229 warnings and LNK1143 errors. Disable bundling ubsan_rt on Windows while keeping compiler_rt which provides essential symbols like memcpy, memset, memmove, and ___chkstk_ms. The previous check used target.result.abi == .msvc which never matched because Zig defaults to the gnu ABI on Windows. --- src/build/GhosttyLibVt.zig | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/build/GhosttyLibVt.zig b/src/build/GhosttyLibVt.zig index cc27557d3..408f1ebc8 100644 --- a/src/build/GhosttyLibVt.zig +++ b/src/build/GhosttyLibVt.zig @@ -107,12 +107,8 @@ fn initLib( } if (target.result.os.tag == .windows) { - // Zig's ubsan emits /exclude-symbols linker directives and - // its compiler_rt produces COMDAT sections that are - // incompatible with the MSVC linker (LNK1143, LNK4229). - // Skip bundling these runtimes on Windows since consumers - // link against the MSVC runtime. - lib.bundle_compiler_rt = false; + // Zig's ubsan emits /exclude-symbols linker directives that + // are incompatible with the MSVC linker (LNK4229). lib.bundle_ubsan_rt = false; }