Closed kpp closed 5 years ago
WASM/WASI modules can be created by running the dist-build/wasm32-wasi.sh
build script.
This requires a recent LLVM toolchain, as well as the builtins.
Pre-built modules for stable versions can be downloaded from the Azure Pipelines CI (ex: https://jedisct1.visualstudio.com/Libsodium/_build/results?buildId=124 - Then click on "Artifacts").
WASM and WASI are still moving targets, so these pre-built modules are not distributed with other files for now.
Thanks. I compiled it locally with the help of your azure script. Also I downloaded the artifact from the build. The question is how do I use libsodium-wasm32-wasi/lib/libsodium.a? It is an ar archive not a .wasm file.
.wasm
files are applications, where everything has been linked already.
The ar
archive contains WebAssembly objects. When using rust with the wasm32-wasi
target, you should be able to link it like on other platforms.
Thanks. I'll try.
WASM and WASI are still moving targets, so these pre-built modules are not distributed with other files for now.
Why are they moving? What's left?
Pretty much everything is currently in flux, including the memory model and how functions are represented. WASI in its current form is also just a prototype.
Making an efficient common representation for all languages and all platforms is quite a big task.
I just tried a simple Rust example linking the wasm libsodium.a
file and calling sodium_init()
. It links without any problem, and the resulting wasm
file runs fine.
In https://github.com/sodiumoxide/sodiumoxide/issues/347 we want to embed libsodium.wasm into sodiumoxide. Where can I find prebuilt binaries for wasm?