Skip to content
New issue

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

how to import wasm env function? #55

Closed
dengliangjun opened this issue Apr 19, 2021 · 1 comment
Closed

how to import wasm env function? #55

dengliangjun opened this issue Apr 19, 2021 · 1 comment

Comments

@dengliangjun
Copy link

I use emcc to compile a wasm file.
the wasm file import many external functions, such as "env"."memset", env.memcpy and so on. How can I correctly import those functions. whether there are some base file or lib that I can directly import them?
I have read examples, no otherelse complex examples.
thanks for your reading. I hope get your help. thanks.

@alexcrichton
Copy link
Member

Thanks for the report! You may not get a ton of success using emcc output running in Wasmtime though since that's primarily intended to run on the web AFAIK. You can, however, define imported functions using a Linker to instantiate modules. There's nothing built-in, however, to instantiate modules with, so you'd have to provide a custom implementation of all of these intrinsics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants