Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

shravanrn
Copy link
Collaborator

@shravanrn shravanrn commented Oct 15, 2024

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 shravanrn marked this pull request as draft October 16, 2024 02:03
@shravanrn shravanrn force-pushed the threadlocal-fix branch 2 times, most recently from 24d3c1d to b4870bb Compare October 27, 2024 22:32
@shravanrn shravanrn changed the title wasm2c: Fix WASM_RT_THREAD_LOCAL to check for __thread and add an error path wasm2c: Cleanup TLS: check for __thread and declare TLS vars only when needed Oct 27, 2024
@shravanrn shravanrn marked this pull request as ready for review October 27, 2024 22:53
@shravanrn
Copy link
Collaborator Author

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

wasm2c/wasm-rt.h Outdated Show resolved Hide resolved
@shravanrn shravanrn merged commit 1af9589 into WebAssembly:main Oct 28, 2024
18 checks passed
@shravanrn shravanrn deleted the threadlocal-fix branch October 28, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants