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 ea6f347bd6658ff9b99885e12baaa1f2d292664f..5c94a4b591b885109c14f9dbb5406f1169cfd1ad 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 => -- 2.54.0