authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-07-04 13:19:32+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-07-04 20:09:20+02:00
log9a8f1f675b5c1dd8cd58ebfb828d54fb29385b32
treead6aeb35277742c16d605d720cd91667ff9a4c9a
parent9ef4bdf234ed6b58d46452f2286469925f062c39

start: Only issue fninit for x86(_64)-windows

Closes #24263.

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/start.zig+2-2
...@@ -486,7 +486,7 @@ fn _start() callconv(.naked) noreturn {...@@ -486,7 +486,7 @@ fn _start() callconv(.naked) noreturn {
486486
487fn WinStartup() callconv(.withStackAlign(.c, 1)) noreturn {487fn WinStartup() callconv(.withStackAlign(.c, 1)) noreturn {
488 // Switch from the x87 fpu state set by windows to the state expected by the gnu abi.488 // Switch from the x87 fpu state set by windows to the state expected by the gnu abi.
489 if (builtin.abi == .gnu) asm volatile ("fninit");489 if (builtin.cpu.arch.isX86() and builtin.abi == .gnu) asm volatile ("fninit");
490490
491 if (!builtin.single_threaded and !builtin.link_libc) {491 if (!builtin.single_threaded and !builtin.link_libc) {
492 _ = @import("os/windows/tls.zig");492 _ = @import("os/windows/tls.zig");
...@@ -499,7 +499,7 @@ fn WinStartup() callconv(.withStackAlign(.c, 1)) noreturn {...@@ -499,7 +499,7 @@ fn WinStartup() callconv(.withStackAlign(.c, 1)) noreturn {
499499
500fn wWinMainCRTStartup() callconv(.withStackAlign(.c, 1)) noreturn {500fn wWinMainCRTStartup() callconv(.withStackAlign(.c, 1)) noreturn {
501 // Switch from the x87 fpu state set by windows to the state expected by the gnu abi.501 // Switch from the x87 fpu state set by windows to the state expected by the gnu abi.
502 if (builtin.abi == .gnu) asm volatile ("fninit");502 if (builtin.cpu.arch.isX86() and builtin.abi == .gnu) asm volatile ("fninit");
503503
504 if (!builtin.single_threaded and !builtin.link_libc) {504 if (!builtin.single_threaded and !builtin.link_libc) {
505 _ = @import("os/windows/tls.zig");505 _ = @import("os/windows/tls.zig");