Port Rust to VxWorks?


#1

I’m scoping the effort to add a new cross-compile target for Rust. Wind River has had some interest in Rust from customers wanting to develop certified system. Type safety with deterministic garbage collection makes Rust very attractive.

One of the 4 compilers we use with VxWorks is llvm, so I’m confident we can supply back-end for the toolchain. But after a couple hours looking though your github I’m not sure where the build vs run elements are?

I found https://github.com/rust-lang/libc and the OS bindings there look straight forward, VxWorks has enough POSIX APIs we might squeeze it under the unix tree?

But I’m sure that’s only the beginning.
What other elements do I need before I can use Rust with a new configuration tuple targeting a new OS?


#2

@kuhlenough you probably want to post this in Rust’s github issue tracker.


#3

The Rust team has generally been supportive of landing new platform support as Tier 3 platforms. See the forge for the different tiers of support.

Here are some relatively recent PRs that added new platforms:

If you run into any issues porting std to your “not-quite POSIX” platform, feel free to raise your issues with the Portability Working Group.

Xargo might be of interest to you.

To answer you specific questions:

Run elements:

Build elements:

  • everything (including std)

Good question. The portability WG wants to write a guide, but it’s not done yet. On a super high-level, the steps are:

  • Add the target definition to the compiler
  • Try compiling for your target, fixing all errors you encounter until you succeed

#4

My work uses VxWorks for part of our project. However we’ve been stuck with an ages old gcc 4.3.3. And many of the hard-to-fix bugs we get are due to things rust prevents. It would be nice to both use a modern compiler even if it’s too much technical risk to change languages. Is there some trick to getting LLVM working with VxWorks?

Also, any progress on getting Rust to work with VxWorks? And if you are successful, are you able to share your work for others?