@ -209,41 +209,30 @@ disabled in a configure step before building with WASI SDK.
## Notable Limitations
## Notable Limitations
This repository does not yet support __C++ exceptions__ . C++ code is supported
* C++ exceptions are disabled by default. For more information see
only with -fno-exceptions for now.
[CppExceptions.md].
Work on support for [exception handling] is underway at the
* C `setjmp` /`longjmp` require some extra configuration to get working, see
language level which will support the features.
[SetjmpLongjmp.md].
* Most targets do not support spawning a thread. Experimental support for
[exception handling]: https://github.com/WebAssembly/exception-handling/
spawning threads is available with the `wasm32-wasip1-threads` target which
uses [wasi-threads]. Note that the `pthread_*` family of functions, as well as
See [C setjmp/longjmp support] about setjmp/longjmp support.
C++ threading primitives such as `<atomic>` , `<mutex>` , and `<thread>` are
available on all targets. Defining a macro `_WASI_STRICT_PTHREAD` will make
[C setjmp/longjmp support]: SetjmpLongjmp.md
`pthread_create` , `pthread_detach` , `pthread_join` , `pthread_tryjoin_np` , and
`pthread_timedjoin_np` fail with a compile time error when building for
This repository experimentally supports __threads__ with
single-threaded targets.
`--target=wasm32-wasip1-threads` . It uses WebAssembly's [threads] primitives
* Dynamic linking [is supported][dylink] but not as fully baked as static
(atomics, `wait` /`notify`, shared memory) and [wasi-threads] for spawning
linking. There might be obscure bugs in some situations related to dynamic
threads. Note: this is experimental — do not expect long-term stability!
linking.
* The WASIp1 targets do not support networking, but WASIp2/WASIp3 support
Note that the `pthread_*` family of functions, as well as C++ threading primitives
networking.
such as `<atomic>` , `<mutex>` , and `<thread>` are available on all targets.
* 64-bit linear memories (a "wasm64" target) are not supported at this time.
Any attempt to spawn a thread will fail on `--target=wasm32-wasip1` or
Supporting this will require resolving [WebAssembly/component-model#22] first
`--target=wasm32-wasip2` , but other functionality, such as locks, still works.
at which point it will be possible to add a `wasm64-wasip2` target. There are
This makes it easier to port C++ codebases, as only a fraction of code needs
no plans to add support for `wasm64-wasi{,-threads,p1,p1-threads}` at this
to be modified to build for the single-threaded targets.
time.
Defining a macro `_WASI_STRICT_PTHREAD` will make `pthread_create` ,
`pthread_detach` , `pthread_join` , `pthread_tryjoin_np` , and `pthread_timedjoin_np`
fail with a compile time error when building for single-threaded targets.
[threads]: https://github.com/WebAssembly/threads
[threads]: https://github.com/WebAssembly/threads
[wasi-threads]: https://github.com/WebAssembly/wasi-threads
[wasi-threads]: https://github.com/WebAssembly/wasi-threads
[dylink]: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
This repository does not yet support __dynamic libraries__ . While there are
[WebAssembly/component-model#22]: https://github.com/WebAssembly/component-model/issues/22
[some efforts] to design a system for dynamic libraries in wasm, it is still in
development and not yet generally usable.
[some efforts]: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
There is no support for __networking__ . It is a goal of WASI to support
networking in the future though.