From 5143239e2bcc41f6aba8a56b73810f2f9965feb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 26 May 2026 08:08:53 +0200 Subject: [PATCH] std.start: add xtensa support --- lib/std/start.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/std/start.zig b/lib/std/start.zig index 9491ef2045..e05208731e 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -183,6 +183,7 @@ fn _start() callconv(.naked) noreturn { .sparc, .sparc64 => ".cfi_undefined %%i7", .x86 => ".cfi_undefined %%eip", .x86_64 => ".cfi_undefined %%rip", + .xtensa, .xtensaeb => "", // No CFI support. else => @compileError("unsupported arch"), }); @@ -486,6 +487,15 @@ fn _start() callconv(.naked) noreturn { \\ sub %%sp, 2047, %%sp \\ ba,a %[posixCallMainAndExit] , + .xtensa, .xtensaeb => + // a0 = LR, a7 = FP, a1 = SP + \\ movi a0, 0 + \\ movi a7, 0 + \\ mov a2, sp + \\ movi a8, -16 + \\ and sp, sp, a8 + \\ callx0 %[posixCallMainAndExit] + , else => @compileError("unsupported arch"), } :