From 31706a1d1c13c26c69f67f107b72179019cbd255 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 13:39:00 -0300 Subject: kinds #26, one static pardes: `zig build static -Dplatform=tui -Dtarget=x86_64-linux-musl` (musl's, as glibc links only dynamically; never the default, and -Dstatic gone) links the terminal binary statically with both addons compiled in, image.zig as a module and pdf.c with MuPDF, its export renamed by a -D, which Addon.zig registers at start as if loaded (/addons says builtin, Addon reload refuses one, no library is scanned), and execveat and close_range go by their syscalls, which musl has no wrappers for; macOS's way to image and PDF panes too, say a comment, building.typ, shared-libs.md and the changelog Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- docs/shared-libs.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'docs/shared-libs.md') diff --git a/docs/shared-libs.md b/docs/shared-libs.md index 384dc2f1..4a07f80a 100644 --- a/docs/shared-libs.md +++ b/docs/shared-libs.md @@ -29,6 +29,18 @@ pdf` (or `zig build addons`, both) builds and installs each library in home install). MuPDF is compiled only for a step that needs it (`pdf`, the tests); `-Dmupdf` is gone. +## One static pardes (2026-11-06) + +`zig build static -Dplatform=tui -Dtarget=x86_64-linux-musl` links the +terminal binary statically (musl: glibc links only dynamically) with both +addons compiled in: image.zig as a module, its stb_image static in stb.c +beside the binary's zstbi resize, and pdf.c with MuPDF, its FreeType and +zlib, its export renamed (`-Dpardes_addon=pardes_addon_pdf`), so the +binary holds one copy of each. Addon.zig registers both at start as if +loaded. It loads no library (a static binary has no dlopen); it is also +the way a build for macOS, whose loader has no memfd, could have image and +PDF panes. + ## PDF panes became an addon (2026-11-06) `lib/pardes/addons/pdf.so` (addons/pdf/pdf.c and pdf_bridge.c) holds MuPDF, -- cgit v1.3