-
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
Building with THREAD_MODEL = posix #100
Comments
We only support |
Building with THREAD_MODEL=posix would mean the resulting binary would only be runnable on the VM that supports the threads proposal: https://github.com/WebAssembly/threads. Currently the only place I know that that is supported by default is in chrome or chromium-derived browsers. Presumably as well as THREAD_MODEL=posix you would also want access to a pthreads library which wasi-sdk/wasi-libc doesn't currently provide and some low level syscalls for thread creation and destruction which are not currently part of WASI. Having said all that, perhaps you don't actually required threads, and in this case I don't see why llvm shouldn't be able to lower away TLS accesses just like does atomics. I actually a little surprised that it doesn't. |
I believe wasm backend in LLVM 8 doesn't have TLS support; it was added in LLVM 9. And also, as others have noted, |
@Shillaker, are you looking for threading support or would you be OK the compiler simply compiling TLS to regular global data (i.e. better support THREAD_MODEL = single)? For the later it sounds like you could try LLVM 9. For the former, there is more work do be done. |
Thanks for the quick and detailed responses. Sorry I should have been clearer before, the answer is more the latter. I'm doing some research for which I'd like to compile some legacy pthread-based code to wasm and produce a binary that makes all the "normal" thread-related syscalls. As a result I don't need a compliant VM, just something that compiles. I didn't know about the LLVM 9 TLS support so I'll have a play with that and try to include standard pthreads from musl. Thanks again for the info, very much appreciated! |
Hi all,
I can build the project just fine using both the standard LLVM 8 toolchain and prebuilt wasi-sdk, however, when I set
THREAD_MODEL = posix
in the Makefile I get the following error:Before I start spending more time on it, is
THREAD_MODEL = posix
expected to work in the first place or is it not recommended?I'm running on standard Ubuntu 18.04.3 LTS.
Cheers
The text was updated successfully, but these errors were encountered: