-
-
PortPilot: port C/C++ libraries to QNX 8.0 and run their own tests on QNX
-
Report: 20 libraries built for x86_64 and aarch64le; 1130 of 1469 test entries pass on a QNX 8.0 QEMU target
-
Test triage on QNX: two one-line fixes took Mbed TLS from 0 to 134 passing test suites
-
AI build patch: Cyclone DDS's QNX netstat code moved from io-pkt devctl to getifaddrs for QNX 8 io-sock
Inspiration
Most of the libraries an embedded team reaches for (TLS, compression, messaging, serialisation, solvers) were never
built for QNX. Porting one is rarely hard, but it is slow: the same dozen fixes come up again and again (_QNX_SOURCE,
-lsocket, no -lpthread, no epoll, headers that moved), and a library that compiles has still not been shown to
work on QNX until its own tests have run there. We wanted a tool that does the repetitive part, writes down every
change it makes, and does not call a port done until the tests have run on QNX 8.0.
What it does
Given a Git URL and a tag, PortPilot:
- cross-compiles the project with the QNX 8.0 toolchain (
qcc, GCC 12.2) through a generated CMake toolchain file, for x86_64 and aarch64le; - reads the build log and applies fixes from a catalogue of known QNX porting problems, then rebuilds;
- when no catalogue fix applies, asks a language model for a source patch, applies it, and keeps it only if the next build gets further; a patch that does not help is reverted and the model is told what it led to;
- puts the project's test executables, shared libraries and data on a QNX6 disk image, boots QNX 8.0 in QEMU (an
image built with the SDP's
mkqnximage) and runs the project's own CTest suite there, one result line per test; - for tests that build but fail on the target, asks the model for a fix and keeps it only if a rerun on the QNX VM passes more tests with no regressions;
- writes a report and a replayable recipe (flags, CMake arguments, patch) for every port.
How we built it
PortPilot is a Python tool that drives a Windows build host with QNX SDP 8.0 and QEMU (locally or through a worker
command). The build loop generates a CMake toolchain file for qcc, builds with Ninja, and matches the log against a
catalogue of fixes. The AI stage calls Claude through the Claude Code CLI with no tools: it gets the project's own
errors, the source around them and, for undefined symbols, the build-file lines that select the defining files; no QNX
SDP file content goes into the prompt. Target runs use the SDP's mkqnximage for the QEMU image, mkqnx6fsimg for the test
disk, and a post_start boot hook that runs the tests and powers the VM off. Hung tests are reported with each thread's
QNX kernel state from pidin; crashed ones with the dumper core file and slogger2 entries. A finished port can be installed
into a stage directory (--install) for later ports to build against (--needs); this is how other libraries' tests
get GoogleTest, cmocka and check.
Challenges we ran into
- Windows build hosts:
qccexpands CMake's link response file and startsldwith every object on the command line; past 32 KiB this fails as "spawn of ld failed: No such file or directory". PortPilot now hands the object list toldin its own response file. - Code generators that run on the build host leak build-host paths into target binaries. wolfSSL's generated
test_paths.hpoints the tests at the host's source directory, and Mbed TLS's generated test suites default to.\test_suite_x.datax. Both problems appear only when the tests run on QNX. - QNX 8.0 replaced the io-pkt network stack with io-sock. Cyclone DDS's QNX support used io-pkt's
devctlstatistics interface; PortPilot's AI stage rewrote that file againstgetifaddrs().
Accomplishments that we're proud of
- 23 open-source libraries now build for QNX 8.0 on x86_64 and aarch64le: backward-cpp, check, civetweb, cmocka, Cyclone DDS (core), fmt, GoogleTest, json-c, libarchive, libcbor, libcoap, libzmq, Mbed TLS, msgpack-c, nng, open62541, OSQP, Eclipse Paho MQTT C, ruckig, spdlog, uriparser, wolfSSL, yaml-cpp. Of these, only libzmq, GoogleTest and check already had a recipe in the public qnx-ports build files (checked 2026-11-03).
- Their own test suites ran on a QNX 8.0 x86_64 QEMU target: 1431 of 1761 CTest entries pass, including Mbed TLS 145/148, wolfSSL 2/2, libarchive 860/1137, open62541 127/146, libzmq 110/121, nng 53/63 (with its select poller), civetweb 43/50, json-c 27/28. With GoogleTest, cmocka and check ported first, uriparser, msgpack-c, libcbor, open62541 and civetweb build their test suites too; the first three pass all 34 of their entries. The demo video was recorded earlier, before these ports, the nng poller setting and the libarchive fix below, when 20 libraries built and 1130 of 1469 entries passed.
- Eight AI build patches were kept, each because the next build got further; test triage on the target took Mbed TLS from 0 to 134 passing suites with two one-line fixes and no regressions, and a QNX-only patch to libarchive's directory walker took its bsdtar tests from 21 to 65 of 80. For yaml-cpp and fmt the model answered UNFIXABLE: their failing cases compare against the C library's float formatting, and PortPilot does not change tests to make them pass.
What we learned
- A clean build says little about a port. wolfSSL, Mbed TLS and OSQP each built in one or two rounds, and their tests still failed on QNX because the build host's paths or path separators had been compiled into the test programs.
- A Windows build host adds its own porting problems: CRLF checkouts break shell-script tests, git symbolic links become small text files, CMake leaves empty files where SONAME links should be, and long link lines hit the 32 KiB command-line limit.
- The model's answers depended on what it was shown. For Cyclone DDS it only guarded the missing include until it saw
the whole 76-line file and was told that QNX 8 replaced io-pkt; for wolfSSL it answered UNFIXABLE until it saw the
template that generates
test_paths.h.
What's next for PortPilot
- Build drivers for Meson and Autotools projects.
- aarch64le target runs, once the image tooling has a QEMU aarch64 startup program.
- Sending accepted patches upstream.
Built with
Python, CMake, Ninja, QNX SDP 8.0 (qcc, mkqnximage, mkqnx6fsimg), QEMU, Claude (Claude Code CLI) for the AI patch stage