# libmount-shared 2.42.2 — SÓLO libmount.so del tarball de util-linux, para la isla dinámica. # Hermana de `libuuid-shared.toml`, escrita por el mismo motivo y con su mismo criterio. # # ── POR QUÉ, MEDIDO ─────────────────────────────────────────────────────────────────────────── # `libblockdev` construye sus plugins como `.so` (los carga con `dlopen`) y el util-linux canónico # es `--disable-shared --enable-static`. Su `libblkid.a` NO es PIC, y el enlace muere nombrando el # fichero exacto: # # ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC # >>> defined in /usr/lib/libblkid.a(la-init.o) # >>> referenced by init.c:65 (libblkid/src/init.c:65) # # Es el mismo cuadro que ya documentan `libarchive-shared` y `lz4-shared` en esta cola, y que # `libuuid-shared` pagó antes para evolution-data-server. # # ── ANGOSTA A PROPÓSITO ─────────────────────────────────────────────────────────────────────── # `--disable-all-programs` apaga los ~100 binarios de util-linux (mount, fdisk, lsblk…) y # `--enable-libmount` deja exactamente una librería. NO se duplica el canónico entero: su lista de # `--without-*` está elegida para el userland estático y mantenerla en dos sitios es cómo divergen. # # El sed de `-mcpu=baseline` se conserva del canónico: zig cc traduce ese flag a un `-mcpu=` VACÍO # en modo preprocesador y los generadores `errnos.h`/`syscalls.h` lo invocan así. name = "libmount-shared" version = "2.42.2" license = "LGPL-2.1-or-later" [source] tarball = "https://www.kernel.org/pub/linux/utils/util-linux/v2.42/util-linux-2.42.2.tar.xz" sha256 = "03a05d3adf9602ef128f2da05b84b3205ce60c351e5737c0370f74000679ce8a" [build] compiler = "zig-cc" target = "x86_64-linux-musl" link = "dynamic" flags = [] [build.phases] configure = ''' ./configure \ --build=$CBUILD --host=$CHOST \ --prefix=/usr \ --enable-shared --disable-static \ --disable-all-programs \ --enable-libblkid --enable-libmount \ --disable-nls --disable-rpath \ --without-python --without-systemd --without-systemdsystemunitdir \ --without-udev --without-ncursesw --without-ncurses --without-tinfo \ --without-readline --without-libz --without-selinux --without-audit --without-econf ''' compile = ''' for f in tools/all_errnos tools/all_syscalls; do [ -f "$f" ] || continue sed -i 's#^"$@" -MD#a=(); for x in "$@"; do [ "$x" = "-mcpu=baseline" ] || a+=("$x"); done\n"${a[@]}" -MD#' "$f" done make -j"$(nproc)" ''' # ⚠ INSTALA SÓLO libmount, Y ESO PIDE EXPLICACIÓN: `--enable-libmount` NO se puede construir sin # libblkid —libmount la usa para saber QUÉ sistema de ficheros tiene el dispositivo antes de # montarlo—, así que el árbol compila las dos. Si esta receta instalara las dos, habría DOS # proveedores de `libblkid.so` en el catálogo y la hidratación (que sobrescribe) elegiría por orden # de lista, que es justo la trampa que `libblockdev.toml` documenta con e2fsprogs. Cada receta # publica lo que dice su nombre; libblkid la da `libblkid-shared`, y el `NEEDED` de libmount.so la # resuelve en runtime. install = ''' set -e make DESTDIR=/out install rm -f /out/usr/lib/libblkid.* /out/usr/lib/pkgconfig/blkid.pc rm -rf /out/usr/include/blkid rm -f /out/usr/lib/libuuid.* /out/usr/lib/pkgconfig/uuid.pc rm -rf /out/usr/include/uuid test -f /out/usr/lib/libmount.so test ! -e /out/usr/lib/libblkid.so ''' [deps] build = ["linux-headers", "make", "pkgconf"]