LibC: Fix pthread stack alignment

This commit is contained in:
Bananymous 2025-04-02 12:49:45 +03:00
parent f32f62dfc1
commit e85b18e206
1 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,11 @@ struct pthread_trampoline_info_t
void* arg;
};
static void pthread_trampoline(void* arg)
// stack is 16 byte aligned on entry, this `call` is used to align it
extern "C" void pthread_trampoline(void*);
asm("pthread_trampoline: call pthread_trampoline_cpp");
extern "C" void pthread_trampoline_cpp(void* arg)
{
pthread_trampoline_info_t info;
memcpy(&info, arg, sizeof(pthread_trampoline_info_t));