The critical step in getting asmjs support is merging emscripten’s LLVM fork into Rust’s LLVM fork. Here’s how I suggest we do it:
- Take all of emscripten’s patches against LLVM and squash them into one. We don’t particularly care about the details of them, and I think it’ll be easier to manage if the history just says ‘emscripten patches’.
- Cherry-pick that patch onto our fork.
- Run the test suite on x86_64 and see if it still passes. It almost certainly won’t because issues mentioned previously.
- Make another patch that reverts whatever is breaking the x86/x86_64 backend in emscripten’s patches. Once we’ve got this figured out, we’ll have this patch in our pockets to re-apply every time we upgrade LLVM.
- Submit the combined LLVM branch to Rust’s LLVM fork.
- Submit a patch to Rust with the new LLVM branch. Once that merges successfully we’re pretty much home free.
At that point we need to fix any remaining bugs that prevent std from building for asmjs. Once we can build a std for asmjs we can begin publishing nightlies. Then all that’s lift is rooting out test suite failures and we’re off to the races.