Created attachment 655320 [details] build.log cross compiling is a bit more difficult with rust based toolchain, but I do have all the good stuff from dev-lang/rust-1.44.1 ebuild, where cross compile support was added: /usr/lib/rustlib/armv7-unknown-linux-gnueabihf /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/liballoc-087b70cd2d297ed2.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libbacktrace-698ef7e9d7121d1c.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libbacktrace_sys-0128f7f675d4a1bc.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libcfg_if-c1fb262e10f4a55b.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libcompiler_builtins-aecc6e4a21d5e140.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libcore-f77799a6160efa8b.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libgetopts-5c1a21c5fa1a4296.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libhashbrown-d183254543f362a3.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/liblibc-5832215a09d35a39.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libpanic_abort-249c458b9f00b4ce.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libpanic_unwind-4680e8f6199cf34a.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libproc_macro-eee48bd6e1f309cb.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/librustc_demangle-fc7c4b1171918e72.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/librustc_std_workspace_alloc-c8d50701518d36d9.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/librustc_std_workspace_core-73399a53eb2a658e.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/librustc_std_workspace_std-685c18b995f72465.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libstd-0cdf160a91fd8fe7.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libstd-0cdf160a91fd8fe7.so /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libterm-f07413ab579ad791.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libtest-b82efea09e2cefc7.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libtest-b82efea09e2cefc7.so /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libunicode_width-986e8e7c245ab4d6.rlib /usr/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libunwind-8e55cc252b73ae83.rlib /usr/lib/rustlib/manifest-rust-std-armv7-unknown-linux-gnueabihf still, the ebuild fails to recognize it: error: failed to run `rustc` to learn about target-specific information Caused by: process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --target armv7a-unknown-linux-gnueabihf --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1) --- stderr error: Error loading target specification: Could not find specification for target "armv7a-unknown-linux-gnueabihf". Use `--print target-list` for a list of built-in targets make[2]: *** [Makefile:1761: librsvg_c_api.la] Error 101
Created attachment 655322 [details] output from emerge --info (cross-target)
CCing gyakovlev for potential advice
Restoring useful bug summary
Created attachment 655324 [details, diff] this patch works for me the new build system is a bit whacky, it seems to expect --host=${CHOST_default} when cross compiling with cross-emerge wrappers to find all of the cross compiler tools (gcc/g++/ar/nm) normally I'd expect --host to be a value of x86_64 when cross compiling from amd64 to armv7a, but little do I know it seems. maybe you can find a more fine tuned solution, but this patch is good enough for me: file /usr/armv7a-unknown-linux-gnueabihf/usr/lib/librsvg-2.so.2.47.0 /usr/armv7a-unknown-linux-gnueabihf/usr/lib/librsvg-2.so.2.47.0: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, stripped if you agree, please allow me some time to test with some more cross compile chains
!multilib_is_native_abi case already does a lot of that. If multilib_is_native_abi isn't false on cross-compiling (isn't it?), then maybe we can just do a logical OR there for cross-compiler too, and unconditionally add --host passing or something?
Created attachment 655326 [details, diff] reduced patch I removed the third line and got away with it. you see, this is really strange build system. It defines multilib as cross compiling, and for true cross-arch compiling it want's to see --host switch. and it seems to me that cross compiling from amd64 to armv7 doesn't pick up anything of the array behind if ! multilib_is_native_abi; then from line 57
Are you still hitting this with the latest version?
yes, cross compile is still broken because cargo.eclass doesn't provide the cross-linker.
Isn't there any bug report to track the issue for cargo.eclass? I couldn't find any one :/
The cargo eclass is now broken again with recent updates, old workaround (setting the linker) don't work anymore.
Maybe Rust team will know better about how to workaround/solve this crosscompilation issue Thanks
broken with this commit: https://github.com/gentoo/gentoo/commit/9e9c222fe930f6369f2192e4de0175afc21e1e7f errors are: = note: /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/portage/gnome-base/librsvg-2.57.3/work/librsvg-2.57.3-.arm/target/thumbv7neon-unknown-linux-gnueabihf/release/deps/rsvg_convert-5fe6e136a56bda61.rsvg_convert.15485973a5273b41-cgu.00.rcgu.o: relocations in generic ELF (EM: 40) /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/portage/gnome-base/librsvg-2.57.3/work/librsvg-2.57.3-.arm/target/thumbv7neon-unknown-linux-gnueabihf/release/deps/rsvg_convert-5fe6e136a56bda61.rsvg_convert.15485973a5273b41-cgu.00.rcgu.o: relocations in generic ELF (EM: 40) /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/portage/gnome-base/librsvg-2.57.3/work/librsvg-2.57.3-.arm/target/thumbv7neon-unknown-linux-gnueabihf/release/deps/rsvg_convert-5fe6e136a56bda61.rsvg_convert.15485973a5273b41-cgu.00.rcgu.o: relocations in generic ELF (EM: 40) /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/portage/gnome-base/librsvg-2.57.3/work/librsvg-2.57.3-.arm/target/thumbv7neon-unknown-linux-gnueabihf/release/deps/rsvg_convert-5fe6e136a56bda61.rsvg_convert.15485973a5273b41-cgu.00.rcgu.o: relocations in generic ELF (EM: 40) /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/portage/gnome-base/librsvg-2.57.3/work/librsvg-2.57.3-.arm/target/thumbv7neon-unknown-linux-gnueabihf/release/deps/rsvg_convert-5fe6e136a56bda61.rsvg_convert.15485973a5273b41-cgu.00.rcgu.o: relocations in generic ELF (EM: 40) /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/portage/gnome-base/librsvg-2.57.3/work/librsvg-2.57.3-.arm/target/thumbv7neon-unknown-linux-gnueabihf/release/deps/rsvg_convert-5fe6e136a56bda61.rsvg_convert.15485973a5273b41-cgu.00.rcgu.o: relocations in generic ELF (EM: 40) /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/portage/gnome-base/librsvg-2.57.3/work/librsvg-2.57.3-.arm/target/thumbv7neon-unknown-linux-gnueabihf/release/deps/rsvg_convert-5fe6e136a56bda61.rsvg_convert.15485973a5273b41-cgu.00.rcgu.o: relocations in generic ELF (EM: 40) will open a new bug, because this is a new regression