RFH: How to cross-compile rustc on openSUSE

Hello! I'm currently trying to cross-compile the Rust compiler on openSUSE but I'm running into the problem that the build system wants to invoke the cross-gcc compiler with the naming scheme $ARCH-linux-gnu-gcc where ARCH is the target architecture. However, on openSUSE, the cross-compiler prefix is $ARCH-suse-linux- which is why the build system can't find the cross-compiler although it has been installed. Does anyone know how to tell Rust's build system to use the proper cross-compile prefix, similar to the CROSS_COMPILE environment variable that the Linux kernel uses? Configuring the Rust compiler with "--host=$ARCH-suse-linux" doesn't work either. Thanks, Adrian

Hi! On 9/29/21 17:18, Jan Engelhardt wrote:
Thanks! Unfortunately that doesn't get me very far as openSUSE doesn't ship any libraries for cross-development, just the pure toolchain. So trying to build anything else than the kernel or bare-metal stuff fails. I guess I'm stuck with Debian for these tasks. Adrian

For targeting mingw-w64 we've been using a custom `config.toml` file under Arch Linux. See https://doc.rust-lang.org/cargo/reference/config.html and https://aur.archlinux.org/cgit/aur.git/tree/mingw-config.toml?h=mingw-w64-ru... for a concrete example. Not sure whether that's the best/easiest way to do it, though. Best Regards Marius

Hi! On 9/29/21 17:18, Jan Engelhardt wrote:
Thanks! Unfortunately that doesn't get me very far as openSUSE doesn't ship any libraries for cross-development, just the pure toolchain. So trying to build anything else than the kernel or bare-metal stuff fails. I guess I'm stuck with Debian for these tasks. Adrian

For targeting mingw-w64 we've been using a custom `config.toml` file under Arch Linux. See https://doc.rust-lang.org/cargo/reference/config.html and https://aur.archlinux.org/cgit/aur.git/tree/mingw-config.toml?h=mingw-w64-ru... for a concrete example. Not sure whether that's the best/easiest way to do it, though. Best Regards Marius
participants (4)
-
Aaron Puchert
-
Jan Engelhardt
-
John Paul Adrian Glaubitz
-
Marius Kittler