qnx-porter 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qnx_porter-0.1.0/LICENSE +202 -0
- qnx_porter-0.1.0/PKG-INFO +345 -0
- qnx_porter-0.1.0/README.md +310 -0
- qnx_porter-0.1.0/pyproject.toml +57 -0
- qnx_porter-0.1.0/qnx_porter/__init__.py +2 -0
- qnx_porter-0.1.0/qnx_porter/__main__.py +3 -0
- qnx_porter-0.1.0/qnx_porter/agent.py +315 -0
- qnx_porter-0.1.0/qnx_porter/brokenlib/CMakeLists.txt +11 -0
- qnx_porter-0.1.0/qnx_porter/brokenlib/test_textutil.c +2 -0
- qnx_porter-0.1.0/qnx_porter/brokenlib/textutil.c +9 -0
- qnx_porter-0.1.0/qnx_porter/brokenlib/textutil.h +1 -0
- qnx_porter-0.1.0/qnx_porter/build.py +119 -0
- qnx_porter-0.1.0/qnx_porter/cli.py +72 -0
- qnx_porter-0.1.0/qnx_porter/crash.py +204 -0
- qnx_porter-0.1.0/qnx_porter/errors.py +112 -0
- qnx_porter-0.1.0/qnx_porter/fixes.py +285 -0
- qnx_porter-0.1.0/qnx_porter/linuxisms.py +248 -0
- qnx_porter-0.1.0/qnx_porter/llm.py +97 -0
- qnx_porter-0.1.0/qnx_porter/patches.py +102 -0
- qnx_porter-0.1.0/qnx_porter/qnx.py +275 -0
- qnx_porter-0.1.0/qnx_porter/target.py +270 -0
- qnx_porter-0.1.0/qnx_porter.egg-info/PKG-INFO +345 -0
- qnx_porter-0.1.0/qnx_porter.egg-info/SOURCES.txt +38 -0
- qnx_porter-0.1.0/qnx_porter.egg-info/dependency_links.txt +1 -0
- qnx_porter-0.1.0/qnx_porter.egg-info/entry_points.txt +2 -0
- qnx_porter-0.1.0/qnx_porter.egg-info/requires.txt +7 -0
- qnx_porter-0.1.0/qnx_porter.egg-info/top_level.txt +1 -0
- qnx_porter-0.1.0/setup.cfg +4 -0
- qnx_porter-0.1.0/tests/test_agent_loop.py +124 -0
- qnx_porter-0.1.0/tests/test_campaign.py +70 -0
- qnx_porter-0.1.0/tests/test_crash.py +119 -0
- qnx_porter-0.1.0/tests/test_crash_cpp.py +28 -0
- qnx_porter-0.1.0/tests/test_detect_and_toolchain.py +109 -0
- qnx_porter-0.1.0/tests/test_doctor.py +82 -0
- qnx_porter-0.1.0/tests/test_errors.py +57 -0
- qnx_porter-0.1.0/tests/test_fixes_and_patches.py +154 -0
- qnx_porter-0.1.0/tests/test_linux_isms.py +296 -0
- qnx_porter-0.1.0/tests/test_ports_csv.py +39 -0
- qnx_porter-0.1.0/tests/test_target_runner.py +93 -0
- qnx_porter-0.1.0/tests/test_upstream.py +14 -0
qnx_porter-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qnx-porter
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Port open-source C/C++ libraries to QNX 8.0 and prove each port by running the library's own tests on a QNX target
|
|
5
|
+
Author: The Good Engineers
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/thegoodengineers/qnx-porter
|
|
8
|
+
Project-URL: Source, https://github.com/thegoodengineers/qnx-porter
|
|
9
|
+
Project-URL: Documentation, https://github.com/thegoodengineers/qnx-porter/blob/main/SETUP.md
|
|
10
|
+
Project-URL: Issues, https://github.com/thegoodengineers/qnx-porter/issues
|
|
11
|
+
Keywords: qnx,qnx8,porting,cross-compile,embedded,rtos,cmake,meson,autotools,c,c++
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: C
|
|
17
|
+
Classifier: Programming Language :: C++
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
25
|
+
Classifier: Topic :: Software Development :: Embedded Systems
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
31
|
+
Requires-Dist: pyyaml>=5.4; extra == "test"
|
|
32
|
+
Provides-Extra: campaign
|
|
33
|
+
Requires-Dist: pyyaml>=5.4; extra == "campaign"
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
36
|
+
# qnx-porter
|
|
37
|
+
|
|
38
|
+
[](https://github.com/thegoodengineers/qnx-porter/actions/workflows/test.yml)
|
|
39
|
+
|
|
40
|
+
**Point it at an open-source C/C++ library. It builds the library for QNX 8.0, fixes what breaks,
|
|
41
|
+
and proves the port by running the library's own tests on a QNX 8.0 target.**
|
|
42
|
+
|
|
43
|
+
Built for the [QNX Global Hackathon](https://qnx.devpost.com/) (Developer Tooling & Host Tools) by
|
|
44
|
+
Chirag, Bhumika, Ayush and Abhijeet (The Good Engineers).
|
|
45
|
+
|
|
46
|
+
## Why it matters
|
|
47
|
+
- QNX 8.0 is free for non-commercial use, but most open-source C/C++ libraries have never been built
|
|
48
|
+
for it. QNX runs its own ports site ([oss.qnx.com](https://oss.qnx.com)) and a prize category for ports,
|
|
49
|
+
because every missing library is a reason a team picks another OS.
|
|
50
|
+
- Porting is repetitive: the same missing headers, the same `-lsocket`, the same Linux-only calls,
|
|
51
|
+
library after library. That part should be automatic, and every change should be reviewable.
|
|
52
|
+
- A port that compiles is not a port. qnx-porter counts a library as ported only when its own test
|
|
53
|
+
suite runs on QNX 8.0.
|
|
54
|
+
|
|
55
|
+
## Why C and C++
|
|
56
|
+
**QNX itself is built for C and C++.** QNX OS for Safety 8.0 ships C and C++ toolchains classified for ISO 26262
|
|
57
|
+
and IEC 61508, plus a certified C library and C++ library
|
|
58
|
+
([QNX OS for Safety 8.0](https://qnx.software/en/software/products-and-solutions/qnx-os-and-os-for-safety),
|
|
59
|
+
[certified tools](https://qnx.software/en/software/technologies/safety-certified/certified-tools),
|
|
60
|
+
[product brief](https://qnx.software/content/dam/qnx-xwalk/pdf/product-briefs/qnx-os-for-safety-product-brief.pdf)).
|
|
61
|
+
The OS's own interfaces, such as the C library reference, resource managers and message passing, are C APIs.
|
|
62
|
+
|
|
63
|
+
**Other languages stand on C libraries.** Python's [`zlib`](https://docs.python.org/3/library/zlib.html) and
|
|
64
|
+
[`sqlite3`](https://docs.python.org/3/library/sqlite3.html) modules use the zlib and SQLite C libraries.
|
|
65
|
+
[PyNaCl](https://pypi.org/project/PyNaCl/) wraps libsodium. In Rust,
|
|
66
|
+
[`rusqlite`](https://crates.io/crates/rusqlite) links SQLite through
|
|
67
|
+
[`libsqlite3-sys`](https://crates.io/crates/libsqlite3-sys). [`flate2`](https://crates.io/crates/flate2) can
|
|
68
|
+
use zlib through [`libz-sys`](https://crates.io/crates/libz-sys). If the C library does not build for QNX,
|
|
69
|
+
nothing above it does. All three are in our campaign:
|
|
70
|
+
- zlib: built, 2/2 tests pass on QNX 8.0.
|
|
71
|
+
- libsodium: built, 80/80 tests pass.
|
|
72
|
+
- sqlite: built. Its test suite needs Tcl on the target, so it was not run.
|
|
73
|
+
|
|
74
|
+
([`results/ports.csv`](results/ports.csv)).
|
|
75
|
+
|
|
76
|
+
## Related work: QNX's own ports
|
|
77
|
+
QNX maintains hand-made build recipes in [qnx-ports](https://github.com/qnx-ports)
|
|
78
|
+
([build-files](https://github.com/qnx-ports/build-files)): a person adapts each library and writes its recipe.
|
|
79
|
+
qnx-porter generates a port and then tests it:
|
|
80
|
+
- it applies documented rules to the compiler's errors;
|
|
81
|
+
- every change is a patch with its reason;
|
|
82
|
+
- a library counts as ported only when its own tests run on a QNX target.
|
|
83
|
+
|
|
84
|
+
The two meet in three places:
|
|
85
|
+
- 21 of our 61 libraries also have a qnx-ports recipe. We compared them library by library in
|
|
86
|
+
[docs/related/qnx-ports-comparison.md](docs/related/qnx-ports-comparison.md).
|
|
87
|
+
- For the 34 CMake ports that qnx-ports does not have, we generate recipes in their layout
|
|
88
|
+
([recipes/build-files/](recipes/build-files/)).
|
|
89
|
+
- The draft pull request text is in [docs/upstream/](docs/upstream/qnx-ports-build-files-PR.md). It has not
|
|
90
|
+
been sent.
|
|
91
|
+
|
|
92
|
+
## For judges, start here
|
|
93
|
+
- **Demo video:** [`video/out/qnx-porter-demo.mp4`](video/out/qnx-porter-demo.mp4) (YouTube link: added at submission).
|
|
94
|
+
Every command in it ran for real against the QNX 8.0 target; `video/make.sh` re-records it.
|
|
95
|
+
- **Evidence of QNX use:** see [Evidence of QNX use](#evidence-of-qnx-use) below. Every claim points at a file.
|
|
96
|
+
- **Headline** (written by `scripts/ports_csv.py`): <!-- headline:start -->x86_64: 57 of 61 libraries built for QNX 8.0; 1332 of 1366 of their own tests passed on a QNX 8.0 target (33 libraries with tests that ran); 25 patches, 25 by rules (29 of the 31 libraries oss.qnx.com does not list built).<!-- headline:end -->
|
|
97
|
+
See [Results](#results-on-qnx-80).
|
|
98
|
+
- **Results:** [`results/ports.csv`](results/ports.csv), written by `scripts/ports_csv.py` from each
|
|
99
|
+
port's own `ports/<library>/report.json`. No number in this README or the video comes from anywhere else.
|
|
100
|
+
- **Every patch the agent made:** `ports/<library>/patches/*.patch`, each with the rule, the reason and
|
|
101
|
+
the exact compiler error it answers. `ports/<library>/REPORT.md` is the summary.
|
|
102
|
+
- **Which libraries QNX already ships:** the `on_oss_qnx_com` column of `results/ports.csv` (the campaign
|
|
103
|
+
queries all of oss.qnx.com on every run). The first ten candidates were chosen as new to QNX:
|
|
104
|
+
[`results/candidates_check.csv`](results/candidates_check.csv), written by `scripts/check_candidates.py`.
|
|
105
|
+
- **Checked against QNX's own hand-made ports:** 21 of our libraries also have a recipe in
|
|
106
|
+
[qnx-ports](https://github.com/qnx-ports). [docs/related/qnx-ports-comparison.md](docs/related/qnx-ports-comparison.md)
|
|
107
|
+
compares them library by library. It covers where we found the same QNX change, where QNX fixed something our
|
|
108
|
+
run only reported, and where the two sides differ.
|
|
109
|
+
- Setup: [SETUP.md](SETUP.md). Tutorial: [docs/CODELAB.md](docs/CODELAB.md).
|
|
110
|
+
|
|
111
|
+
## Results on QNX 8.0
|
|
112
|
+
61 libraries, ported by `scripts/run_campaign.py` on 12 Nov 2026 with QNX SDP 8.0 (build 141, qcc 12.2.0).
|
|
113
|
+
Their own test suites ran on QNX 8.0 x86_64 in QEMU (`mkqnximage`). Rules only, no language model. The
|
|
114
|
+
libraries are infrastructure an embedded team reaches for: parsers (JSON, XML, YAML, CBOR, TOML), compression,
|
|
115
|
+
crypto and TLS, messaging (MQTT, nng, OPC UA, CoAP, Modbus), logging and formatting, test frameworks, codecs.
|
|
116
|
+
"none built" means the library's build registers no tests, or registers them only behind an option we left off.
|
|
117
|
+
"not run" means the suite needs something the target lacks (the Note says what). The table is generated from
|
|
118
|
+
`ports/*/report.json`:
|
|
119
|
+
|
|
120
|
+
<!-- results:start -->
|
|
121
|
+
| Library | Version | Arch | Build | Tests on QNX 8.0 | Patches (rule / model) | Minutes | Note |
|
|
122
|
+
|---|---|---|---|---|---|---|---|
|
|
123
|
+
| [BLAKE3](ports/BLAKE3/REPORT.md) | 1.5.4 | x86_64 | built | none built | 0 (0 / 0) | 0.1 | portable C: its CMake has SIMD flags only for compilers it knows, not qcc |
|
|
124
|
+
| [Micro-CDR](ports/Micro-CDR/REPORT.md) | v2.0.1 | x86_64 | built | none built | 0 (0 / 0) | 0.1 | |
|
|
125
|
+
| [benchmark](ports/benchmark/REPORT.md) | v1.9.1 | x86_64 | built | none built | 0 (0 / 0) | 0.6 | |
|
|
126
|
+
| [c-ares](ports/c-ares/REPORT.md) | v1.34.3 | x86_64 | built | none built | 0 (0 / 0) | 0.5 | |
|
|
127
|
+
| [cJSON](ports/cJSON/REPORT.md) | v1.7.18 | x86_64 | built | 19/19 | 0 (0 / 0) | 0.5 | |
|
|
128
|
+
| [can-utils](ports/can-utils/REPORT.md) | v2023.03 | x86_64 | failed | not run | 0 (0 / 0) | 0.1 | Linux SocketCAN tools: expected not to port |
|
|
129
|
+
| [capstone](ports/capstone/REPORT.md) | 5.0.3 | x86_64 | built | 24/24 | 1 (1 / 0) | 5.2 | |
|
|
130
|
+
| [cglm](ports/cglm/REPORT.md) | v0.9.4 | x86_64 | built | 1/1 | 0 (0 / 0) | 0.5 | |
|
|
131
|
+
| [cmark](ports/cmark/REPORT.md) | 0.31.1 | x86_64 | built | 1/1 | 0 (0 / 0) | 0.3 | |
|
|
132
|
+
| [cmocka](ports/cmocka/REPORT.md) | cmocka-1.1.7 | x86_64 | built | 46/46 | 0 (0 / 0) | 0.4 | |
|
|
133
|
+
| [expat](ports/expat/REPORT.md) | R_2_6_4 | x86_64 | built | 2/2 | 0 (0 / 0) | 2.5 | |
|
|
134
|
+
| [flac](ports/flac/REPORT.md) | 1.4.3 | x86_64 | built | 7/10 | 1 (1 / 0) | 8.7 | |
|
|
135
|
+
| [flatcc](ports/flatcc/REPORT.md) | v0.6.1 | x86_64 | built | not run | 0 (0 / 0) | 0.2 | build only: its tests run the just-built flatcc compiler on the build host |
|
|
136
|
+
| [fmt](ports/fmt/REPORT.md) | 11.0.2 | x86_64 | built | 17/20 | 1 (1 / 0) | 6.9 | |
|
|
137
|
+
| [googletest](ports/googletest/REPORT.md) | v1.15.2 | x86_64 | built | 25/27 | 1 (1 / 0) | 9.8 | |
|
|
138
|
+
| [inih](ports/inih/REPORT.md) | r58 | x86_64 | built | none built | 0 (0 / 0) | 0.2 | |
|
|
139
|
+
| [jansson](ports/jansson/REPORT.md) | v2.14 | x86_64 | built | 209/213 | 1 (1 / 0) | 1.2 | |
|
|
140
|
+
| [json-c](ports/json-c/REPORT.md) | json-c-0.18-20240915 | x86_64 | built | 25/25 | 1 (1 / 0) | 0.8 | |
|
|
141
|
+
| [kissfft](ports/kissfft/REPORT.md) | 131.1.0 | x86_64 | built | none built | 0 (0 / 0) | 0.1 | |
|
|
142
|
+
| [libcbor](ports/libcbor/REPORT.md) | v0.11.0 | x86_64 | built | none built | 0 (0 / 0) | 0.2 | |
|
|
143
|
+
| [libccd](ports/libccd/REPORT.md) | v2.1 | x86_64 | built | 3/3 | 0 (0 / 0) | 0.3 | |
|
|
144
|
+
| [libcoap](ports/libcoap/REPORT.md) | v4.3.5 | x86_64 | built | none built | 1 (1 / 0) | 0.7 | |
|
|
145
|
+
| [libconfig](ports/libconfig/REPORT.md) | v1.7.3 | x86_64 | built | 1/1 | 1 (1 / 0) | 0.5 | |
|
|
146
|
+
| [libdeflate](ports/libdeflate/REPORT.md) | v1.22 | x86_64 | built | none built | 0 (0 / 0) | 0.3 | |
|
|
147
|
+
| [libevent](ports/libevent/REPORT.md) | release-2.1.12-stable | x86_64 | built | 20/24 | 2 (2 / 0) | 11.9 | |
|
|
148
|
+
| [libgpiod](ports/libgpiod/REPORT.md) | v2.2.4 | x86_64 | failed | not run | 0 (0 / 0) | 0.3 | Linux GPIO character-device API: expected not to port |
|
|
149
|
+
| [libjpeg-turbo](ports/libjpeg-turbo/REPORT.md) | 3.0.4 | x86_64 | built | 590/590 | 0 (0 / 0) | 5.1 | |
|
|
150
|
+
| [libmodbus](ports/libmodbus/REPORT.md) | v3.1.11 | x86_64 | built | 0/1 | 0 (0 / 0) | 1.0 | |
|
|
151
|
+
| [libogg](ports/libogg/REPORT.md) | v1.3.5 | x86_64 | built | 2/2 | 0 (0 / 0) | 0.2 | |
|
|
152
|
+
| [libpng](ports/libpng/REPORT.md) | v1.6.44 | x86_64 | built | none built | 1 (1 / 0) | 0.5 | |
|
|
153
|
+
| [libsamplerate](ports/libsamplerate/REPORT.md) | 0.2.2 | x86_64 | built | 12/13 | 0 (0 / 0) | 0.5 | |
|
|
154
|
+
| [libsodium](ports/libsodium/REPORT.md) | 1.0.20-RELEASE | x86_64 | built | 80/80 | 0 (0 / 0) | 6.0 | |
|
|
155
|
+
| [libsrtp](ports/libsrtp/REPORT.md) | v2.6.0 | x86_64 | built | 8/12 | 1 (1 / 0) | 0.8 | |
|
|
156
|
+
| [libtommath](ports/libtommath/REPORT.md) | v1.3.0 | x86_64 | built | 1/1 | 0 (0 / 0) | 0.4 | |
|
|
157
|
+
| [libuv](ports/libuv/REPORT.md) | v1.49.2 | x86_64 | failed | not run | 0 (0 / 0) | 0.3 | |
|
|
158
|
+
| [libwebsockets](ports/libwebsockets/REPORT.md) | v4.3.3 | x86_64 | failed | not run | 1 (1 / 0) | 0.8 | |
|
|
159
|
+
| [libxml2](ports/libxml2/REPORT.md) | v2.13.5 | x86_64 | built | 7/8 | 0 (0 / 0) | 2.3 | |
|
|
160
|
+
| [libyaml](ports/libyaml/REPORT.md) | 0.2.5 | x86_64 | built | 2/2 | 0 (0 / 0) | 0.2 | |
|
|
161
|
+
| [lz4](ports/lz4/REPORT.md) | v1.10.0 | x86_64 | built | none built | 0 (0 / 0) | 0.5 | |
|
|
162
|
+
| [mbedtls](ports/mbedtls/REPORT.md) | v3.6.2 | x86_64 | built | 130/130 | 1 (1 / 0) | 4.6 | |
|
|
163
|
+
| [miniz](ports/miniz/REPORT.md) | 3.0.2 | x86_64 | built | none built | 0 (0 / 0) | 0.2 | |
|
|
164
|
+
| [mosquitto](ports/mosquitto/REPORT.md) | v2.0.20 | x86_64 | built | none built | 1 (1 / 0) | 0.5 | |
|
|
165
|
+
| [msgpack-c](ports/msgpack-c/REPORT.md) | c-6.1.0 | x86_64 | built | none built | 0 (0 / 0) | 0.1 | |
|
|
166
|
+
| [nanopb](ports/nanopb/REPORT.md) | 0.4.9 | x86_64 | built | not run | 0 (0 / 0) | 0.0 | build only: its tests use scons and protoc |
|
|
167
|
+
| [nng](ports/nng/REPORT.md) | v1.9.0 | x86_64 | built | 82/86 | 1 (1 / 0) | 4.3 | |
|
|
168
|
+
| [open62541](ports/open62541/REPORT.md) | v1.4.6 | x86_64 | built | none built | 0 (0 / 0) | 2.4 | |
|
|
169
|
+
| [opus](ports/opus/REPORT.md) | v1.5.2 | x86_64 | built | none built | 0 (0 / 0) | 0.5 | |
|
|
170
|
+
| [paho.mqtt.c](ports/paho.mqtt.c/REPORT.md) | v1.3.14 | x86_64 | built | not run | 3 (3 / 0) | 0.4 | build only: the test suite needs an MQTT broker on the target |
|
|
171
|
+
| [pcre2](ports/pcre2/REPORT.md) | pcre2-10.44 | x86_64 | built | 1/3 | 0 (0 / 0) | 0.7 | |
|
|
172
|
+
| [pugixml](ports/pugixml/REPORT.md) | v1.14 | x86_64 | built | 0/1 | 0 (0 / 0) | 0.9 | |
|
|
173
|
+
| [spdlog](ports/spdlog/REPORT.md) | v1.15.0 | x86_64 | built | none built | 1 (1 / 0) | 0.7 | |
|
|
174
|
+
| [sqlite](ports/sqlite/REPORT.md) | version-3.47.2 | x86_64 | built | not run | 0 (0 / 0) | 2.7 | build only: its test suite needs Tcl on the target |
|
|
175
|
+
| [tinycbor](ports/tinycbor/REPORT.md) | v0.6.0 | x86_64 | built | not run | 0 (0 / 0) | 0.0 | |
|
|
176
|
+
| [tinyxml2](ports/tinyxml2/REPORT.md) | 10.0.0 | x86_64 | built | 1/1 | 1 (1 / 0) | 0.4 | |
|
|
177
|
+
| [tomlplusplus](ports/tomlplusplus/REPORT.md) | v3.4.0 | x86_64 | built | none built | 0 (0 / 0) | 0.1 | |
|
|
178
|
+
| [wolfssl](ports/wolfssl/REPORT.md) | v5.7.4-stable | x86_64 | built | 1/1 | 2 (2 / 0) | 1.9 | |
|
|
179
|
+
| [xxHash](ports/xxHash/REPORT.md) | v0.8.2 | x86_64 | built | none built | 0 (0 / 0) | 0.2 | |
|
|
180
|
+
| [yaml-cpp](ports/yaml-cpp/REPORT.md) | 0.8.0 | x86_64 | built | 0/1 | 1 (1 / 0) | 5.0 | |
|
|
181
|
+
| [yyjson](ports/yyjson/REPORT.md) | 0.10.0 | x86_64 | built | 12/12 | 1 (1 / 0) | 1.5 | |
|
|
182
|
+
| [zlib](ports/zlib/REPORT.md) | v1.3.1 | x86_64 | built | 2/2 | 0 (0 / 0) | 0.3 | |
|
|
183
|
+
| [zstd](ports/zstd/REPORT.md) | v1.5.6 | x86_64 | built | 1/4 | 0 (0 / 0) | 9.2 | |
|
|
184
|
+
<!-- results:end -->
|
|
185
|
+
|
|
186
|
+
**What the failures are.** Each one was reproduced outside the campaign before being named. Details are in
|
|
187
|
+
[docs/LEARNINGS.md](docs/LEARNINGS.md), each test's QNX output is in `ports/<library>/logs/tests.log`, and the
|
|
188
|
+
reproducers are in [docs/qnx-reports/](docs/qnx-reports/):
|
|
189
|
+
- **QNX C library behaviour** (draft reports, not sent):
|
|
190
|
+
- `strtod()` is not correctly rounded (pugixml, jansson, yaml-cpp).
|
|
191
|
+
- `strftime()` writes nothing for `%Ex`/`%EX`/`%Ec` (fmt).
|
|
192
|
+
- `fchdir()` needs `O_DIRECTORY` (googletest's death tests). QNX documents this.
|
|
193
|
+
- `qsort()` writes outside the array when the comparator is inconsistent (libsrtp's tests use a random
|
|
194
|
+
comparator).
|
|
195
|
+
- **Undefined C that glibc tolerates:** `printf("%s", NULL)`. The agent reads the core dump and fixes it in
|
|
196
|
+
json-c, libconfig, tinyxml2 and capstone (all now pass). It finds the same thing but cannot place the fix
|
|
197
|
+
in libxml2 (library code) and nng (behind a tail call).
|
|
198
|
+
- **What the test image lacks:** `killall` (libmodbus), `/bin/echo` (pcre2grep), internet access (nng),
|
|
199
|
+
2 GiB of memory for one zstd test, a `locale` command (pcre2 skips those tests), Tcl (sqlite), an MQTT
|
|
200
|
+
broker (paho), cmake on the target (libpng's tests are CMake scripts).
|
|
201
|
+
- **Did not build** (4): libgpiod and can-utils use Linux-only kernel interfaces, as expected. libuv
|
|
202
|
+
(`struct qtime_entry` has no `nsec` in QNX 8.0) and libwebsockets (`TCPCTL_KEEPCNT`) stop on errors no rule
|
|
203
|
+
covers yet. QNX's own ports of these two libraries change exactly those lines.
|
|
204
|
+
|
|
205
|
+
**How we got here** (each line is the summary the campaign script printed; logs in [`results/runs/`](results/runs/)):
|
|
206
|
+
|
|
207
|
+
| Run | Built | Tests passed on QNX | What we changed before the next run |
|
|
208
|
+
|---|---|---|---|
|
|
209
|
+
| 1 | 4/10 | 68/72 | CMake ignored flag fixes after round 1; autotools configured in the wrong folder; new rules for libm, `__inet_pton`, `<sys/errno.h>`, `bool` |
|
|
210
|
+
| 2 | 9/10 | 292/381 | automake test programs were never copied to QNX; `.sh` tests ran on Linux |
|
|
211
|
+
| 3 | 9/10 | 372/381 | a proved fix was reverted when it let the link step run; endian names from `<net/netbyte.h>` |
|
|
212
|
+
| 4 | 10/10 | 372/381 | CMake pass regexes need DOTALL (cmocka re-run: 46/46) |
|
|
213
|
+
| 5 (json-c, libconfig only) | 2/2 | 26/26 | crash triage from QNX core dumps + `printf-null` rule (both crashes were `printf("%s", NULL)`) |
|
|
214
|
+
| 6 (61 libraries) | 50/61 | 1185/1345 | `cmake -E` test helpers run as QNX shell commands; rules `wcswidth-compat`, `qcc-sysroot`; a resolv.conf on the target |
|
|
215
|
+
| 7 (61 libraries) | 57/61 | 1332/1366 | final run; re-runs into the same log: 6 libraries after a DNS outage, sqlite without editline, CRLF-safe and MSVC-safe `printf-null` patches, libccd once CMake could find the stub `librt` |
|
|
216
|
+
|
|
217
|
+
Runs 6 and 7 count tests the way the campaign script did on the day. Run 6 counted libraries whose suite
|
|
218
|
+
registered no tests as "tests ran". Since run 7, the summary and the headline count only libraries with at
|
|
219
|
+
least one test.
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
## How it works
|
|
223
|
+
The full pipeline as a diagram, one box per source file: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
|
|
224
|
+
```
|
|
225
|
+
git URL + tag
|
|
226
|
+
│
|
|
227
|
+
▼
|
|
228
|
+
detect build system ──► CMake | Meson | autotools | Make
|
|
229
|
+
│
|
|
230
|
+
▼
|
|
231
|
+
generate QNX toolchain ──► qnx-toolchain.cmake (qcc -Vgcc_ntox86_64, sysroot $QNX_TARGET)
|
|
232
|
+
│ qnx-cross.ini (meson) | --host=x86_64-pc-nto-qnx8.0.0 (autotools)
|
|
233
|
+
▼
|
|
234
|
+
build ──► parse GCC / ld / CMake / configure errors
|
|
235
|
+
│ │
|
|
236
|
+
│ ├─ deterministic rule? ──► patch + reason ──┐
|
|
237
|
+
│ ├─ else model (optional) ──► diff, git apply --check, kept only if the rebuild clears it
|
|
238
|
+
│ └─ else stop, report what is left and why │
|
|
239
|
+
◄────────────────────────────── rebuild ◄────────────────┘
|
|
240
|
+
│
|
|
241
|
+
▼
|
|
242
|
+
tests on the QNX 8.0 target ──► ctest / meson test / make check, each test binary run over ssh
|
|
243
|
+
│
|
|
244
|
+
▼
|
|
245
|
+
ports/<library>/ REPORT.md · report.json · patches/ · qnx.patch · toolchain file · logs/
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Rules first.** Each rule acts only on what the compiler or linker said, plus facts about QNX's libc:
|
|
249
|
+
|
|
250
|
+
| Rule | Fires on | Change |
|
|
251
|
+
|---|---|---|
|
|
252
|
+
| `add-include` | implicit declaration / undeclared symbol | `#include` the header GCC's own note names, or the POSIX header from a table |
|
|
253
|
+
| `qnx-source` | the header is already included but the symbol is hidden | `-D_QNX_SOURCE` |
|
|
254
|
+
| `link-libsocket` | `undefined reference to socket/getaddrinfo/...` | `-lsocket` (QNX keeps sockets in libsocket) |
|
|
255
|
+
| `stub-lib` | `cannot find -lpthread/-lrt/-ldl` | an empty archive, because QNX has these in libc |
|
|
256
|
+
| `no-werror` | a warning promoted by `-Werror` | `-Wno-error=<that warning>` |
|
|
257
|
+
| `guard-linux-header` | `<sys/epoll.h>`, `<sys/sendfile.h>`, ... missing and unused by the file | `#ifndef __QNX__` around the include |
|
|
258
|
+
| `byteswap-builtins`, `prctl-set-name`, `pthread-setname*` | `<byteswap.h>`, `prctl(PR_SET_NAME)`, BSD/macOS thread-name calls | QNX's `__builtin_bswap*`, `pthread_setname_np(tid, name)` |
|
|
259
|
+
| `qnx-platform-guard` | `#error "Unsupported platform"` after an OS `#if` chain | QNX joins the BSD/Unix branch; kept only if the rebuild proves it |
|
|
260
|
+
| `map-anon`, `msg-nosignal`, `link-libfsnotify`, `fcommon` | `MAP_ANONYMOUS`, `MSG_NOSIGNAL`, inotify, GCC 12 `-fno-common` | see the corpus |
|
|
261
|
+
|
|
262
|
+
All 35 patterns, where each QNX fact comes from, and the test for each:
|
|
263
|
+
[docs/LINUX_ISMS.md](docs/LINUX_ISMS.md). Linux-only code that is actually *used* (epoll loops, sendfile)
|
|
264
|
+
is never rewritten by a rule; it goes to the model with a QNX-specific hint, or is reported as blocked.
|
|
265
|
+
|
|
266
|
+
**The model is optional and checked.** Set `QNX_PORTER_API_KEY` and `QNX_PORTER_MODEL` (any
|
|
267
|
+
OpenAI-compatible endpoint, set with `QNX_PORTER_BASE_URL`). It must answer with a unified diff and
|
|
268
|
+
a one-sentence reason. The diff must pass `git apply --check`; after the rebuild, if the error it targeted
|
|
269
|
+
is still there or the error count grew, the agent reverts it and marks it `reverted` in the report.
|
|
270
|
+
|
|
271
|
+
## Evidence of QNX use
|
|
272
|
+
The path from "a git URL" to "tests passed on QNX 8.0", function by function:
|
|
273
|
+
|
|
274
|
+
| Step | What touches QNX | Exact place |
|
|
275
|
+
|---|---|---|
|
|
276
|
+
| 1. Find the SDP | sources `~/qnx800/qnxsdp-env.sh` to get `QNX_HOST` and `QNX_TARGET` | [`qnx.py`](https://github.com/thegoodengineers/qnx-porter/blob/main/qnx_porter/qnx.py) `sdp_env()` |
|
|
277
|
+
| 2. Check it | runs `qcc -V` and looks for `gcc_ntox86_64`; checks the `x86_64-pc-nto-qnx8.0.0-gcc` drivers | `qnx.py` `doctor()` (CLI: `qnx-porter doctor`) |
|
|
278
|
+
| 3. Write the QNX toolchain | CMake: `CMAKE_SYSTEM_NAME QNX`, `CMAKE_C_COMPILER $QNX_HOST/usr/bin/qcc`, `CMAKE_C_COMPILER_TARGET gcc_ntox86_64`, `CMAKE_SYSROOT $QNX_TARGET`. Meson: a cross file with `system = 'qnx'`. Autotools: `--host=x86_64-pc-nto-qnx8.0.0` | `qnx.py` `cmake_toolchain()`, `meson_cross()`, `gnu_env()`, `ARCHES`; saved per port as `ports/<library>/qnx-toolchain.cmake` |
|
|
279
|
+
| 4. Invoke qcc | the configure and build commands that drive qcc through that toolchain; output goes to `ports/<library>/logs/round-NN.log` | [`build.py`](https://github.com/thegoodengineers/qnx-porter/blob/main/qnx_porter/build.py) `Job.steps()` builds the commands, `run()` executes them; called from [`agent.py`](https://github.com/thegoodengineers/qnx-porter/blob/main/qnx_porter/agent.py) `port()` |
|
|
280
|
+
| 5. Fix what QNX rejects | 35 Linux-isms and the QNX 8.0 answer to each (libsocket, libfsnotify, libc-provided pthread/rt/dl, `MAP_ANON`, `pthread_setname_np`, `<process.h>`, `_QNX_SOURCE`, ...), sourced from QNX's 8.0 documentation | [`fixes.py`](https://github.com/thegoodengineers/qnx-porter/blob/main/qnx_porter/fixes.py) `_rule()`, [`linuxisms.py`](https://github.com/thegoodengineers/qnx-porter/blob/main/qnx_porter/linuxisms.py); sources per fact in [docs/LINUX_ISMS.md](docs/LINUX_ISMS.md) |
|
|
281
|
+
| 6. Start the QNX target | QEMU image made by QNX's `mkqnximage --type=qemu --arch=x86_64` from the SDP | [SETUP.md](SETUP.md) step 4 |
|
|
282
|
+
| 7. Run tests on QNX | copies the build to the target (`tar` over ssh), then ctest / meson test / make check run every test binary on QNX through a generated wrapper (`CMAKE_CROSSCOMPILING_EMULATOR`, meson `exe_wrapper`, automake `LOG_COMPILER`) | [`target.py`](https://github.com/thegoodengineers/qnx-porter/blob/main/qnx_porter/target.py) `Target.sync()`, `write_wrapper()`, `remote_command()`, `main()`; output `ports/<library>/logs/tests.log` |
|
|
283
|
+
| 8. Record the target | `uname -a` from the QNX target in every report | `target.py` `Target.uname()`; `ports/<library>/report.json` field `target` |
|
|
284
|
+
| 9. One command for all of it | stops early if `qcc` or the target is missing | [`scripts/run_campaign.py`](https://github.com/thegoodengineers/qnx-porter/blob/main/scripts/run_campaign.py) `preflight()`, `check_target()` |
|
|
285
|
+
|
|
286
|
+
Real output from our runs (11 Nov 2026):
|
|
287
|
+
```
|
|
288
|
+
$ qnx-porter doctor # on the build host, WSL Ubuntu 22.04
|
|
289
|
+
ok qcc /home/chirag/qnx800/host/linux/x86_64/usr/bin/qcc
|
|
290
|
+
ok qcc targets cc: targets available in /home/chirag/qnx800/host/linux/x86_64/etc/qcc: ...
|
|
291
|
+
ok SDP complete no empty compiler or libc files
|
|
292
|
+
ok qcc builds hello ok
|
|
293
|
+
$ ssh root@172.31.1.11 uname -a # the QEMU target
|
|
294
|
+
QNX qnx-porter 8.0.0 2026/06/05-16:26:03EDT x86pc x86_64
|
|
295
|
+
$ tail -1 ports/mbedtls/logs/tests.log # written by ctest_on_target()
|
|
296
|
+
130/130 tests passed on the QNX target
|
|
297
|
+
```
|
|
298
|
+
The one patch mbedtls needed, as the agent wrote it ([`ports/mbedtls/patches/0001-link-libsocket.patch`](ports/mbedtls/patches/0001-link-libsocket.patch)):
|
|
299
|
+
```
|
|
300
|
+
Subject: [qnx-porter 0001] link-libsocket
|
|
301
|
+
Source: deterministic rule
|
|
302
|
+
Reason: `__inet_pton` is in QNX's libsocket, not in libc as on Linux: link with -lsocket.
|
|
303
|
+
Error: x509_crt.c:(.text+0x843): undefined reference to `__inet_pton'
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Why a real-time OS needs this tooling
|
|
307
|
+
- **Nothing builds on the target.** A QNX system in a car, a robot or a medical device has no compiler; every
|
|
308
|
+
library is cross-compiled with qcc against the SDP's sysroot. On Linux you can `./configure && make` on the
|
|
309
|
+
machine itself. On QNX, each library needs a cross toolchain file and build flags first, and most upstream
|
|
310
|
+
projects ship neither.
|
|
311
|
+
- **The host cannot run what it built.** QNX binaries do not run on the build machine, so "it compiled" proves
|
|
312
|
+
little. qnx-porter runs the library's own tests on a QNX 8.0 target and counts only those results.
|
|
313
|
+
- **QNX's libc is POSIX, not glibc.** Linux code relies on things glibc adds (implicit headers, `epoll`,
|
|
314
|
+
`prctl`, sockets in libc), so the same breakages come back in every library. That is why the fixes can be
|
|
315
|
+
rules, collected once in [docs/LINUX_ISMS.md](docs/LINUX_ISMS.md).
|
|
316
|
+
- **The markets QNX serves review every change.** Automotive, medical and industrial teams cannot take a
|
|
317
|
+
silently patched dependency. Every change here is a separate patch with the rule, the reason and the
|
|
318
|
+
compiler error that caused it. Rules run the same way every time, and a model's patch is reverted unless the
|
|
319
|
+
rebuild proves it. This is a review aid, not a safety certification.
|
|
320
|
+
- **The libraries chosen are the ones those systems need:** TLS (mbedtls), crypto (libsodium), MQTT
|
|
321
|
+
(paho.mqtt.c), Modbus (libmodbus), messaging (nng), CBOR and JSON. None was on oss.qnx.com when checked
|
|
322
|
+
([results/candidates_check.csv](results/candidates_check.csv)).
|
|
323
|
+
|
|
324
|
+
## Quick start
|
|
325
|
+
Install: `python3 -m pip install --user qnx-porter` (from PyPI), or from a clone as below.
|
|
326
|
+
```bash
|
|
327
|
+
python3 -m pip install --user --upgrade pip # Ubuntu 22.04's pip 22 cannot do editable installs
|
|
328
|
+
python3 -m pip install --user -e ".[test]"
|
|
329
|
+
python3 -m pytest -q # no QNX needed
|
|
330
|
+
source ~/qnx800/qnxsdp-env.sh && qnx-porter doctor
|
|
331
|
+
qnx-porter port https://github.com/json-c/json-c.git --tag json-c-0.18-20240915 --target root@172.31.1.11
|
|
332
|
+
python3 scripts/run_campaign.py # every library in campaign.yaml, then the CSV
|
|
333
|
+
```
|
|
334
|
+
Build and run requirements: **QNX SDP 8.0**, target **x86_64 QEMU** or **aarch64le QEMU `virt`**
|
|
335
|
+
(both built by `scripts/qemu_target.sh` with QNX's `mkqnximage`; any QNX 8.0 target reachable over ssh also
|
|
336
|
+
works, but we tested only these two), toolchain **qcc / GCC from SDP 8.0**, host **Ubuntu 22.04/24.04 or WSL2**. Details: [SETUP.md](SETUP.md).
|
|
337
|
+
|
|
338
|
+
## Known limits
|
|
339
|
+
- Linux host only (WSL2 on Windows), because QNX's QEMU tooling is Ubuntu-only.
|
|
340
|
+
- Tests that need a network peer or root-only devices are counted as they run; nothing is excluded by hand.
|
|
341
|
+
- A rule never rewrites Linux-only code (epoll, inotify, ...). That is the model's job, or a person's.
|
|
342
|
+
- The model is never trusted: a diff that does not clear its error is reverted and shown as reverted.
|
|
343
|
+
|
|
344
|
+
## Licence
|
|
345
|
+
Apache-2.0. Patches produced for a library are offered under that library's own licence.
|