1
0
Fork 0
forked from mirror/openwrt

tools/zlib: update to 1.3.2

Release Notes:
https://github.com/madler/zlib/blob/v1.3.2/ChangeLog

We also switch package tarball source to GitHub repository releases
to avoid package hash mismatch after the zstd upgrade.

The 900-* patch was suppressed by the upstream commit 15ba5055a935
("CMake: Adapt pkgconfig-file to the GnuInstallDirs layout.")

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21228
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Shiji Yang 2025-12-19 23:20:48 +08:00 committed by Hauke Mehrtens
parent 2a7cb484e9
commit 518d711461
3 changed files with 56 additions and 19 deletions

View file

@ -8,13 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=zlib
PKG_VERSION:=1.3.1
PKG_VERSION:=1.3.2
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/madler/zlib
PKG_SOURCE_VERSION:=51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf
PKG_MIRROR_HASH:=6558577038f4839057fad93afb295bf32e84dc9bd2c33512d40a5eab6d4889ef
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/madler/zlib/releases/download/v$(PKG_VERSION)
PKG_HASH:=d7a0654783a4da529d1bb793b7ad9c3318020af77667bcae35f95d0e42a792f3
PKG_LICENSE:=Zlib
PKG_LICENSE_FILES:=LICENSE

View file

@ -0,0 +1,52 @@
From 18a6dfff79b6357aada21bec506442ed96bb34da Mon Sep 17 00:00:00 2001
From: Shiji Yang <yangshiji66@outlook.com>
Date: Thu, 5 Mar 2026 00:13:35 +0800
Subject: [PATCH] deflate: workaround elfutils link error on MacOS
duplicate symbol '_crc32' in:
/Volumes/OpenWrt/openwrt/build_dir/host/elfutils-0.192/libdw/libdw.a[392](crc32.o)
/Volumes/OpenWrt/openwrt/staging_dir/host/lib/libz.a[3](crc32.o)
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
deflate.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
--- a/deflate.c
+++ b/deflate.c
@@ -970,12 +970,21 @@ local void flush_pending(z_streamp strm)
/* ===========================================================================
* Update the header CRC with the bytes s->pending_buf[beg..s->pending - 1].
*/
+#if defined(__APPLE__)
+#define HCRC_UPDATE(beg) \
+ do { \
+ if (s->gzhead->hcrc && s->pending > (beg)) \
+ strm->adler = crc32(strm->adler, s->pending_buf + (beg), \
+ s->pending - (beg)); \
+ } while (0)
+#else
#define HCRC_UPDATE(beg) \
do { \
if (s->gzhead->hcrc && s->pending > (beg)) \
strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
s->pending - (beg)); \
} while (0)
+#endif
/* ========================================================================= */
int ZEXPORT deflate(z_streamp strm, int flush) {
@@ -1108,8 +1117,13 @@ int ZEXPORT deflate(z_streamp strm, int
put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
}
if (s->gzhead->hcrc)
+#if defined(__APPLE__)
+ strm->adler = crc32(strm->adler, s->pending_buf,
+ s->pending);
+#else
strm->adler = crc32_z(strm->adler, s->pending_buf,
s->pending);
+#endif
s->gzindex = 0;
s->status = EXTRA_STATE;
}

View file

@ -1,14 +0,0 @@
--- a/zlib.pc.cmakein
+++ b/zlib.pc.cmakein
@@ -1,8 +1,8 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@INSTALL_LIB_DIR@
-sharedlibdir=@INSTALL_LIB_DIR@
-includedir=@INSTALL_INC_DIR@
+libdir=${prefix}/lib
+sharedlibdir=${prefix}/lib
+includedir=${prefix}/include
Name: zlib
Description: zlib compression library