Rust application on QNX

I’m pretty new to Rust programming, but I was wondering if anyone has tried to compile a Rust program for QNX.


1 Like

I don’t have the answer but I am also very curious about the relation of Real Time OS and Rust.

It seems most Rust features would be really beneficial in hard Real time embedded environment : safety, close to the metal, no GC. It is a match made in heaven.

From my understanding, if you are using libstd, at some point, when you spawn a thread you are actually calling the OS implementation as seen in /src/libstd/sys (as well as other OS dependent feature)

So far I am not sure there is any plan to support anything else than Posix & Windows.

Probably at this point your options are to only depends from core.

But I am curious to know what would be the proper way to support a custom os. Relying on core + wrapping every specific call in a QNX crate ?

As far I understand a project like Redox is trying to develop a general purpose OS, but not a RT one.

Is there any plan to support at least once RTOS ?(The issue is the most popular one like QNX or Vxworks are proprietary and it is less easy to experiment with)

Did you make any progress on getting rust + QNX working? I have a project that would benefit from it too. Plan B is a rewrite in C++ :slight_smile:

It is not listed here.

Hi folks!

I just grabbed a 30-day trial of QNX 7 in order to determine if this is even possible since we were starting to adopt Rust at work yet have a requirement to support QNX as well as Linux. If anyone else is interested then maybe we can continue this conversation here or another thread. Or ping me on irc (photex).

Just a thought:

Rust can be built for bare metal, maybe you can set a custom target specification to specify what the rust can be built on.

and if you want and QNX can support std, you need to rebuild std for your platform

Do you plan to port LLVM to QNX

Well, at the time I started looking into this I was under the impression that llvm supported QNX already. They provide libc++ in QNX 7 so there is at least some comingling going on there.
In general QNX claims to be POSIX compliant which gives me the sense that it should be possible.

My current troubles at the moment are largely my ignorance. I don’t really know where to begin here. Should I just see if I can build Rust with the QNX toolchain first? Learn how to use xargo and try that approach?

There is a port of ancient llvm for qnx 6.5.0, see openqnx. That might give u an idea whst patches are required

1 Like

Awesome tip thanks!


Have you made any progress ?

Absolutely none. My trial expired before getting anywhere close and that was that. It’s still a big concern of mine but I’m honestly not sure this would be successful with QNX doing the work to bring LLVM to their platform. I personally don’t have the bandwidth or mandate from work to become a maintainer of an unofficial llvm and rust fork (nor would I want to for that matter). :wink:

@photex Thanks for your feedback.