Commit fff5ce053f

Alex Rønne Petersen <alex@alexrp.com>
2024-07-24 20:11:36
start: Align the stack on sparc64 just in case.
The kernel does this as required, but we cannot trust dynamic linkers to do it.
1 parent ebefee6
Changed files (1)
lib
lib/std/start.zig
@@ -378,6 +378,9 @@ fn _start() callconv(.Naked) noreturn {
             // (2047 bytes).
             \\ mov %%g0, %%fp
             \\ add %%sp, 2175, %%o0
+            \\ add %%sp, 2047, %%sp
+            \\ and %%sp, -16, %%sp
+            \\ sub %%sp, 2047, %%sp
             \\ ba,a %[posixCallMainAndExit]
             ,
             else => @compileError("unsupported arch"),