mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-11-05 20:30:18 +00:00
Some extensions compile their JIT bitcode with debug info: postgis
passes autoconf's default CFLAGS ("-g -O2") through PG_CPPFLAGS, and
pg_textsearch hard-codes -g there. The DIFile entries then reference
headers in clang-wrapper, glibc-dev, postgresql-dev and other -dev
outputs, pulling the whole LLVM toolchain into the runtime closure.
Native objects are stripped, but the bitcode is not.
PostgreSQL already runs nuke-refs on its own bitcode, so do the same
for extensions. SQL-only extensions have no lib/, hence the check.
On x86_64-linux with PostgreSQL 18, this shrinks the closure of postgis
from 2.8 GiB to 654 MiB and of pg_textsearch from 2.4 GiB to 40 MiB.
JIT inlining from the processed postgis bitcode was verified to still
work.
Assisted-by: Claude Code (Claude Opus 5.5)
6.4 KiB
6.4 KiB