For cross compiling, you need to keep using stable-x86_64-unknown-linux-gnu matching your current host, but then rustup target add armv7-unknown-linux-gnueabihf to get rust-std for your target.
You will also need a cross-compile cc for linking -- again built to run on your x86_64 host but with libraries for the target.
Still trying to make sense of some things. Was trying a build of the app on the target when I got the familiar 'Exec format error' telling me the binary was not for the target.
$ cat .cargo/config
[target.armv7-unknown-linux-gnueabihf]
ar = "arm-dey-linux-gnueabi-gcc-ar"
linker = "gcc-sysroot"
[build]
rustflags = ["-C", "prefer-dynamic"]
So this is what was there before, and I am not inclined to change it, but make it work.
in the config file. But how to tell rust to invoke gcc-sysroot is a mystery to me. That file is nowhere on my system. And yes, I understand this is usually a define like
SYSROOT=/home/user/sysroot where several toolchains can exist, and RUST will try to match to the proper gcc compiler that would fit the [target=arm7-unknown-linux-gnuabihf]
target.