Port Rust to VxWorks?

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?


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

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

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?


Wind River has switched primarily to LLVM for C/C++ in recent releases of VxWorks. Rust is supported in the most recent release.
Newer releases of VxWorks use newer compilers, try and convince your team to update, and resist the industry practice of living in the past simply because that was when the boards BSP was last updated.