Need help with emscripten port

Based on @jer’s instructions I’ve started poking at the emscripten port again, and I’m very encouraged that we can get this across the finish line soon.

Here’s what I’ve done so far:

If you look at the fastcomp squash you’ll see that almost all the code is in two asmjs-specific subsystems: the pnacl legalizer, and the asmjs backend. There’s only a small amount of common code, minor fixes and optimizations. The whole patch applies cleanly to our branch. So that gives me a lot of hope that we can use a single LLVM build for all existing targets + emscripten, and that it can be maintained, at least until the wasm backend can replace it.

So I think the way is clear to get this landed and get builds out.

Next steps:

  • ignore-emscripten all the currently-failing tests.
  • Merge the fastcomp squash into the rust llvm fork. It may be worth pushing this to a temporary branch on the assumption that it’s not going to land easily in Rust, but I actually think this will go pretty smoothly.
  • Submit the PR to Rust that adds asmjs support.
  • Add an auto- builder that builds the asmjs target. We probably won’t start testing it right away because testing this target is quite slow.
  • Add a dist- builder to create the asmjs target packages.

Those steps have to happen sequentially and will result in in-tree support and release builds for asmjs (not wasm). I will today start as a background task finding and ignoring run-pass tests, but doing so for the full test suite will take time. If anybody wants to help please say so and jump in. This needs to happen fast.

You can get a working build by following @jer’s previously-linked instructions but substituting the repo’s I linked above, (sorry I haven’t submitted PR’s to @jer yet), and running tests with e.g.

python src/bootstrap/bootstrap.py --step check-rpass --target=asmjs-unknown-emscripten

In parallel, and starting right now, we can do the following:

  • Begin fixing the failing tests on emscripten
  • Add the wasm32-unknown-emscripten target to rustc. It will be almost the same as the asmjs target. For the initial implementation we will not use the wasm llvm backend, but instead use the asmjs backend and ask emcc to convert the asmjs IR to wasm. Thusly we will have wasm support.

Once the in-tree support has landed we can create a quest issue for fixing the broken emscripten tests, documenting how to run the tests and itemizing every one into its own bug, stir up community support to get everything working.

If anybody is interested in helping with any of these steps, please speak up; help is needed as always.

This is it. It’s on.

3 Likes