From ebd3240030d463a3b51b630200229093d00cc28d Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 23 Dec 2022 23:14:21 +0900 Subject: [PATCH] wasi_thread_start: add a comment (#371) --- libc-top-half/musl/src/thread/pthread_create.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libc-top-half/musl/src/thread/pthread_create.c b/libc-top-half/musl/src/thread/pthread_create.c index 12fccc7..602d503 100644 --- a/libc-top-half/musl/src/thread/pthread_create.c +++ b/libc-top-half/musl/src/thread/pthread_create.c @@ -277,6 +277,11 @@ static int start_c11(void *p) __attribute__((export_name("wasi_thread_start"))) void wasi_thread_start(int tid, void *p) { + /* + * Note: it's fragile to implement wasi_thread_start in C. + * On entry, we don't even have C stack (__stack_pointer) + * set up. Be careful when modifying this function. + */ struct start_args *args = p; __asm__(".globaltype __tls_base, i32\n" "local.get %0\n"