]> git.proxmox.com Git - wasi-libc.git/blobdiff - libc-bottom-half/crt/crt1-command.c
threads: implement init of TLS and stack pointer (#342)
[wasi-libc.git] / libc-bottom-half / crt / crt1-command.c
index 48be79f7ef586e6e256db32f5aaff0ee58ed9c81..fb9ee71fb40e7912e24812d324f5b08007a916cb 100644 (file)
@@ -1,5 +1,6 @@
 #ifdef _REENTRANT
 #include <stdatomic.h>
+extern void __wasi_init_tp(void);
 #endif
 #include <wasi/api.h>
 extern void __wasm_call_ctors(void);
@@ -29,6 +30,10 @@ void _start(void) {
     started = 1;
 #endif
 
+#ifdef _REENTRANT
+       __wasi_init_tp();
+#endif
+
     // The linker synthesizes this to call constructors.
     __wasm_call_ctors();