Skip to content

Commit b9cca95

Browse files
committed
The Qt fixtures state cxx_runtime in [build]: mcpp reads a [target.<triple>] table only when a target is named, so a host build embedded a second libstdc++ and QtCore's RUNPATH found none
1 parent 4a7a0a4 commit b9cca95

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,8 +993,10 @@ the build is where the absence fails.
993993
On Linux, Qt's official QtCore links glib, zstd and zlib and the shared
994994
`libstdc++`. `rules-qt-xim` declares the first three on Linux, and the rule
995995
declares their `lib/` directories as runtime search directories; the program
996-
states `cxx_runtime = "toolchain-coupled"` for its Linux triple (mcpp's
997-
docs/20), so the process has one C++ runtime. Modules that load QtGui are not
996+
states `[build] cxx_runtime = "toolchain-coupled"` (mcpp's docs/20), so the
997+
process has one C++ runtime. The statement is project-wide because mcpp reads a
998+
`[target.<triple>]` table only when a target is named; under MSVC it keeps
999+
`/MD`, and on macOS mcpp keeps the default and says so. Modules that load QtGui are not
9981000
served on Linux: QtGui loads `libdbus-1.so.3`, which the ecosystem does not
9991001
publish, and mcpp's runtime closure check refuses the program. On macOS the
10001002
modules are frameworks under `lib/`: the rule compiles with `-F<root>/lib` and

‎tests/qt-consumer/mcpp.toml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ import_std = false
3131
plugins = { path = "../..", features = ["rules-qt-xim"], host-module = true }
3232

3333
[build]
34-
sources = ["src/*.cpp", "res/*.qrc", "i18n/*.ts"]
35-
36-
# Qt's Linux libraries load the shared libstdc++ (`libstdc++.so.6`), so a
37-
# program that links them uses the toolchain's shared C++ runtime rather than
38-
# embedding one: two C++ runtimes in one process is the hazard mcpp's docs/20
39-
# describes, and mcpp reports it when the default applies.
40-
[target.x86_64-linux-gnu]
34+
# Qt's Linux libraries load the shared libstdc++ (`libstdc++.so.6`), so the
35+
# program uses the toolchain's shared C++ runtime rather than embedding a second
36+
# one (mcpp's docs/20). The statement is project-wide because mcpp reads a
37+
# `[target.<triple>]` table only when a target is named. On Windows it keeps
38+
# `/MD`, which Qt's MSVC build uses, and stages the toolset's runtime DLLs; on
39+
# macOS mcpp reports that it keeps the default.
4140
cxx_runtime = "toolchain-coupled"
41+
sources = ["src/*.cpp", "res/*.qrc", "i18n/*.ts"]
4242

4343
[targets.qt-consumer]
4444
kind = "bin"

‎tests/qt-widgets-consumer/mcpp.toml‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,17 @@ import_std = false
2222
[build-dependencies.mcpp]
2323
plugins = { path = "../..", features = ["rules-qt-xim"], host-module = true }
2424

25-
[build]
26-
sources = ["src/*.cpp", "ui/*.ui"]
27-
2825
# Built and run on Windows and macOS by CI; on Linux QtGui needs libdbus, which
29-
# the ecosystem does not publish. The Linux runtime contract below is what a
30-
# Linux build of it states.
31-
#
32-
# Qt's Linux libraries load the shared libstdc++ (`libstdc++.so.6`), so a
33-
# program that links them uses the toolchain's shared C++ runtime rather than
34-
# embedding one: two C++ runtimes in one process is the hazard mcpp's docs/20
35-
# describes, and mcpp reports it when the default applies.
36-
[target.x86_64-linux-gnu]
26+
# the ecosystem does not publish.
27+
[build]
28+
# Qt's Linux libraries load the shared libstdc++ (`libstdc++.so.6`), so the
29+
# program uses the toolchain's shared C++ runtime rather than embedding a second
30+
# one (mcpp's docs/20). The statement is project-wide because mcpp reads a
31+
# `[target.<triple>]` table only when a target is named. On Windows it keeps
32+
# `/MD`, which Qt's MSVC build uses, and stages the toolset's runtime DLLs; on
33+
# macOS mcpp reports that it keeps the default.
3734
cxx_runtime = "toolchain-coupled"
35+
sources = ["src/*.cpp", "ui/*.ui"]
3836

3937
[targets.qt-widgets-consumer]
4038
kind = "bin"

0 commit comments

Comments
 (0)