From ce8215ff40508b93b828bd2a10be62a001331b3c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 24 Sep 2016 01:05:33 -0400 Subject: [PATCH] Realign the stack before calling _exit(). Just in case I ever get this working on macOS. :) --- lx_loader.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lx_loader.c b/lx_loader.c index 69e173c..4250208 100644 --- a/lx_loader.c +++ b/lx_loader.c @@ -293,6 +293,8 @@ static __attribute__((noreturn)) void runLxModule(const LxModule *lxmod, const i // !!! FIXME: init other registers! "ret \n\t" // go to OS/2 land! "1: \n\t" // ...and return here. + "andl $-16, %%esp \n\t" // align the stack for macOS. + "subl $-4, %%esp \n\t" // align the stack for macOS. "pushl %%eax \n\t" // call _exit() with whatever is in %eax. "call _exit \n\t" : // no outputs