I made a rustc build using this config:
[llvm] targets = "WebAssembly;X86" [build] target = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] [install] [rust] optimize = true debug = true codegen-units = 0 debug-assertions = true debuginfo-level = 2 [target.x86_64-unknown-linux-gnu] llvm-config = "/usr/bin/llvm-config-10" [dist]
but it fails with this error:
$ ~/rust/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc lib.rs --target=wasm32-unknown-unknown error: linker `rust-lld` not found | = note: No such file or directory (os error 2) error: aborting due to previous error
had the same, and was fixed by adding
rust.lld = true to config.toml
sidenote: it was not clear whether I should that or
rust.use-lld = true after reading descriptions in config.toml.example
Thanks @Tshepang Lekhonkhobe , that fixed the issue. I'm not getting
$ ~/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc lib.rs --target=wasm32-unknown-unknown error[E0463]: can't find crate for `core` | = note: the `wasm32-unknown-unknown` target may not be installed error: aborting due to previous error
I guess I have to add wasm to
host as well? (That's the only relevant field other than the ones I updated I think)
That doesn't seem to work -- huge wall of error printed
I found I had to
x.py clean to avoid errors
... no need to add wasm to host
clean -- if I add wasm to host then it doesn't build. If I don't I get a stage 2 build, but it fails with "can't find crate 'core'"
What x.py command did you use to build the compiler?
If you ran just
x.py build, then that built a stage2 compiler, and the wasm32 target is in the stage2 directory. The error message you posted says it ran the
stage1 compiler, which won't have the target.
Ahh, you're right. I can compile if I use stage 2 compiler thanks.
@osa1 if you want to use
stage1/bin/rustc w/ the non-host targets you presumably need to pass
--stage 1 to