From 79e3c4a9a8d662a7d9203476e74d3fa01b1c4eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 7 Apr 2025 13:08:40 +0200 Subject: [PATCH] start: Align the stack on m68k. --- lib/std/start.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/std/start.zig b/lib/std/start.zig index a91df35700..f2490e4801 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -355,7 +355,11 @@ fn _start() callconv(.naked) noreturn { // Note that the - 8 is needed because pc in the jsr instruction points into the middle // of the jsr instruction. (The lea is 6 bytes, the jsr is 4 bytes.) \\ suba.l %%fp, %%fp - \\ move.l %%sp, -(%%sp) + \\ move.l %%sp, %%a0 + \\ move.l %%a0, %%d0 + \\ and.l #-4, %%d0 + \\ move.l %%d0, %%sp + \\ move.l %%a0, -(%%sp) \\ lea %[posixCallMainAndExit] - . - 8, %%a0 \\ jsr (%%pc, %%a0) ,