Commit 20f4179
[build] E: Build libxslt.so and libexslt.so
Produce position-independent libxslt.so / libexslt.so alongside
the existing static libxslt.a / libexslt.a, matching the
shared-library transition already started for libxml2 in
esaurez/libxml2 (`feat/build-shared-library`).
Each shared object is self-contained: libxslt.so embeds the lower
libxml2.a + libz.a via --whole-archive, and libexslt.so embeds
libxslt.a on top of that. No DT_NEEDED entries are emitted, so the
loader does not require sibling .so files to be present in the
search path. libc/libm/libposix symbols remain unresolved and bind
to the host executable's .dynsym at dlopen time, matching the
CPython extension model already in use across the Nanvix port.
Concretely:
* `--enable-static --disable-shared` stays in configure (libtool's
shared-library detection has no rules for i686-nanvix); `-fPIC`
is added to CFLAGS so the same .o files are usable for both
archives.
* Two new `.so` targets link the shared libraries manually with
`-shared -fPIC -nostdlib`, setting DT_SONAME=libxslt.so /
DT_SONAME=libexslt.so so downstream consumers (lxml) emit the
correct DT_NEEDED entry.
* `make test` now sanity-checks each .so: presence, DT_SONAME, and
that the public entry points (xsltParseStylesheetDoc,
exsltRegisterAll) appear in .dynsym.
* `.nanvix/z.py` `_BUILD_OUTPUTS` and `release()` ship both the
static and shared variants.
Runtime dependency: this shared-library build only becomes useful
once esaurez/nanvix#27 ([syscall] E: Run dlopen ctors/dtors and
DT_RUNPATH) ships, because libxml2's internal constructors must
fire for libxslt to function correctly. The unit-test in this PR
exercises only the static archives; the .so end-to-end test will
live in the downstream lxml binding.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent ab86b80 commit 20f4179
2 files changed
Lines changed: 73 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
| |||
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
| 38 | + | |
| 39 | + | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
34 | | - | |
| 43 | + | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
| |||
66 | 75 | | |
67 | 76 | | |
68 | 77 | | |
69 | | - | |
| 78 | + | |
70 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
71 | 85 | | |
72 | 86 | | |
73 | 87 | | |
| |||
77 | 91 | | |
78 | 92 | | |
79 | 93 | | |
| 94 | + | |
80 | 95 | | |
81 | 96 | | |
82 | 97 | | |
83 | | - | |
| 98 | + | |
84 | 99 | | |
85 | 100 | | |
86 | 101 | | |
87 | 102 | | |
88 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
89 | 137 | | |
90 | 138 | | |
91 | 139 | | |
| |||
113 | 161 | | |
114 | 162 | | |
115 | 163 | | |
| 164 | + | |
| 165 | + | |
116 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
117 | 175 | | |
118 | 176 | | |
119 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
309 | | - | |
| 311 | + | |
310 | 312 | | |
311 | 313 | | |
| 314 | + | |
312 | 315 | | |
| 316 | + | |
313 | 317 | | |
314 | 318 | | |
315 | 319 | | |
| |||
341 | 345 | | |
342 | 346 | | |
343 | 347 | | |
344 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
345 | 354 | | |
346 | 355 | | |
347 | 356 | | |
| |||
0 commit comments