Stream: general

Topic: Emscripten Component Model Support


view this post on Zulip Mendy Berger (Sep 30 2025 at 04:29):

From to the component model book

You can also use your installed system or Emscripten clang by building with --target=wasm32-wasi, but you will need some artifacts from WASI SDK to enable and link that build target (see the text about libclang_rt.*.a objects in the WASI SDK README).

I don't think that this is actually true for p2. But if it is, can anyone give me any pointers on how to do this?

I'm trying to get a large project (onnx runtime) to compile to p2. It already has support for web via Emscripten, and I'm really struggling trying to add wasi-sdk as a new toolchain, so if I can somehow use Emscripten that would help a lot.

view this post on Zulip Till Schneidereit (Oct 01 2025 at 12:56):

you're right that Emscripten only supports wasip1, yes. Unfortunately even with that, it doesn't help make use of any Emscripten specific web support for a p2 target: the APIs and ABI are very different at that point, so I don't think you'll be able to get around the need for source changes

view this post on Zulip Mendy Berger (Oct 01 2025 at 13:01):

Thanks!
We gotta update the docs then

view this post on Zulip Till Schneidereit (Oct 01 2025 at 13:03):

agreed, yes. Mind filing an issue (or opening a PR)?

view this post on Zulip Mendy Berger (Oct 01 2025 at 13:06):

https://github.com/bytecodealliance/component-docs/pull/320

@tschneidereit wrote on the BA Zulip Emscripten only supports wasip1

view this post on Zulip Victor Adossi (Oct 01 2025 at 13:47):

Thanks for making the PR @Mendy Berger ! it's merged in now.

While I considered a bit about whether we should leave the hint that p1 support is available in there, it's probably worth just taking out to avoid misleading people

view this post on Zulip Mendy Berger (Oct 01 2025 at 13:47):

:thumbs_up:

view this post on Zulip Mendy Berger (Oct 01 2025 at 13:49):

I spent a lot of time trying to get it to work before realizing that it's not really true, so I agree with removing it


Last updated: Dec 06 2025 at 05:03 UTC