From 1d8fca0060ecfe700df7722e6763de94e2bd0b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 3 Aug 2024 19:57:06 +0200 Subject: [PATCH] std.os.windows.tls: Only define _tls_array when targeting MSVC. LLVM does not use it when emitting code for the MinGW ABI. --- lib/std/os/windows/tls.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/os/windows/tls.zig b/lib/std/os/windows/tls.zig index 658eff8681..e4fceebfc4 100644 --- a/lib/std/os/windows/tls.zig +++ b/lib/std/os/windows/tls.zig @@ -9,7 +9,7 @@ export var __xl_a: windows.PIMAGE_TLS_CALLBACK linksection(".CRT$XLA") = null; export var __xl_z: windows.PIMAGE_TLS_CALLBACK linksection(".CRT$XLZ") = null; comptime { - if (builtin.target.cpu.arch == .x86 and builtin.zig_backend != .stage2_c) { + if (builtin.cpu.arch == .x86 and builtin.abi == .msvc and builtin.zig_backend != .stage2_c) { // The __tls_array is the offset of the ThreadLocalStoragePointer field // in the TEB block whose base address held in the %fs segment. asm (