Uh oh!
There was an error while loading. Please reload this page.
Working asmjs and wasm targets - #36339
Conversation
rust-highfive
commented
Sep 8, 2016
(rust_highfive has picked a reviewer for you, use r? to override) |
brson
commented
Sep 8, 2016
I have lingering doubts about the modification to Thread::new: why just this function and not others, why an error instead of panic. |
brson
commented
Sep 8, 2016
One thing to note about this patch is that debugging crate test failures is quite difficult because many failures result in aborts, not clean test failures. Often this is because of fatal errors in emscripten for various reasons; perhaps some because of the utterly broken unwinding support. |
tomaka
commented
Sep 8, 2016
In my opinion we should pass Other than that, there's the question of |
There was a problem hiding this comment.
Should this be wasm32-unknown-emscripten?
There was a problem hiding this comment.
Oh wait nevermind, this isn't using the wasm backend of LLVM.
alexcrichton
commented
Sep 8, 2016
I've realized one further issue where we may not need to actually include the fastcomp backend, but I would prefer to land this ahead of that and we can decide on it later. |
bors
commented
Sep 11, 2016
☔ The latest upstream changes (presumably #36369) made this pull request unmergeable. Please resolve the merge conflicts. |
alexcrichton
commented
Sep 12, 2016
This may also want to use the support added in #36256 to figure out which node to run rather than always using |
brson
commented
Sep 14, 2016
I've got a patch to make the test changes, remove the Thread::spawn error handling, and fix libtest. Testing it now. Still have to investigate the jemalloc problems, though this can land without fixes for that. Still have to rebase to incorporate #36256. |
tomaka
commented
Sep 14, 2016
Please don't forget my remark. You may have linking errors and not realize it. |
brson
commented
Sep 15, 2016
@tomaka Thanks for the reminder. I will definitely add the |
2ea0371 to
80a1288Comparebrson
commented
Sep 16, 2016
brson
commented
Sep 16, 2016
@alexcrichton I think this is ready to go but still running tests. |
Doing this step for the target results in the build system trying to build rustc for asmjs, which doesn't work.
This is a hack to support building targets that don't support jemalloc alongside hosts that do. The jemalloc build is controlled by a feature of the std crate, and if that feature changes between targets, it invalidates the fingerprint of std's build script (this is a cargo bug); so we must ensure that the feature set used by std is the same across all targets, which means we have to build the alloc_jemalloc crate for targets like emscripten, even if we don't use it.
brson
commented
Sep 30, 2016
I've confirmed this build works with the smaller LLVM patch. |
brson
commented
Sep 30, 2016
@bors r=alexcrichton |
bors
commented
Sep 30, 2016
📌 Commit afa72b5 has been approved by |
bors
commented
Oct 1, 2016
⌛ Testing commit afa72b5 with merge 8b00355... |
Working asmjs and wasm targets This patch set results in a working standard library for the asmjs-unknown-emscripten and wasm32-unknown-emscripten targets. It is based on the work of @badboy and @rschulman. It does a few things: - Updates LLVM with the emscripten [fastcomp](rust-lang/llvm#50) patches, which include the pnacl IR legalizer and the asm.js backend. This patch is thought not to have any significant effect on existing targets. - Teaches rustbuild to correctly link C code with emscripten - Updates gcc-rs to work correctly with emscripten - Teaches rustbuild to run crate tests for emscripten with node - Modifies Thread::new to return an error on emscripten, to facilitate debugging a common failure mode - Modifies libtest to run in single-threaded mode for emscripten - Ignores a host of tests that don't work yet, mostly dealing with threads and I/O - Updates libc with wasm32 definitions (presently the same as asmjs) - Adds a wasm32-unknown-emscripten target that feeds the output of LLVM's asmjs backend through emcc to generate wasm Notes and caveats: - This is only known to work with `--enable-rustbuild`. - The wasm32 target can't be tested correctly yet because of issues in compiletest and limitations in node emscripten-core/emscripten#4542, but hello.rs does seem to work when run on node via the binaryen interpreter - This requires an up to date installation of the emscripten sdk from its incoming branch - Unwinding is very broken - When enabling the emscripten targets jemalloc is disabled for all targets, which results in test failures for the host Next steps are to fix the jemalloc issue, start building the two emscripten targets on the auto builders, then start producing nightlies. #36317 tracks work on this. Fixes#36515Fixes#36515Fixes#36356
This patch set results in a working standard library for the asmjs-unknown-emscripten and wasm32-unknown-emscripten targets. It is based on the work of @badboy and @rschulman.
It does a few things:
Notes and caveats:
--enable-rustbuild.Next steps are to fix the jemalloc issue, start building the two emscripten targets on the auto builders, then start producing nightlies.
#36317 tracks work on this.
Fixes#36515
Fixes#36515
Fixes#36356