We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using this to route WASI calls to web49_api_wasi
web49_api_wasi
web49_env_func_t web49_main_import_func(void* state, const char* mod, const char* func) { printf("called: %s.%s\n", mod, func); if (strcmp(mod, "null0") == 0) { return web49_api_null0(state, mod, func); } else if (strcmp(mod, "wasi_snapshot_preview1") == 0) { return web49_api_wasi(state, mod, func); } fprintf(stderr, "Unhandled import: %s.%s\n", mod, func); return NULL; }
and for a printf from the wasm, it seems to just output huge chunks of memory. Do I need to put more in state?
printf
state
The text was updated successfully, but these errors were encountered:
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);
Sorry, something went wrong.
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)
No branches or pull requests
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
?The text was updated successfully, but these errors were encountered: