diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-07-04 13:19:32 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-07-04 20:09:20 +0200 |
| commit | 9a8f1f675b5c1dd8cd58ebfb828d54fb29385b32 (patch) | |
| tree | ad6aeb35277742c16d605d720cd91667ff9a4c9a /lib/std | |
| parent | 9ef4bdf234ed6b58d46452f2286469925f062c39 (diff) | |
| download | zig-9a8f1f675b5c1dd8cd58ebfb828d54fb29385b32.tar.gz zig-9a8f1f675b5c1dd8cd58ebfb828d54fb29385b32.zip | |
start: Only issue fninit for x86(_64)-windows
Closes #24263.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/start.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig index a74b83fe81..68311463b0 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -486,7 +486,7 @@ fn _start() callconv(.naked) noreturn { fn WinStartup() callconv(.withStackAlign(.c, 1)) noreturn { // Switch from the x87 fpu state set by windows to the state expected by the gnu abi. - if (builtin.abi == .gnu) asm volatile ("fninit"); + if (builtin.cpu.arch.isX86() and builtin.abi == .gnu) asm volatile ("fninit"); if (!builtin.single_threaded and !builtin.link_libc) { _ = @import("os/windows/tls.zig"); @@ -499,7 +499,7 @@ fn WinStartup() callconv(.withStackAlign(.c, 1)) noreturn { fn wWinMainCRTStartup() callconv(.withStackAlign(.c, 1)) noreturn { // Switch from the x87 fpu state set by windows to the state expected by the gnu abi. - if (builtin.abi == .gnu) asm volatile ("fninit"); + if (builtin.cpu.arch.isX86() and builtin.abi == .gnu) asm volatile ("fninit"); if (!builtin.single_threaded and !builtin.link_libc) { _ = @import("os/windows/tls.zig"); |
