Open konsumer opened 10 months ago
Ah, I see this I will try to set it up.
Update: still seems to be a problem.
extern const char** environ;
const char** args;
args = argv + 1;
web49_wasi_t* wasi = web49_wasi_new(args, environ);
web49_interp_add_import_func(&interp, wasi, &web49_main_import_func);
Even compiling miniwasm and running on this code:
#include "stdio.h"
int main() {
printf("hello!\n");
printf("You should see a newline at end of both of these lines, and no memory-dump.\n");
return 0;
}
compiled like this:
clang test.c --target=wasm32-wasi --sysroot=${WASI_SYSROOT} -Oz -std=c11 -o test.wasm
does not output newlines:
./bin/miniwasm test.wasm
hello!You should see a newline at end of both of these lines, and no memory-dump.
Versions:
(in debian:latest docker)
Linux deda87241c50 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 GNU/Linux
Debian clang version 14.0.6
Mac M1 running 13.5.2 (22G91)
Apple clang version 14.0.0 (clang-1400.0.29.202)
I am using this to route WASI calls to
web49_api_wasi
and for a
printf
from the wasm, it seems to just output huge chunks of memory. Do I need to put more instate
?