Cross compiling error

Is there an official tutorial for cross compiling for Rust? I've found a few articles or github repo online but trying to check any "official" guides first.

One particular problem I encountered is: I specified the following in <project>/.cargo/config.toml ,

linker = "arm-none-linux-gnueabihf-gcc"

but when I ran

cargo build --target armv7-unknown-linux-gnueabihf --release

it tries to call arm-linux-gnueabihf-gcc instead (when building crate ring). How can make sure cargo calls arm-none-linux-gnueabihf-gcc ?


You can specify the linker Rust uses using that configuration file. For specifying the compiler/linker that's used when compiling C, refer to the build scripts of the specific crates doing so.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.