Skip to content

Commit

Permalink
doc/build_wasm_app.md: Mention a glitch with LLVM 13 and later (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt authored Jun 28, 2022
1 parent 625d591 commit a67c1c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/build_wasm_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ Firstly if libc-builtin (-nostdlib) mode meets the requirements, e.g. there are

Most of the above methods are also available for libc-wasi mode, besides them, we can export malloc and free functions with `-Wl,--export=malloc -Wl,--export=free` option, so WAMR runtime will disable its app heap and call the malloc/free function exported to allocate/free the memory from/to the heap space managed by libc.

Note: wasm-ld from LLVM 13 and later automatically inserts dtor calls
for exported funtions. It breaks the malloc/free export mentioned above.
A workaround: Add `-Wl,--export=__wasm_call_ctors`, which happens to
prevent the automatic insertions for the current implementation.

## 3. Build wasm app with pthread support

Please ref to [pthread library](./pthread_library.md) for more details.
Expand Down

0 comments on commit a67c1c1

Please sign in to comment.