Skip to contentSkip to conversation

zlib: upgrade to 1.2.12

PATCH In review Ross Burton 2 participants 2 messages Mar 29, 2022 – Apr 21, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zlib: upgrade to 1.2.12

First upstream release since 2017!
- Fix a deflate bug when using the Z_FIXED strategy that can result in out-of-bound accesses.
- Fix a deflate bug when the window is full in deflate_stored().
- Speed up CRC-32 computations by a factor of 1.5 to 3.
- Use the hardware CRC-32 instruction on ARMv8 processors.
- Speed up crc32_combine() with powers of x tables.
- Add crc32_combine_gen() and crc32_combine_op() for fast combines.

Drop CVE-2018-25032 as this is in the .12 release.

Rebase 0001-configure-Pass-LDFLAGS-to-link-tests.patch to apply cleanly.

Backport cc.patch to fix compilation with our CC.

---
 ...configure-Pass-LDFLAGS-to-link-tests.patch |  25 +-
 .../zlib/zlib/CVE-2018-25032.patch            | 347 ------------------
 meta/recipes-core/zlib/zlib/cc.patch          |  27 ++
 .../zlib/{zlib_1.2.11.bb => zlib_1.2.12.bb}   |   7 +-
 4 files changed, 43 insertions(+), 363 deletions(-)
 delete mode 100644 meta/recipes-core/zlib/zlib/CVE-2018-25032.patch
 create mode 100644 meta/recipes-core/zlib/zlib/cc.patch
 rename meta/recipes-core/zlib/{zlib_1.2.11.bb => zlib_1.2.12.bb} (83%)
meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch +13 -12
index 91a1b4a09a1..e6cc915ba5b 100644
@@ -1,4 +1,7 @@
-From 001971eef84485562f912d8edd4fc7688acfad91 Mon Sep 17 00:00:00 2001
+Upstream-Status: Submitted [https://github.com/madler/zlib/pull/599]
+Signed-off-by: Ross Burton <[email protected]>
+
+From f15584918a7fbbe3cc794ad59100e5e8153ea9f6 Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
 Date: Tue, 8 Mar 2022 22:38:47 -0800
 Subject: [PATCH] configure: Pass LDFLAGS to link tests
@@ -9,18 +12,16 @@ using LDFLAGS on compiler commandline along with CFLAGS to ensure the
 tests perform correctly. Without this some tests may fail resulting in
 wrong confgure result, ending in miscompiling the package
 
-Upstream-Status: Submitted [https://github.com/madler/zlib/pull/599]
-
 Signed-off-by: Khem Raj <[email protected]>
 ---
  configure | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
 
 diff --git a/configure b/configure
-index e974d1f..69dfa3f 100755
+index 52ff4a0..d04ee59 100755
 --- a/configure
 +++ b/configure
-@@ -410,7 +410,7 @@ if test $shared -eq 1; then
+@@ -427,7 +427,7 @@ if test $shared -eq 1; then
    echo Checking for shared library support... | tee -a configure.log
    # we must test in two steps (cc then ld), required at least on SunOS 4.x
    if try $CC -w -c $SFLAGS $test.c &&
@@ -29,7 +30,7 @@ index e974d1f..69dfa3f 100755
      echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
    elif test -z "$old_cc" -a -z "$old_cflags"; then
      echo No shared library support. | tee -a configure.log
-@@ -492,7 +492,7 @@ int main(void) {
+@@ -503,7 +503,7 @@ int main(void) {
  }
  EOF
    fi
@@ -37,8 +38,8 @@ index e974d1f..69dfa3f 100755
 +  if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
      sizet=`./$test`
      echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
-   else
-@@ -530,7 +530,7 @@ int main(void) {
+     CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
+@@ -537,7 +537,7 @@ int main(void) {
    return 0;
  }
  EOF
@@ -47,7 +48,7 @@ index e974d1f..69dfa3f 100755
      echo "Checking for fseeko... Yes." | tee -a configure.log
    else
      CFLAGS="${CFLAGS} -DNO_FSEEKO"
-@@ -547,7 +547,7 @@ cat > $test.c <<EOF
+@@ -554,7 +554,7 @@ cat > $test.c <<EOF
  #include <errno.h>
  int main() { return strlen(strerror(errno)); }
  EOF
@@ -56,7 +57,7 @@ index e974d1f..69dfa3f 100755
    echo "Checking for strerror... Yes." | tee -a configure.log
  else
    CFLAGS="${CFLAGS} -DNO_STRERROR"
-@@ -654,7 +654,7 @@ int main()
+@@ -661,7 +661,7 @@ int main()
    return (mytest("Hello%d\n", 1));
  }
  EOF
@@ -65,7 +66,7 @@ index e974d1f..69dfa3f 100755
      echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
  
      echo >> configure.log
-@@ -744,7 +744,7 @@ int main()
+@@ -751,7 +751,7 @@ int main()
  }
  EOF
  
@@ -75,5 +76,5 @@ index e974d1f..69dfa3f 100755
  
      echo >> configure.log
 -- 
-2.35.1
+2.25.1
 
meta/recipes-core/zlib/zlib/CVE-2018-25032.patch deleted +0 -347

347 lines not on this page · raw message

meta/recipes-core/zlib/zlib/cc.patch new file +27 -0
new file mode 100644
index 00000000000..8fb974ded4a
@@ -0,0 +1,27 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <[email protected]>
+
+From 05796d3d8d5546cf1b4dfe2cd72ab746afae505d Mon Sep 17 00:00:00 2001
+From: Mark Adler <[email protected]>
+Date: Mon, 28 Mar 2022 18:34:10 -0700
+Subject: [PATCH] Fix configure issue that discarded provided CC definition.
+
+---
+ configure | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/configure b/configure
+index 52ff4a04e..3fa3e8618 100755
+--- a/configure
++++ b/configure
+@@ -174,7 +174,10 @@ if test -z "$CC"; then
+   else
+     cc=${CROSS_PREFIX}cc
+   fi
++else
++  cc=${CC}
+ fi
++
+ cflags=${CFLAGS-"-O3"}
+ # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
+ case "$cc" in
meta/recipes-core/zlib/zlib_1.2.12.bb renamed from meta/recipes-core/zlib/zlib_1.2.11.bb +3 -4
similarity index 83%
rename from meta/recipes-core/zlib/zlib_1.2.11.bb
rename to meta/recipes-core/zlib/zlib_1.2.12.bb
index f8bcc0abcf8..95e873584ba 100644
@@ -6,16 +6,15 @@ SECTION = "libs"
 LICENSE = "Zlib"
 LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef63bc555f7aa6c0"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
+SRC_URI = "https://zlib.net/${BP}.tar.xz \
+           file://cc.patch \
            file://ldflags-tests.patch \
            file://0001-configure-Pass-LDFLAGS-to-link-tests.patch \
-           file://CVE-2018-25032.patch \
            file://run-ptest \
            "
 UPSTREAM_CHECK_URI = "http://zlib.net/"
 
-SRC_URI[md5sum] = "85adef240c5f370b308da8c938951a68"
-SRC_URI[sha256sum] = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066"
+SRC_URI[sha256sum] = "7db46b8d7726232a621befaab4a1c870f00a90805511c0e0090441dac57def18"
 
 CFLAGS += "-D_REENTRANT"
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 8 lines · Ross Burton

First upstream release since 2017!
- Fix a deflate bug when using the Z_FIXED strategy that can result in out-of-bound accesses.
- Fix a deflate bug when the window is full in deflate_stored().
- Speed up CRC-32 computations by a factor of 1.5 to 3.
- Use the hardware CRC-32 instruction on ARMv8 processors.
- Speed up crc32_combine() with powers of x tables.
- Add crc32_combine_gen() and crc32_combine_op() for fast combines.

Quoted 7 lines

Drop CVE-2018-25032 as this is in the .12 release.

Rebase 0001-configure-Pass-LDFLAGS-to-link-tests.patch to apply cleanly.

Backport cc.patch to fix compilation with our CC.

For whatever reason, this breaks building icedtea7-native from meta-java on my Fedora 35 system.

Jacob