From 0ecc6332b4eb1ced547ffa38f57471134aaa4d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 29 Aug 2024 16:07:46 +0200 Subject: [PATCH] start: Fix arm stack alignment code to work for thumb too. --- lib/std/start.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/std/start.zig b/lib/std/start.zig index ea6f347bd6..5c94a4b591 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -283,7 +283,9 @@ fn _start() callconv(.Naked) noreturn { \\ mov fp, #0 \\ mov lr, #0 \\ mov a1, sp - \\ and sp, #-16 + \\ mov ip, sp + \\ and ip, ip, #-16 + \\ mov sp, ip \\ b %[posixCallMainAndExit] , .csky =>