-
Notifications
You must be signed in to change notification settings - Fork 203
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
Thread-related asserts trigger in C++ even when targeting thread-enabled WASI #558
Comments
It looks like passing |
To be fair portable usage of pthreads requires passing |
Making
|
Compiling a simple
hello world
program in C++ while targetingwasm32-wasip1-threads
triggers an assertion here:wasi-libc/libc-top-half/musl/include/pthread.h
Lines 91 to 100 in 574b88d
This seems wrong because this mode of WASI does have threads enabled (unless I'm misunderstanding the meaning of the
-threads
suffix).To reproduce:
This produces:
Error Log
Of course, passing
-D_WASI_EMULATED_PTHREAD
toclang++
allows compilation to succeed, but it doesn't seem like this should be necessary.Moreover, the message about
-lwasi-emulated-pthread
is also misleading. This library is not available forwasm32-wasip1-threads
, so following the error message blindly leads to a linking error too.The ideal solution here would be to make sure that the assertion doesn't fire when targeting a WASI mode with threads enabled. If that's not doable, then ideally the message shouldn't erroneously suggest using
-lwasi-emulated-pthread
when it isn't needed and will lead to a linking error.Related: #518, #518 (comment)
The text was updated successfully, but these errors were encountered: