From d9da3196227902ec4c57415ed828b8e68ba25621 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Sun, 3 May 2026 17:48:15 +0200 Subject: [PATCH] Amiga: honor __stack under libnix Reference __stkinit so the linker pulls swapstack.o from libnix.a; without it the program runs on the inherited shell stack and crashes inside Lua / level-gen. --- sys/amiga/amistack.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/amiga/amistack.c b/sys/amiga/amistack.c index 2d38b552a..84ae496e1 100644 --- a/sys/amiga/amistack.c +++ b/sys/amiga/amistack.c @@ -22,6 +22,10 @@ #ifdef __SASC_60 long __stack = 256 * 1024; #else -/* For GCC with -noixemul (libnix), __stack is also recognized */ +/* libnix needs __stkinit referenced to pull swapstack.o from libnix.a */ unsigned long __stack = 256 * 1024; +#ifdef CROSS_TO_AMIGA +extern void __stkinit(void); +void *__nh_force_stkinit = __stkinit; +#endif #endif