From 3097c3dc98a46b9f0ac24d6a2958f328cb2ebbf6 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 24 Apr 2026 11:10:06 -0700 Subject: [PATCH] build: always link libc on msvc --- src/build/GhosttyZig.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/build/GhosttyZig.zig b/src/build/GhosttyZig.zig index db74c4a19..e4cbc2d9e 100644 --- a/src/build/GhosttyZig.zig +++ b/src/build/GhosttyZig.zig @@ -123,7 +123,12 @@ fn initVt( // Vendored C++ dependencies are built with no-libcxx and // no-libc modes so we don't need libc or libcpp. System-provided // simdutf requires both libc and libcpp at runtime. - .link_libc = if (system_simdutf) true else false, + // + // MSVC is an exception: its C and C++ runtimes are tightly + // coupled, and the vendored C++ objects (simdutf, highway) + // unconditionally reference MSVC runtime symbols such as + // __security_cookie, __CxxFrameHandler3, and _purecall. + .link_libc = if (system_simdutf or cfg.target.result.abi == .msvc) true else false, .link_libcpp = libcpp: { // MSVC is tightly coupled with the C++ standard library, so we // need to link it even if we don't use it directly.