From 252e1fd7ecc037b129490af5eb5ca8fdfa6a20bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 23 Oct 2025 04:53:14 +0200 Subject: [PATCH] std.start: add alpha support --- lib/std/start.zig | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/std/start.zig b/lib/std/start.zig index 1f1aee0604..ab362a3195 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -195,9 +195,10 @@ fn _start() callconv(.naked) noreturn { // This is the first userspace frame. Prevent DWARF-based unwinders from unwinding further. We // prevent FP-based unwinders from unwinding further by zeroing the register below. if (builtin.unwind_tables != .none or !builtin.strip_debug_info) asm volatile (switch (native_arch) { + .aarch64, .aarch64_be => ".cfi_undefined lr", + .alpha => ".cfi_undefined $26", .arc, .arceb => ".cfi_undefined blink", .arm, .armeb, .thumb, .thumbeb => "", // https://github.com/llvm/llvm-project/issues/115891 - .aarch64, .aarch64_be => ".cfi_undefined lr", .csky => ".cfi_undefined lr", .hexagon => ".cfi_undefined r31", .loongarch32, .loongarch64 => ".cfi_undefined 1", @@ -253,6 +254,18 @@ fn _start() callconv(.naked) noreturn { \\ and sp, x0, #-16 \\ b %[posixCallMainAndExit] , + .alpha => + // $15 = FP, $26 = LR, $29 = GP, $30 = SP + \\ br $29, 1f + \\1: + \\ ldgp $29, 0($29) + \\ mov 0, $15 + \\ mov 0, $26 + \\ mov $30, $16 + \\ ldi $1, -16 + \\ and $30, $30, $1 + \\ jsr $26, %[posixCallMainAndExit] + , .arc, .arceb => // ARC v1 and v2 had a very low stack alignment requirement of 4; v3 increased it to 16. \\ mov fp, 0