From c1fa069dcbadb1bf4bb076408ad4ddbd77c7ede0 Mon Sep 17 00:00:00 2001 From: Mike Voronov Date: Fri, 24 Feb 2023 00:57:22 +0300 Subject: [PATCH] feat!: add workaround for wasi-libc reactor/command model (#13) * feat: add workaround for wasi-libc reactor/command model --- src/wrapper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wrapper.c b/src/wrapper.c index 0b17f75..e460795 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -65,7 +65,10 @@ void write_le_int(unsigned char *array, unsigned int offset, unsigned int value) array[offset + 3] = (value >> 24) & 0xff; } +extern void __wasm_call_ctors(); + int main() { - // the main purpose of this empty main is to initialize WASI subsystem + __wasm_call_ctors(); // for more details see https://github.com/WebAssembly/WASI/issues/471 + return 0; }