WebAssembly / wabt

The WebAssembly Binary Toolkit
Apache License 2.0
6.91k stars 702 forks source link

wasm2c: Cleanup TLS: check for __thread and declare TLS vars only when needed #2488

Closed shravanrn closed 1 month ago

shravanrn commented 1 month ago

WASM_RT_THREAD_LOCAL should use __thread compiler intrinsic where possible (gcc, clang, icc) to avoid making C11 a hard dependency to compile the wasm2c runtime. This is a necessity for Segue as well as it also uses a thread_local variable.

shravanrn commented 1 month ago

@sbc100 This is now ready for review. Could you please help land this when you have a chance?