Stream: wasmtime

Topic: wasm-c-api examples


view this post on Zulip Pedro Fonseca (Jul 13 2020 at 15:18):

Hi there! WASM noob here. This is probably a stupid question but I can't compile the examples included in the wasm-c-api directory. I followed the instructions under the "Implementation" section of the README but I get a bunch of linkage errors. Any clues as to what I'm doing wrong? Thanks :D

view this post on Zulip Alex Crichton (Jul 13 2020 at 15:20):

@Pedro Fonseca can you gist the linker errors that you're seeing?

view this post on Zulip Pedro Fonseca (Jul 13 2020 at 15:25):

For instance:

/<path_to_wasmtime>/wasmtime/crates/c-api/wasm-c-api/src/wasm-v8.cc:1097: undefined reference to `v8::wasm::object_isolate(v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> > const&)'

view this post on Zulip Pedro Fonseca (Jul 13 2020 at 15:29):

https://gist.github.com/pmvfonseca/f7f9d8d79d57275e3733208e9985f80e

wasm-c-api linker errors. GitHub Gist: instantly share code, notes, and snippets.

view this post on Zulip Alex Crichton (Jul 13 2020 at 15:33):

@Pedro Fonseca hm that looks like you're buliding the v8 implementation of the C API and lnking to that

view this post on Zulip Alex Crichton (Jul 13 2020 at 15:34):

I'm not sure how you built the C API?

view this post on Zulip Pedro Fonseca (Jul 13 2020 at 15:38):

I followed the README:

* See `Makefile` for build recipe. Canonical steps to run examples:

  1. `make v8-checkout`
  2. `make v8`
  3. `make all`

view this post on Zulip Alex Crichton (Jul 13 2020 at 15:50):

@petr

view this post on Zulip Alex Crichton (Jul 13 2020 at 15:50):

@Pedro Fonseca oh that's the submodule, for Wasmtime you'd want to read the docs

view this post on Zulip Alex Crichton (Jul 13 2020 at 15:50):

https://bytecodealliance.github.io/wasmtime/c-api/

view this post on Zulip Pedro Fonseca (Jul 13 2020 at 15:54):

I was trying to use the C++ bindings which is why I was looking at the examples in the wasm-c-api submodule. I guess I'll look at Wasmtime's C examples instead . Thanks for the help :)

view this post on Zulip Alex Crichton (Jul 13 2020 at 15:56):

ah yeah at this time we don't have C++ bindings

view this post on Zulip Alex Crichton (Jul 13 2020 at 15:56):

the ones in the upstream header I suspect are tied to v8


Last updated: Dec 23 2024 at 14:03 UTC