Commit 89cfee7
compat.expat 改为静态:host tool 链接它才能真的跑起来 (#291)
compat.expat was shared by analogy with compat.libdrm. The analogy does not
hold, and the shared form is actively broken for its only consumer.
WHY LIBDRM IS SHARED AND EXPAT NEED NOT BE. libdrm must be one mapping because
Mesa's payload has DT_NEEDED on libdrm.so.2 and the library keeps mutable
file-static state — drmHashTable, nr_fds, connection — over a shared set of
fds, so a second copy is a split ledger. Expat has no equivalent: parser state
hangs off the XML_Parser the caller owns.
WHY SHARED IS BROKEN HERE. The only consumer is freedesktop.wayland-scanner, a
HOST TOOL that mcpp builds in a sub-build and then runs during
another package's build.mcpp. A host tool linking a shared dependency comes out
with a DT_NEEDED nothing satisfies — mcpp does not stage the .so beside the
tool, and the sub-build's bin/ holds the executable alone:
wayland-scanner: error while loading shared libraries:
libexpat.so.1: cannot open shared object file
Reported as mcpp-community/mcpp#535.
The failure only reproduces without a graphics stack, which is why it reached
CI rather than being caught here: with Mesa installed the tool's RPATH reaches
<registry>/subos/default/lib and binds to xim:expat's copy instead — a
DIFFERENT library, silently succeeding. Static removes the question.
The test's dladdr check keeps its meaning: with objects merged it reports the
executable, and what it asserts is unchanged — that the code which just parsed
did not come from the ecosystem's copy.
Co-authored-by: Sunrisepeak <x.d2learn.org@gmail.com>1 parent 11555ab commit 89cfee7
2 files changed
Lines changed: 35 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
90 | 116 | | |
91 | 117 | | |
92 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
105 | | - | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
108 | | - | |
| 113 | + | |
109 | 114 | | |
110 | | - | |
| 115 | + | |
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
| |||
0 commit comments