Commit 297c26a
committed
zsh: statically link the optional modules (mathfunc, regex, system, ...)
A fully static binary cannot dlopen modules, so the -static build makes
configure mark every optional module link=no -- they are dropped, leaving zsh
with only its core set. This flips the buildable, libc-only modules to
link=static in the generated config.modules and runs `make prep`, compiling them
into the binary and making them usable via zmodload: mathfunc (float math
functions), regex (=~), system (syscall/sysread/zsystem flock), stat, mapfile,
files (zf_*), zselect, zpty, net/socket + net/tcp, zftp, clone, param/private,
zprof, watch, deltochar, nearcolor. (datetime, zle, complete, ... were already
link=static.)
Modules needing libraries we do not ship are deliberately left link=no:
cap->libcap, db/gdbm->libgdbm, pcre->libpcre2, and zsh/curses needs wide-char
ncurses (the in-tree build is --disable-widec). The sed no-ops on versions that
lack a given module, so one module list is safe across the whole range; older
zsh (4.0.9/4.2.7) simply gets the smaller set of modules it actually ships.
Also: --enable-multibyte (5.0+, pinned) and --enable-unicode9 (5.3.1+, in-tree
Unicode-9 width tables, no external lib). And -Dgamma=lgamma for zsh <5.0, whose
mathfunc.c calls the deprecated gamma() (a historical alias for lgamma)
unconditionally -- musl dropped that symbol, so zsh/mathfunc otherwise fails to
link; the only gamma( token in the tree is that call, and the "gamma" math
function name is a string literal, so users still call gamma() and get lgamma.
5.0+ guards the call behind a configure probe and is left untouched.
Verified across the full range on both arches: all 12 versions build, the module
set loads (zmodload zsh/mathfunc -> sqrt(2), =~ matches, datetime), and
verify_build_checksums passes. Regenerated checksums/build/{amd64,arm64}/zsh_*.1 parent be8da58 commit 297c26a
25 files changed
Lines changed: 69 additions & 25 deletions
File tree
- checksums/build
- amd64
- zsh_4.0.9/bin
- zsh_4.2.7/bin
- zsh_5.0.8/bin
- zsh_5.1.1/bin
- zsh_5.2/bin
- zsh_5.3.1/bin
- zsh_5.4.2/bin
- zsh_5.5.1/bin
- zsh_5.6.2/bin
- zsh_5.7.1/bin
- zsh_5.8.1/bin
- zsh_5.9.1/bin
- arm64
- zsh_4.0.9/bin
- zsh_4.2.7/bin
- zsh_5.0.8/bin
- zsh_5.1.1/bin
- zsh_5.2/bin
- zsh_5.3.1/bin
- zsh_5.4.2/bin
- zsh_5.5.1/bin
- zsh_5.6.2/bin
- zsh_5.7.1/bin
- zsh_5.8.1/bin
- zsh_5.9.1/bin
- variants
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments