[PATCH] D81689: [WebAssembly] New-style command support

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 09:03:15 PDT 2022


sbc100 added a comment.

In D81689#3611504 <https://reviews.llvm.org/D81689#3611504>, @yamt wrote:

> there are use cases for a command to export non-main functions.
> eg. malloc/free stuff mentioned in https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/memory_tune.md
> this change broke them.
> for my very specific case it can be worked around eg. by "-mexec-model=reactor -emain". but i feel it isn't a right thing to do.

I believe the correct fix is to reference `__wasm_call_ctors()` somewhere, either by calling it or by exporting.   A common way to do this is to have a `_start` function that calls `__wasm_call_ctors` and then `main`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81689/new/

https://reviews.llvm.org/D81689



More information about the llvm-commits mailing list