Skip to content

Commit ab2be6e

Browse files
authored
Adjust documentation of limitations in README (#591)
* Update for C++ Exceptions being supported. * Update the threading-related bits slightly. * Indicate that dynamic linking works but may not be as fully tested. * Networking works, just not on WASIp1.
1 parent 4ec0718 commit ab2be6e

1 file changed

Lines changed: 24 additions & 35 deletions

File tree

README.md

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -209,41 +209,30 @@ disabled in a configure step before building with WASI SDK.
209209

210210
## Notable Limitations
211211

212-
This repository does not yet support __C++ exceptions__. C++ code is supported
213-
only with -fno-exceptions for now.
214-
Work on support for [exception handling] is underway at the
215-
language level which will support the features.
216-
217-
[exception handling]: https://github.com/WebAssembly/exception-handling/
218-
219-
See [C setjmp/longjmp support] about setjmp/longjmp support.
220-
221-
[C setjmp/longjmp support]: SetjmpLongjmp.md
222-
223-
This repository experimentally supports __threads__ with
224-
`--target=wasm32-wasip1-threads`. It uses WebAssembly's [threads] primitives
225-
(atomics, `wait`/`notify`, shared memory) and [wasi-threads] for spawning
226-
threads. Note: this is experimental — do not expect long-term stability!
227-
228-
Note that the `pthread_*` family of functions, as well as C++ threading primitives
229-
such as `<atomic>`, `<mutex>`, and `<thread>` are available on all targets.
230-
Any attempt to spawn a thread will fail on `--target=wasm32-wasip1` or
231-
`--target=wasm32-wasip2`, but other functionality, such as locks, still works.
232-
This makes it easier to port C++ codebases, as only a fraction of code needs
233-
to be modified to build for the single-threaded targets.
234-
235-
Defining a macro `_WASI_STRICT_PTHREAD` will make `pthread_create`,
236-
`pthread_detach`, `pthread_join`, `pthread_tryjoin_np`, and `pthread_timedjoin_np`
237-
fail with a compile time error when building for single-threaded targets.
212+
* C++ exceptions are disabled by default. For more information see
213+
[CppExceptions.md].
214+
* C `setjmp`/`longjmp` require some extra configuration to get working, see
215+
[SetjmpLongjmp.md].
216+
* Most targets do not support spawning a thread. Experimental support for
217+
spawning threads is available with the `wasm32-wasip1-threads` target which
218+
uses [wasi-threads]. Note that the `pthread_*` family of functions, as well as
219+
C++ threading primitives such as `<atomic>`, `<mutex>`, and `<thread>` are
220+
available on all targets. Defining a macro `_WASI_STRICT_PTHREAD` will make
221+
`pthread_create`, `pthread_detach`, `pthread_join`, `pthread_tryjoin_np`, and
222+
`pthread_timedjoin_np` fail with a compile time error when building for
223+
single-threaded targets.
224+
* Dynamic linking [is supported][dylink] but not as fully baked as static
225+
linking. There might be obscure bugs in some situations related to dynamic
226+
linking.
227+
* The WASIp1 targets do not support networking, but WASIp2/WASIp3 support
228+
networking.
229+
* 64-bit linear memories (a "wasm64" target) are not supported at this time.
230+
Supporting this will require resolving [WebAssembly/component-model#22] first
231+
at which point it will be possible to add a `wasm64-wasip2` target. There are
232+
no plans to add support for `wasm64-wasi{,-threads,p1,p1-threads}` at this
233+
time.
238234

239235
[threads]: https://github.com/WebAssembly/threads
240236
[wasi-threads]: https://github.com/WebAssembly/wasi-threads
241-
242-
This repository does not yet support __dynamic libraries__. While there are
243-
[some efforts] to design a system for dynamic libraries in wasm, it is still in
244-
development and not yet generally usable.
245-
246-
[some efforts]: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
247-
248-
There is no support for __networking__. It is a goal of WASI to support
249-
networking in the future though.
237+
[dylink]: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
238+
[WebAssembly/component-model#22]: https://github.com/WebAssembly/component-model/issues/22

0 commit comments

Comments
 (0)