diff --git a/docs/markdown/Platform-notes.md b/docs/markdown/Platform-notes.md new file mode 100644 index 000000000..091ce39ce --- /dev/null +++ b/docs/markdown/Platform-notes.md @@ -0,0 +1,46 @@ +--- +short-description: Notes and known issues for specific platforms +... + +# Platform notes + +This page collects information that is specific to a platform or to a toolchain. + +## QNX + +Meson can detect and use `qcc` and `q++`, the C and C++ compiler drivers shipped with the QNX +Software Development Platform (SDP). For cross compilation, point the `[binaries]` section of +the cross file at `qcc` and `q++`, including the required `-V` target selector, and set +`system = 'qnx'` in `[host_machine]`: + +```ini +[binaries] +c = ['qcc', '-Vgcc_ntoaarch64le'] +cpp = ['q++', '-Vgcc_ntoaarch64le'] + +[host_machine] +system = 'qnx' +cpu_family = 'aarch64' +cpu = 'aarch64' +endian = 'little' +``` + +The following limitations apply: + +1. ThinLTO incremental cache does not work. `-Db_thinlto_cache=true` raises an error at + configure time, while `-Db_lto=true` is unaffected. +2. Alternate linker selection is not supported. Setting `c_ld` or `cpp_ld` (for example to + `lld` or `gold`) raises an error. +3. If a header is deleted, stale entries remain in the dependency files, because `-MP` does not + emit phony header rules. A clean build is needed to recover. +4. There is no static sanitizer runtime, so `-static-libasan` is rejected and only the shared + runtime can be linked. +5. The available sanitizers depend on the SDP version. SDP 7.1 only provides `libubsan`, so + `-Db_sanitize=address` and `-Db_sanitize=leak` fail to link there. SDP 8.0 adds asan and + lsan. `-Db_sanitize=undefined` works on both, and tsan is not available on either. +6. C++20 named modules do not work. With SDP 8.0, `-fmodules-ts` compiles but silently ignores + `.cppm` and `.ixx` files. With SDP 7.1, `-fmodules-ts` is rejected for C++ sources. Plain + `-fmodules` is rejected on both. This only affects projects that enable modules through + `cpp_args`. +7. Relinking is avoided for unchanged shared libraries only on native QNX builds. When + cross compiling to QNX, shared libraries are always relinked. diff --git a/docs/markdown/snippets/qcc-support.md b/docs/markdown/snippets/qcc-support.md index c95f7b737..7175bf283 100644 --- a/docs/markdown/snippets/qcc-support.md +++ b/docs/markdown/snippets/qcc-support.md @@ -1,30 +1,5 @@ ## Added support for the QNX qcc/q++ compiler driver -Meson can now detect and use `qcc` and `q++`, the C and C++ compiler drivers shipped with the QNX Software Development Platform (SDP), and recognizes QNX as a target platform. - -**Cross-compiling for QNX** - -Point a cross file's `[binaries]` section at qcc/q++ including the -required `-V` target selector, and declare `system = 'qnx'` in -`[host_machine]`, for example: - -```ini -[binaries] -c = ['qcc', '-Vgcc_ntoaarch64le'] -cpp = ['q++', '-Vgcc_ntoaarch64le'] - -[host_machine] -system = 'qnx' -cpu_family = 'aarch64' -cpu = 'aarch64' -endian = 'little' -``` - -Known Issues: -1. ThinLTO incremental cache doesn't work — -Db_thinlto_cache=true raises a clear error at configure time; plain -Db_lto=true is unaffected. -flto-incremental= is rejected outright by cc1. -2. No alternate linker selection — c_ld/cpp_ld in a cross/native file (e.g. 'lld', 'gold') raises MesonException. qcc's driver never invokes a separate linker binary itself, and QNX documents no equivalent mechanism. -3. Stale dependency-file entries after deleting a header — -MP's phony-header rules aren't emitted by this cc1, unlike stock gcc. Narrow, unfixed; only shows up as a missed rebuild until a clean build. -4. No static sanitizer runtime — -static-libasan is rejected as unknown; only the shared sanitizer runtime can ever be linked. -5. Sanitizer runtime availability is SDP-version-dependent — SDP 7.1 ships only libubsan (no asan/lsan/tsan at all), so -Db_sanitize=address/=leak fail to link there; SDP 8.0 adds asan/lsan (still no tsan on either SDP). =undefined works on both. -6. C++20 named modules are broken, differently per SDP — SDP 8.0: -fmodules-ts compiles but silently no-ops on .cppm/.ixx files (no code-level fix possible — it's driver-level source-suffix dispatch before cc1plus ever runs). SDP 7.1: worse — -fmodules-ts itself is hard-rejected as unrecognized on any C++ source. Plain -fmodules is hard-rejected on both SDPs. Only bites a project that explicitly opts into modules via cpp_args. -7. Symbol-extraction relink-avoidance only applies natively — the gnu_syms() optimization (skip relinking when a shared library's exported symbols haven't changed) only kicks in for a native/self-hosted QNX build; cross-compiling to QNX from another host (the SDP's primary use case) always falls back to unconditional relinking, same as before this work. +Meson can now detect and use `qcc` and `q++`, the C and C++ compiler drivers shipped with the +QNX Software Development Platform (SDP), and recognizes QNX as a target platform. See +[Platform notes](Platform-notes.md#qnx) for cross compilation setup and known limitations. diff --git a/docs/sitemap.txt b/docs/sitemap.txt index c6bbb10dd..0bf9991d0 100644 --- a/docs/sitemap.txt +++ b/docs/sitemap.txt @@ -77,6 +77,7 @@ index.md Project-templates.md @REFMAN_PLACEHOLDER@ Reference-tables.md + Platform-notes.md Style-guide.md Rewriter.md FAQ.md