Rust on RTEMS

Joel Sherrill joel at rtems.org
Sat Feb 13 16:13:11 UTC 2021


This was buried in another thread and I thought it was best separate.

There are now two options. LLVM Rust and GCC Rust.

LLVM Rust is the more mature and commonly used of the two. LLVM is supposed
to work on at least SPARC and RISC-V. There are cross build instructions
for Linux to another CPU Linux. There might be some real embedded cross
instructions but I didn't find them I didn't invest a lot looking so
finding out the cross status of their tool chain and instructions is a
first step. We haven't used LLVM on ARM AFAIK but I would consider testing
that to be able to use Rust in an architecture that they use already.
Reduces one odd risk.

Assuming you can figure out how to build Rust cross for an embedded target,
it should just be a matter of glueing their runtime to our POSIX APIs. That
should be similar to Linux. Then testing and debugging.

Overall I put the knowledge gap on the build process and likely an effort
sink in debugging and testing. Quite likely once a few years work, most
will work except for specific features. Fix one test and a handful more
will pass. Repeat until all passing

GCC on Rust isn't as mature but is worth tracking. When the authors
submitted FSF assignment paperwork, I emailed them. They are using it
embedded but I got the impression they didn't want us to touch it soon.

Personally I'd eventually love to see both but I would focus on the
standard LLVM Rust and how to compile it cross to a non-Linux target. That
would give a procedure more like a cross to RTEMS. Maybe they have
instructions and from there it should be straightforward plodding.

A bit of research and perhaps email to their community to ask some
questions would help size up the cross build situation.

--joel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210213/0975a880/attachment-0001.html>


More information about the devel mailing list