af126b8f0cf9ddc553a78869a3c820a4bd4fdc59
braney
  Mon Aug 17 13:36:13 2026 -0700
build: link the browser against zlib-ng instead of the system zlib, refs #38125

Adds zlib-ng as a second git submodule, alongside htslib, and points ZLIB at it.
It is built with --zlib-compat, so the header and the symbol names are the
ordinary zlib ones and no calling code has to change.

Measured over the eight Recommended Track Set pages, hgTracks uses 29 percent
less processor time and 26 percent less wall clock, and the image it produces is
pixel identical. Writing the PNG is about three times faster and reading a
bigBed data block about twice as fast, which is why the gain is larger than the
image work alone would give.

This also makes the platforms agree. x86_64 was linking a static /lib64/libz.a
only because that file happened to be present, the arm64 Docker build fell
through to a shared -lz, and Darwin was taking MacPorts zlib. All three now use
the submodule.

Verified on x86_64 Linux, aarch64 Linux and Apple silicon: zlib-ng builds, its
own test suite passes, the makefiles pick it up, and bigBedToBed output is byte
identical to before the change.

diff --git .gitignore .gitignore
index f06a31882cb..4af1a081f1a 100644
--- .gitignore
+++ .gitignore
@@ -11,30 +11,31 @@
 *.pyo
 tags
 *.gcno
 
 .emacs.bak/
 .claude/
 src/hg/pslCDnaFilter/algo.h
 src/hg/pslCDnaFilter/usage.h
 
 compiled/
 
 # for those that build kent/bin/
 /bin
 
 # build droppings
+src/submodules/zlib-ng-configure.log
 src/hg/hgGateway/hgGateway.html.h
 src/hg/hgPhyloPlace/phyloPlace
 src/isPcr/webPcr/webPcr
 src/utils/pslMap/usage.h
 src/utils/pslMap/usage.msg
 src/webBlat/webBlat
 
 # test results
 **/tests/output/
 **/test/output/
 src/lib/tests/bin/
 src/hg/lib/tests/loader
 
 # other tests output follow conventions
 src/hg/autoDtd/test/chado/out.atree