-
Notifications
You must be signed in to change notification settings - Fork 206
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
unistd.h declares threads support even when not enabled #355
Comments
One option here would be to use Another option would be to move forward with the new target triple idea that's been tossed around. wasm32-wasi-pthread or so, and then we could get a predefined target macro like |
Use |
* Don't define `_POSIX_THREADS` unless threads are enabled. Fixes #355. * Remove `_POSIX_THREADS` from predefined-macros.txt.
…y#356) * Don't define `_POSIX_THREADS` unless threads are enabled. Fixes WebAssembly#355. * Remove `_POSIX_THREADS` from predefined-macros.txt.
I noticed that unistd.h seems to declare support for threads on all wasi-libc builds
https://github.com/WebAssembly/wasi-libc/blob/main/libc-top-half/musl/include/unistd.h#L339
This is despite
pthread.h
not being available. As far as I can tell, it's not possible to compile a library that has branches based on whether threads are available or not, for example to use a real or no-op mutex.It seems like guarding on
__wasilibc_unmodified_upstream
would reflect the current state of wasi-libc. But I know there is the ongoingTHREAD_MODEL=posix
work as well. It's not obvious to me how to tweak this include file to reflect the default state of wasi-libc while also set the flags when in pthread mode.Is it possible to fix this so the variables aren't set in the default build?
The text was updated successfully, but these errors were encountered: