Closed matthewbauer closed 4 years ago
The main problem is the custom musk fork. I suspect getting a clang/musl/static stdenv is reasonably upstreamable, and agnostic of wasm. The changes to musl are specific to wasm, and are pretty extremely minimal. I think upstreaming the wasm stages to nixpkgs sometime soon would be a great goal.
Yeah - the "musl" fork works as the libc for wasm?
It would be really nice to get a "llvm-cross" option in Nixpkgs so that we can seamlessly switch between the two. But, WebAssembly in general I think could be a killer feature for Nixpkgs! Packaging the musl fork as something like musl-wasm
would be reasonable.
I have a wip branch here: https://github.com/matthewbauer/nixpkgs/commits/wasm
Mainly trying to get a fully LLVM based toolchain.
It is great to have musl
/wasi-lib-c
based compilation available in upstream nixpkgs, but it cannot be used by WebGHC
as it is missing many pieces necessary to compile the RTS
and more importantly the libraries (like pthread.h
, process
).
So for now its better to continue to use our own musl
fork with the custom webabi
support.
Also would like to mention here that another PR has been upstreamed here https://github.com/NixOS/nixpkgs/pull/92168
Now the remaining bits are related to the target triple (wasm32-unknown-unknown-wasm
) and actual cross compilation using the musl
fork. But I dont expect these to get upstreamed.
How hard is it to upstream this to Nixpkgs? Specifically the wasm / clang cross stdenv.