zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 5143239e2bcc41f6aba8a56b73810f2f9965feb4 (tree)
parent 68d2bef8c0e956f0ce1dcee8284687c24230c26b
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Tue, 26 May 2026 08:08:53 +0200

std.start: add xtensa support

Diffstat:
Mlib/std/start.zig | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git 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"), } :