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

Support for imported functions that aren't provided by wasi #4

Open
paulbatum opened this issue Jul 25, 2019 · 4 comments
Open

Support for imported functions that aren't provided by wasi #4

paulbatum opened this issue Jul 25, 2019 · 4 comments

Comments

@paulbatum
Copy link

I might be missing something but I can't figure out how to load a module that has a set of imports that look like this:

  (import "env" "myfunc" (func $myfunc (type $t1)))
  (import "wasi_unstable" "fd_close" (func $__wasi_fd_close (type $t2)))
  (import "wasi_unstable" "fd_seek" (func $__wasi_fd_seek (type $t3)))
  (import "wasi_unstable" "fd_fdstat_get" (func $__wasi_fd_fdstat_get (type $t4)))
  (import "wasi_unstable" "fd_write" (func $__wasi_fd_write (type $t5)))

The idea is that myfunc would be provided by a separate .NET assembly. I assume that gen_assembly would need to be modified to accept multiple assemblies for this to be possible?

@ericsink
Copy link
Owner

Yep, that is currently a limitation of gen_assembly. :-(

@NicolasDorier
Copy link

@paulbatum I think I solved it long ago with wabt (can take a look to https://github.com/NicolasDorier/NBitcoin.Secp256k1/blob/master/Dockerfile)

I have vague memory about what I did, but I think in my solution, there is a proper implementation of wasi functions provided by the sdk I use.

@NicolasDorier
Copy link

I need to try again with new wasn2cil version.

@NicolasDorier
Copy link

NicolasDorier commented Jul 26, 2019

Either that, or I ended up removing trace of printf in my code so those get never called. I think they were the source of the dependencies.

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

3 participants