* Jan Staněk: > Hi list, > in order to be able to compile WASM natively on Fedora, > I'm trying to package wasi-libc[1] to provide the Web Assembly System > Interface. > > [1]: https://github.com/WebAssembly/wasi-libc > > My trouble is that this is in essence a cross-compilation environment, > and I have zero experience in trying to package these. > Also, I did not have much luck in trying to find any related > documentation. Cc:ing Josh because Rust apparently already builds wasi-libc. I doubt that right now, one static build of wasi-libc will be able to support both the Rust use cases and the NodeJS use case. The versions will likely be different, and the WASI interfaces are still evolving. So if you package this separately, you probably should use paths with “nodejs” in the name. Another alternative would be to build wasi-libc from sources during the NodeJS build, with the wasi-libc source either packaged separatedly, or bundled with the NodeJS sources. The former is how Go and Rust source builds work in Fedora, so it's not that unusual. > Some issues I have run into so far: > > - This is a libc implementation, which would probably conflict with the > glibc package by default. Looking at musl, the solution seems to be to > install into `/usr/{target}` prefix (i.e. `/usr/wasm32-wasi/include`). > Not really sure how this works, any pointers appreciated. Note that wasi-libc swaps out musl's malloc for dlmalloc, which is licensed under the CC0 license, and this is no longer considered a Fedora-compatible software license. > - Clang seems to have issue with `-fstack-clash-protection` flag for the > `wasm32-wasi` target. What's the proper way to adjust these? You cannot use the Fedora build flags for WASI because it's not a GNU/Linux target. I don't know what WASI (or WebAssembly) do to emulate -fstack-clash-protection. In theory, compiling for WASI could produce explicit bounds checks for the addressable stack, which has to be visible in addressable memory for C/C++ compatibility. This is probably the only portable way to implement something like -fstack-clash-protection because WebAssembly is supposed to be portable to systems without a MMU. Even a more traditional implementation of stack clash protection would need support from the WASI layer because of the page size requirements. Thanks, Florian _______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue