<div dir="ltr"><div>I've finally had more time to play with this. It seems that mipsel-unknown-linux-uclibc works! I've been able to run software built with it on a real hardware device, although it's very crashy (all arithmetic operations seem to crash with illegal instruction- probably I didn't configure my toolchain right or there's a Rust issue...).</div><div><br></div><div>I would suggest removing the limitation on uclibc... perhaps with a big warning flag, though, as I haven't managed to build complex, stable software.</div><div><br></div><div>I've written a bit about the process at:</div><div><br></div><div><a href="https://users.rust-lang.org/t/trying-to-compile-rust-sdl-stuff-for-a-rg300-console-buildroot-mipsel-uclibc/36722">https://users.rust-lang.org/t/trying-to-compile-rust-sdl-stuff-for-a-rg300-console-buildroot-mipsel-uclibc/36722</a></div><div><a href="https://github.com/alexpdp7/retrofw2-rust">https://github.com/alexpdp7/retrofw2-rust</a></div><div><br></div><div>Cheers,</div><div><br></div><div>Álex<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 20, 2020 at 5:31 PM Alex Corcoles <<a href="mailto:alex@corcoles.net">alex@corcoles.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi!<br></div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The RUSTC_TARGET_NAME variable is defined in <a href="http://rustc.mk" rel="noreferrer" target="_blank">rustc.mk</a> only if the symbol<br>
BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS is selected. This symbols is<br>
used to ensure all the conditions to build a rust package are met. One<br>
of them is that the toolchain is glibc-based. This is required, because<br>
the standard library provided by the pre-built host Rust toolchain is<br>
built against glibc.<br>
<br>
In your defconfig, the toolchain is uclibc-based and the host Rust<br>
toolchain is built from source.<br>
<br>
Hence BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS is not defined and so<br>
is RUSTC_TARGET_NAME.<br>
<br>
So there is a bug: the restriction on having a glibc-based toolchain<br>
should apply either when using a pre-built rust toolchain or building<br>
one from source. I'll see how to fix it.<br>
<br>
The list of supported platforms [1] mentions GNU glibc and musl, but not<br>
uclibc. Does the build with your defconfig and patch successful?<br>
<br>
[1] <a href="https://forge.rust-lang.org/release/platform-support.html" rel="noreferrer" target="_blank">https://forge.rust-lang.org/release/platform-support.html</a><br></blockquote><div><br></div><div>I think I built it successfully after introducing my hack, but as far as I understand, it is not guaranteed to build in the future (and the opposite is true, perhaps if it doesn't build today, it will tomorrow). In the link you sent, mipsel-unknown-linux-uclibc is Tier 3 with std.</div><div><br></div><div>If I have some time I will play around with it and see you some results.</div><div><br></div><div>IMHO, perhaps you should hide non Tier-1 platforms behind an "enable this option for non-Tier 1 Rust builds which are not guaranteed to work", or something like that.</div><div><br></div><div>Cheers,</div><div><br></div><div>Álex<br></div></div><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div><span style="font-family:monospace,monospace">   ___<br></span></div><div><span style="font-family:monospace,monospace"> {~._.~}</span></div><div><span style="font-family:monospace,monospace">  ( Y )<br></span></div><div><span style="font-family:monospace,monospace"> ()~*~()  <span>mail: alex at corcoles dot net</span></span></div><div><span style="font-family:monospace,monospace"> (_)-(_)  <a href="http://alex.corcoles.net/" target="_blank">http://alex.corcoles.net/</a></span></div><div><br></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><span style="font-family:monospace,monospace">   ___<br></span></div><div><span style="font-family:monospace,monospace"> {~._.~}</span></div><div><span style="font-family:monospace,monospace">  ( Y )<br></span></div><div><span style="font-family:monospace,monospace"> ()~*~()  <span>mail: alex at corcoles dot net</span></span></div><div><span style="font-family:monospace,monospace"> (_)-(_)  <a href="http://alex.corcoles.net/" target="_blank">http://alex.corcoles.net/</a></span></div><div><br></div></div></div></div></div></div>