Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.

Commit 24205cf

Browse files
committed
build libxml2 from source on Linux + link libeconf into msi-interop
Two issues blocked static msi-interop on Alpine: 1. Alpine's libxml2.a is not -fPIC compiled (R_X86_64_PC32 relocations against `stderr`/`stdout` globals can not be used when making a shared object). Build libxml2 from source on Linux (extending the existing macOS branch) so we get a PIC-compiled archive. 2. libblkid.a (transitive dep of glib's static gio) needs econf_* symbols from libeconf. Wire libeconf into msi-interop's link_with on Linux.
1 parent 91b1d36 commit 24205cf

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

meson.build

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ if host_machine.system() == 'windows'
3030
endif
3131

3232
# --- libxml2 ---
33-
if host_machine.system() == 'darwin'
34-
# Build from source on macOS — Homebrew doesn't provide a static libxml2.a
33+
# Build from source on macOS (Homebrew doesn't ship static libxml2.a) and
34+
# Linux (Alpine's libxml2.a isn't compiled with -fPIC, so it can't be embedded
35+
# into a shared object like libmsi-interop.so).
36+
if host_machine.system() == 'darwin' or host_machine.system() == 'linux'
3537
cc = meson.get_compiler('c')
3638

3739
xml2_version_config = configuration_data()
@@ -448,6 +450,9 @@ if host_machine.system() == 'linux'
448450
# Statically embed all dependencies into libmsi-interop.so so it has no
449451
# runtime system library dependencies (other than libc) when loaded via
450452
# P/Invoke from C#. This requires PIC-compiled static libs.
453+
# libeconf provides econf_* symbols required by libblkid (transitive dep
454+
# of glib's gio static link).
455+
msi_interop_link_with += [libeconf]
451456
msi_interop_link_args += [
452457
'-Wl,--exclude-libs,ALL',
453458
]

0 commit comments

Comments
 (0)