diff --git a/src/startup/mldr/elfcalls/threads.c b/src/startup/mldr/elfcalls/threads.c index 757f8c7b5..49f1c67a3 100644 --- a/src/startup/mldr/elfcalls/threads.c +++ b/src/startup/mldr/elfcalls/threads.c @@ -307,6 +307,8 @@ static void* darling_thread_entry(void* p) "xorl %%ebp, %%ebp\n" // Switch to the new stack. "movl %[stack_ptr], %%esp\n" + // Make sure stack is 16 aligned (before we push the fake return address) + "sub $8, %%esp\n" // Unlike x86_64, all function arguments must be stored in the stack "pushl 16(%[args])\n" // 6th argument | args.arg3 "pushl 12(%[args])\n" // 5th argument | args.arg2 @@ -326,7 +328,8 @@ static void* darling_thread_entry(void* p) [stack_ptr] "r"(stack_ptr) ); #else -#error Not implemented + #error Not implemented + // args.entry_point(args.pth, args.port, args.real_entry_point, args.arg1, args.arg2, args.arg3); #endif __builtin_unreachable(); }