Stream: general

Topic: building rust toolchain for wasm32-wasi


view this post on Zulip bstrie (Jul 21 2022 at 13:37):

I want to compile a Rust compiler that can target wasm32-wasi, I see in the config.toml that it expects me to specify a path to the wasm32-wasi sysroot. Where can I get this sysroot?

view this post on Zulip Dan Gohman (Jul 21 2022 at 13:39):

There's a sysroot tarbal in the wasi-sdk release.

Update to LLVM 14.0.4. Update wasi-libc to 30094b6ed05f19cee102115215863d185f2db4f0. Fix utimensat to avoid passing uninitialized values into WASI calls. Optimize memcpy etc. using bulk-memory Upd...

view this post on Zulip bstrie (Jul 21 2022 at 13:40):

great, thanks :)

view this post on Zulip Lann Martin (Jul 21 2022 at 13:41):

Just a sanity check: you are aware that rustup can usually provide this?

view this post on Zulip bstrie (Jul 21 2022 at 13:57):

@Lann Martin right, I'm hitting a bug in rustc that only manifests on wasm32-wasi, I'm trying to fix it :)

view this post on Zulip bstrie (Jul 21 2022 at 22:11):

I'm actually having some trouble with this, does anyone here build rustc with wasm32-wasi support? I have the sysroot, I have config.toml setup to point to it, and I'm building rustc with x build --target wasm32-wasi. I can see that it's building for wasm32-wasi, and I can see the artifacts in the build directory. But when I try to build anything with cargo +stage1 build --target wasm32-wasi, it tells me it can't find std. I'm baffled

view this post on Zulip bjorn3 (Jul 22 2022 at 05:48):

You need an additional --target with the host arch when building rustc. Otherwise build scripts and proc macros don't have a sysroot to compile against.


Last updated: Dec 23 2024 at 12:05 UTC