Created
October 11, 2018 05:02
-
-
Save yopito/e7b86aca2ffa4c833fd420d651bcf2e8 to your computer and use it in GitHub Desktop.
rust crossbuild fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Working within an xbps-src chroot: | |
$ xbps-query -p pkgver rust | |
rust-1.28.0_2 | |
$ xbps-query -p pkgver -s cross | |
cross-aarch64-linux-gnu-0.28_1: cross-aarch64-linux-gnu-0.28_1 | |
cross-aarch64-linux-gnu-libc-0.28_1: cross-aarch64-linux-gnu-libc-0.28_1 | |
following https://github.com/japaric/rust-cross#cross-compiling-with-rustc: | |
$ cat hello.rs | |
fn main() { | |
println!("Hello, world!"); | |
} | |
native build is fine: | |
$ rustc hello.rs && ./hello | |
Hello, world! | |
rustc available cross-build targets for aarch64: | |
$ rustc --print target-list | grep aarch64 | |
aarch64-linux-android | |
aarch64-unknown-cloudabi | |
aarch64-unknown-freebsd | |
aarch64-unknown-fuchsia | |
aarch64-unknown-linux-gnu | |
aarch64-unknown-linux-musl | |
aarch64-unknown-openbsd | |
1s crossbuild try: | |
$ rustc --target=aarch64-unknown-linux-gnu hello.rs | |
error[E0463]: can't find crate for `std` | |
| | |
= note: the `aarch64-unknown-linux-gnu` target may not be installed | |
error: aborting due to previous error | |
For more information about this error, try `rustc --explain E0463`. | |
2nd build try: | |
$ rustc --target=aarch64-unknown-linux-gnu -C linker=aarch64-linux-gnu-gcc hello.rs | |
error[E0463]: can't find crate for `std` | |
| | |
= note: the `aarch64-unknown-linux-gnu` target may not be installed | |
error: aborting due to previous error | |
For more information about this error, try `rustc --explain E0463`. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have to provides the necessary paths that are provided since install rust for crossbuilding too:
check it's fine: