[lld] [WebAssembly] Generate a call to __wasm_apply_global_tls_relocs in __wasm_init_memory (PR #149832)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 14 09:47:32 PDT 2025
Arshia001 wrote:
Well, yes, the advantage is _not_ having to initialize the TLS section twice on the main thread.
>Every thread (including the main thread) needs to call __wasm_init_tls before it can run
If this is the case, then `__wasm_memory_init` shouldn't initialize the TLS section. As it stands, `__wasm_memory_init` initalizes TLS, so a call to `__wasm_tls_init` would lead to initializing TLS twice. As I mentioned earlier, neither wasix-libc nor (afaik, but I'm pretty certain) wasi-libc call `__wasm_init_tls` on the main thread.
https://github.com/llvm/llvm-project/pull/149832
More information about the llvm-commits
mailing list