Skip to content

What's the right argument should be added to host to build for wasm 32-unknown-unknown? #1145

Answered by jedisct1
asmmo asked this question in Q&A
Discussion options

You must be logged in to vote

Libsodium requires either the emscripten or wasi environments, as it's not even possible to generate random numbers in standalone WebAssembly.

To compile to WASI, the host argument should be wasm32-wasi, same as the compiler's target.

See the existing build script: https://github.com/jedisct1/libsodium/blob/master/dist-build/wasm32-wasi.sh

or the Rust code: https://github.com/jedisct1/libsodium-sys-stable/blob/f78deeb3254913bd05bf1f8c9a834168e9e2b89b/build.rs#L152-L160

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@asmmo
Comment options

@jedisct1
Comment options

Answer selected by asmmo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1145 on January 06, 2022 14:02.