From 51213a7166196f38080cde61224daba034d16c60 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Mon, 19 Oct 2026 12:34:28 +0000 Subject: fix(driver): bind MinGW JIT stdio locks to the host CRT Resolve _lock_file and _unlock_file to the host compatibility functions so JIT stdio cannot pick incompatible locks from another CRT DLL. Cover fprintf inside a C++ catch with exact stderr expectations. Co-Authored-By: Claude Opus 5.5 --- AGENTS/ARCH.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'AGENTS') diff --git a/AGENTS/ARCH.md b/AGENTS/ARCH.md index dbe9f30..7e284da 100644 --- a/AGENTS/ARCH.md +++ b/AGENTS/ARCH.md @@ -147,6 +147,11 @@ Driver behavior (`tools/driver/main.cc`): the host ABI function. The fallback is made local, and runtime archive interfaces are computed from the normalized object. The runner binds the host's initialized stack guard, stack-check failure handler and `write` alias (`_write`) on MinGW. + It also binds the host's `_lock_file`/`_unlock_file` compatibility functions, + keeping MinGW stdio locks compatible with the host's `FILE` objects. + Microsoft msvcrt.dll lacks these exports, so process-wide lookup can select + another CRT's incompatible functions. Wine's msvcrt.dll exports them and can + mask this defect; Wine success does not replace real Windows verification. Per-graph `__ImageBase` is shared by relocations and SEH registration, with default backend liveness for `.pdata` and associative code edges retaining the suffixed unwind sections. JITLink uses -- cgit v1.3.1-4-g156e