From abea3c8243d65d52aecd8bc836a61fd010148ee2 Mon Sep 17 00:00:00 2001 From: Paze AI Date: Sun, 16 Aug 2026 14:31:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20TLS=20=E5=B4=A9?= =?UTF-8?q?=E6=BA=83=20(0xC000007B)=20=E5=92=8C=E6=9E=84=E5=BB=BA=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: 使用 32 位 gcc (i686) 构建 pcc,导致内部 PTR_SIZE=4, 生成 64 位目标时 TLS 目录按 32 位格式写入 (24字节而非40字节), 所有含 __thread 变量的程序加载即崩溃。 修复: 改用 64 位 gcc (x86_64-w64-mingw32) 完整重建 pcc.exe, PTR_SIZE 正确为 8,TLS 目录 40 字节。 验证: - _Thread_local / __thread 程序正常运行 - _Generic, _Alignas, _Atomic, 匿名结构体, _Static_assert 全部通过 - tests2 套件 102 测试通过 (其余为 CRLF/路径/stderr 框架差异) - 自编译正常 --- win32/libpcc/libpcc.def | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/win32/libpcc/libpcc.def b/win32/libpcc/libpcc.def index e9f4440..4d90731 100644 --- a/win32/libpcc/libpcc.def +++ b/win32/libpcc/libpcc.def @@ -3,6 +3,7 @@ LIBRARY libpcc.dll EXPORTS _pcc_error _pcc_error_noabort +_pcc_setjmp _pcc_warning pcc_add_file pcc_add_include_path @@ -30,6 +31,9 @@ pcc_output_file pcc_parse_args pcc_print_stats pcc_realloc +pcc_relocate +pcc_run +pcc_set_backtrace_func pcc_set_error_func pcc_set_lib_path pcc_set_options