Trying to cross-build any package with rust for armv7 targets, such as the CHOST used by Gentoo profile (armv7a-unknown-linux-musleabihf) results in this error: Error loading target specification: Could not find specification for target "armv7a-unknown-linux-musleabihf". Run `rustc --print target-list` for a list of built-in targets The rust supported targets are armv7 (without the "a" at the end). The matching target for the Gentoo profile in the example above would be "armv7-unknown-linux-musleabihf". Reproducible: Always Steps to Reproduce: Install crossdev -t armv7a-unknown-linux-musleabihf. Use armv7a-unknown-linux-musleabihf-emerge to install a rust package, such as librsvg. Actual Results: See error in Description. Expected Results: Rust package installed by Gentoo should be patched to support all target tuples in use by Gentoo profiles. Why this is important: - Updating Gentoo requires lots of CPU and RAM. - Devboards such as Raspberry Pi and clones usually don't have much RAM or CPU. - Cross building packages for these systems on a desktop/server running Gentoo should be not only possible, but recommended and easy. - Without librsvg, there's no GTK and no desktop.
Check rust ebuild for how to add custom targets. You have to install crossdev env (which you did already) and then rebuild host rust with extra targets.
https://bugs.gentoo.org/679878 Check here too. cargo.eclass is not ready to handle complex packages that link to non rust libraries, but works for cross merging simple rust only things *** This bug has been marked as a duplicate of bug 679878 ***