Accepting request 1059549 from devel:libraries:c_c++

OBS-URL: https://build.opensuse.org/request/show/1059549
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zlib?expand=0&rev=86
This commit is contained in:
Dominique Leuenberger 2023-01-21 18:09:42 +00:00 committed by Git OBS Bridge
commit dab4e4a105
16 changed files with 2707 additions and 2447 deletions

File diff suppressed because it is too large Load Diff

View File

@ -27,11 +27,11 @@ Author: Matheus Castanho <msc@linux.ibm.com>
create mode 100644 contrib/power/slide_hash_power8.c
create mode 100644 contrib/power/slide_hash_resolver.c
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 44de486f6..8208c626b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -186,7 +186,8 @@ if(CMAKE_COMPILER_IS_GNUCC)
Index: zlib-1.2.13/CMakeLists.txt
===================================================================
--- zlib-1.2.13.orig/CMakeLists.txt
+++ zlib-1.2.13/CMakeLists.txt
@@ -174,7 +174,8 @@ if(CMAKE_COMPILER_IS_GNUCC)
add_definitions(-DZ_POWER8)
set(ZLIB_POWER8
contrib/power/adler32_power8.c
@ -41,11 +41,11 @@ index 44de486f6..8208c626b 100644
set_source_files_properties(
${ZLIB_POWER8}
diff --git a/Makefile.in b/Makefile.in
index 9ef9fa9b5..f71c6eae0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -183,6 +183,9 @@ crc32_z_power8.o: $(SRCDIR)contrib/power/crc32_z_power8.c
Index: zlib-1.2.13/Makefile.in
===================================================================
--- zlib-1.2.13.orig/Makefile.in
+++ zlib-1.2.13/Makefile.in
@@ -185,6 +185,9 @@ crc32-vx.o: $(SRCDIR)contrib/s390/crc32-
deflate.o: $(SRCDIR)deflate.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
@ -55,7 +55,7 @@ index 9ef9fa9b5..f71c6eae0 100644
infback.o: $(SRCDIR)infback.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)infback.c
@@ -245,6 +248,11 @@ deflate.lo: $(SRCDIR)deflate.c
@@ -252,6 +255,11 @@ deflate.lo: $(SRCDIR)deflate.c
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
-@mv objs/deflate.o $@
@ -67,11 +67,11 @@ index 9ef9fa9b5..f71c6eae0 100644
infback.lo: $(SRCDIR)infback.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
diff --git a/configure b/configure
index 810a7404d..d0dacf9c2 100755
--- a/configure
+++ b/configure
@@ -879,8 +879,8 @@ if tryboth $CC -c $CFLAGS $test.c; then
Index: zlib-1.2.13/configure
===================================================================
--- zlib-1.2.13.orig/configure
+++ zlib-1.2.13/configure
@@ -898,8 +898,8 @@ if tryboth $CC -c $CFLAGS $test.c; then
if tryboth $CC -c $CFLAGS -mcpu=power8 $test.c; then
POWER8="-DZ_POWER8"
@ -82,10 +82,10 @@ index 810a7404d..d0dacf9c2 100755
echo "Checking for -mcpu=power8 support... Yes." | tee -a configure.log
else
echo "Checking for -mcpu=power8 support... No." | tee -a configure.log
diff --git a/contrib/power/power.h b/contrib/power/power.h
index f57c76167..28c8f78ca 100644
--- a/contrib/power/power.h
+++ b/contrib/power/power.h
Index: zlib-1.2.13/contrib/power/power.h
===================================================================
--- zlib-1.2.13.orig/contrib/power/power.h
+++ zlib-1.2.13/contrib/power/power.h
@@ -4,7 +4,10 @@
*/
#include "../../zconf.h"
@ -97,11 +97,10 @@ index f57c76167..28c8f78ca 100644
unsigned long _crc32_z_power8(unsigned long, const Bytef *, z_size_t);
+
+void _slide_hash_power8(deflate_state *s);
diff --git a/contrib/power/slide_hash_power8.c b/contrib/power/slide_hash_power8.c
new file mode 100644
index 000000000..c5a0eb5a6
Index: zlib-1.2.13/contrib/power/slide_hash_power8.c
===================================================================
--- /dev/null
+++ b/contrib/power/slide_hash_power8.c
+++ zlib-1.2.13/contrib/power/slide_hash_power8.c
@@ -0,0 +1,63 @@
+ /* Copyright (C) 2019 Matheus Castanho <msc@linux.ibm.com>, IBM
+ * For conditions of distribution and use, see copyright notice in zlib.h
@ -166,11 +165,10 @@ index 000000000..c5a0eb5a6
+ slide_hash_power8_loop(s,n,p);
+#endif
+}
diff --git a/contrib/power/slide_hash_resolver.c b/contrib/power/slide_hash_resolver.c
new file mode 100644
index 000000000..54fa1eb21
Index: zlib-1.2.13/contrib/power/slide_hash_resolver.c
===================================================================
--- /dev/null
+++ b/contrib/power/slide_hash_resolver.c
+++ zlib-1.2.13/contrib/power/slide_hash_resolver.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2019 Matheus Castanho <msc@linux.ibm.com>, IBM
+ * For conditions of distribution and use, see copyright notice in zlib.h
@ -187,12 +185,12 @@ index 000000000..54fa1eb21
+
+ return slide_hash_default;
+}
diff --git a/deflate.c b/deflate.c
index 799fb93cc..b2db576dc 100644
--- a/deflate.c
+++ b/deflate.c
@@ -196,6 +196,13 @@ local const config configuration_table[10] = {
(unsigned)(s->hash_size-1)*sizeof(*s->head)); \
Index: zlib-1.2.13/deflate.c
===================================================================
--- zlib-1.2.13.orig/deflate.c
+++ zlib-1.2.13/deflate.c
@@ -204,6 +204,13 @@ local const config configuration_table[1
(unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
} while (0)
+#ifdef Z_POWER_OPT
@ -205,7 +203,7 @@ index 799fb93cc..b2db576dc 100644
/* ===========================================================================
* Slide the hash table when sliding the window down (could be avoided with 32
* bit values at the expense of memory usage). We slide even when level == 0 to
@@ -227,6 +234,11 @@ local void slide_hash(s)
@@ -235,6 +242,11 @@ local void slide_hash(s)
#endif
}

View File

@ -20,11 +20,11 @@ Author: Matheus Castanho <msc@linux.ibm.com>
create mode 100644 contrib/power/longest_match_power9.c
create mode 100644 contrib/power/longest_match_resolver.c
Index: zlib-1.2.12/CMakeLists.txt
Index: zlib-1.2.13/CMakeLists.txt
===================================================================
--- zlib-1.2.12.orig/CMakeLists.txt
+++ zlib-1.2.12/CMakeLists.txt
@@ -199,7 +199,8 @@ if(CMAKE_COMPILER_IS_GNUCC)
--- zlib-1.2.13.orig/CMakeLists.txt
+++ zlib-1.2.13/CMakeLists.txt
@@ -187,7 +187,8 @@ if(CMAKE_COMPILER_IS_GNUCC)
if(POWER9)
add_definitions(-DZ_POWER9)
@ -34,11 +34,11 @@ Index: zlib-1.2.12/CMakeLists.txt
set_source_files_properties(
${ZLIB_POWER9}
Index: zlib-1.2.12/Makefile.in
Index: zlib-1.2.13/Makefile.in
===================================================================
--- zlib-1.2.12.orig/Makefile.in
+++ zlib-1.2.12/Makefile.in
@@ -189,6 +189,9 @@ crc32-vx.o: $(SRCDIR)contrib/s390/crc32-
--- zlib-1.2.13.orig/Makefile.in
+++ zlib-1.2.13/Makefile.in
@@ -185,6 +185,9 @@ crc32-vx.o: $(SRCDIR)contrib/s390/crc32-
deflate.o: $(SRCDIR)deflate.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
@ -48,7 +48,7 @@ Index: zlib-1.2.12/Makefile.in
slide_hash_power8.o: $(SRCDIR)contrib/power/slide_hash_power8.c
$(CC) $(CFLAGS) -mcpu=power8 $(ZINC) -c -o $@ $(SRCDIR)contrib/power/slide_hash_power8.c
@@ -259,6 +262,11 @@ deflate.lo: $(SRCDIR)deflate.c
@@ -255,6 +258,11 @@ deflate.lo: $(SRCDIR)deflate.c
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
-@mv objs/deflate.o $@
@ -60,11 +60,11 @@ Index: zlib-1.2.12/Makefile.in
slide_hash_power8.lo: $(SRCDIR)contrib/power/slide_hash_power8.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) -mcpu=power8 $(ZINC) -DPIC -c -o objs/slide_hash_power8.o $(SRCDIR)contrib/power/slide_hash_power8.c
Index: zlib-1.2.12/configure
Index: zlib-1.2.13/configure
===================================================================
--- zlib-1.2.12.orig/configure
+++ zlib-1.2.12/configure
@@ -915,8 +915,8 @@ if tryboth $CC -c $CFLAGS $test.c; then
--- zlib-1.2.13.orig/configure
+++ zlib-1.2.13/configure
@@ -907,8 +907,8 @@ if tryboth $CC -c $CFLAGS $test.c; then
if tryboth $CC -c $CFLAGS -mcpu=power9 $test.c; then
POWER9="-DZ_POWER9"
@ -75,10 +75,10 @@ Index: zlib-1.2.12/configure
echo "Checking for -mcpu=power9 support... Yes." | tee -a configure.log
else
echo "Checking for -mcpu=power9 support... No." | tee -a configure.log
Index: zlib-1.2.12/contrib/power/longest_match_power9.c
Index: zlib-1.2.13/contrib/power/longest_match_power9.c
===================================================================
--- /dev/null
+++ zlib-1.2.12/contrib/power/longest_match_power9.c
+++ zlib-1.2.13/contrib/power/longest_match_power9.c
@@ -0,0 +1,194 @@
+/* Copyright (C) 2019 Matheus Castanho <msc@linux.ibm.com>, IBM
+ * For conditions of distribution and use, see copyright notice in zlib.h
@ -274,10 +274,10 @@ Index: zlib-1.2.12/contrib/power/longest_match_power9.c
+ if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+ return s->lookahead;
+}
Index: zlib-1.2.12/contrib/power/longest_match_resolver.c
Index: zlib-1.2.13/contrib/power/longest_match_resolver.c
===================================================================
--- /dev/null
+++ zlib-1.2.12/contrib/power/longest_match_resolver.c
+++ zlib-1.2.13/contrib/power/longest_match_resolver.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2019 Matheus Castanho <msc@linux.ibm.com>, IBM
+ * For conditions of distribution and use, see copyright notice in zlib.h
@ -294,10 +294,10 @@ Index: zlib-1.2.12/contrib/power/longest_match_resolver.c
+
+ return longest_match_default;
+}
Index: zlib-1.2.12/contrib/power/power.h
Index: zlib-1.2.13/contrib/power/power.h
===================================================================
--- zlib-1.2.12.orig/contrib/power/power.h
+++ zlib-1.2.12/contrib/power/power.h
--- zlib-1.2.13.orig/contrib/power/power.h
+++ zlib-1.2.13/contrib/power/power.h
@@ -10,4 +10,6 @@ uLong _adler32_power8(uLong adler, const
unsigned long _crc32_z_power8(unsigned long, const Bytef *, z_size_t);
@ -305,13 +305,13 @@ Index: zlib-1.2.12/contrib/power/power.h
+uInt _longest_match_power9(deflate_state *s, IPos cur_match);
+
void _slide_hash_power8(deflate_state *s);
Index: zlib-1.2.12/deflate.c
Index: zlib-1.2.13/deflate.c
===================================================================
--- zlib-1.2.12.orig/deflate.c
+++ zlib-1.2.12/deflate.c
@@ -1309,6 +1309,14 @@ local void lm_init (s)
/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
* match.S. The code will be functionally equivalent.
--- zlib-1.2.13.orig/deflate.c
+++ zlib-1.2.13/deflate.c
@@ -1313,6 +1313,14 @@ local void lm_init(s)
* string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
* OUT assertion: the match length is not greater than s->lookahead.
*/
+
+#ifdef Z_POWER_OPT
@ -324,9 +324,9 @@ Index: zlib-1.2.12/deflate.c
local uInt longest_match(s, pcur_match)
deflate_state *s;
IPos pcur_match; /* current match */
@@ -1454,6 +1462,11 @@ local uInt longest_match(s, pcur_match)
@@ -1460,6 +1468,11 @@ local uInt longest_match(s, pcur_match)
return s->lookahead;
}
#endif /* ASMV */
+#ifdef Z_POWER_OPT
+#undef longest_match

View File

@ -1,51 +0,0 @@
From ec3df00224d4b396e2ac6586ab5d25f673caa4c2 Mon Sep 17 00:00:00 2001
From: Mark Adler <madler@alumni.caltech.edu>
Date: Wed, 30 Mar 2022 11:14:53 -0700
Subject: [PATCH] Correct incorrect inputs provided to the CRC functions.
The previous releases of zlib were not sensitive to incorrect CRC
inputs with bits set above the low 32. This commit restores that
behavior, so that applications with such bugs will continue to
operate as before.
---
crc32.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/crc32.c b/crc32.c
index a1bdce5c2..451887bc7 100644
--- a/crc32.c
+++ b/crc32.c
@@ -630,7 +630,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
#endif /* DYNAMIC_CRC_TABLE */
/* Pre-condition the CRC */
- crc ^= 0xffffffff;
+ crc = (~crc) & 0xffffffff;
/* Compute the CRC up to a word boundary. */
while (len && ((z_size_t)buf & 7) != 0) {
@@ -749,7 +749,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
#endif /* DYNAMIC_CRC_TABLE */
/* Pre-condition the CRC */
- crc ^= 0xffffffff;
+ crc = (~crc) & 0xffffffff;
#ifdef W
@@ -1077,7 +1077,7 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
#ifdef DYNAMIC_CRC_TABLE
once(&made, make_crc_table);
#endif /* DYNAMIC_CRC_TABLE */
- return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
+ return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
}
/* ========================================================================= */
@@ -1112,5 +1112,5 @@ uLong crc32_combine_op(crc1, crc2, op)
uLong crc2;
uLong op;
{
- return multmodp(op, crc1) ^ crc2;
+ return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
}

View File

@ -1,14 +0,0 @@
--- zlib-1.2.12/inflate.c.old 2022-08-09 10:30:18.831225181 +0000
+++ zlib-1.2.12/inflate.c 2022-08-09 10:29:33.251225181 +0000
@@ -792,8 +792,9 @@ int flush;
if (copy > have) copy = have;
if (copy) {
if (state->head != Z_NULL &&
- state->head->extra != Z_NULL) {
- len = state->head->extra_len - state->length;
+ state->head->extra != Z_NULL &&
+ (len = state->head->extra_len - state->length) <
+ state->head->extra_max) {
zmemcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);

View File

@ -1,24 +0,0 @@
From 6378872888c85c02f340126712684e0f603f5e76 Mon Sep 17 00:00:00 2001
From: Ilya Leoshkevich <iii@linux.ibm.com>
Date: Wed, 27 Apr 2022 14:38:23 +0200
Subject: [PATCH] zlib-1.2.12-fix-configure.patch
---
configure | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configure b/configure
index cff6207ec..dd01b5c0e 100755
--- a/configure
+++ b/configure
@@ -185,7 +185,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

View File

@ -18,19 +18,19 @@ choose between the regular and the vectorized implementations.
create mode 100644 contrib/s390/crc32-vx.c
create mode 100644 contrib/s390/crc32_z_resolver.c
diff --git a/Makefile.in b/Makefile.in
index 2e78f3844..04c2f5d53 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -29,6 +29,7 @@ LDFLAGS=
TEST_LDFLAGS=-L. libz.a
Index: zlib-1.2.13/Makefile.in
===================================================================
--- zlib-1.2.13.orig/Makefile.in
+++ zlib-1.2.13/Makefile.in
@@ -25,6 +25,7 @@ LDFLAGS=
TEST_LDFLAGS=$(LDFLAGS) -L. libz.a
LDSHARED=$(CC)
CPP=$(CC) -E
+VGFMAFLAG=
STATICLIB=libz.a
SHAREDLIB=libz.so
@@ -179,6 +180,9 @@ crc32.o: $(SRCDIR)crc32.c
@@ -175,6 +176,9 @@ crc32.o: $(SRCDIR)crc32.c
crc32_z_power8.o: $(SRCDIR)contrib/power/crc32_z_power8.c
$(CC) $(CFLAGS) -mcpu=power8 $(ZINC) -c -o $@ $(SRCDIR)contrib/power/crc32_z_power8.c
@ -40,7 +40,7 @@ index 2e78f3844..04c2f5d53 100644
deflate.o: $(SRCDIR)deflate.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
@@ -229,6 +233,11 @@ crc32.lo: $(SRCDIR)crc32.c
@@ -225,6 +229,11 @@ crc32.lo: $(SRCDIR)crc32.c
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
-@mv objs/crc32.o $@
@ -52,11 +52,11 @@ index 2e78f3844..04c2f5d53 100644
crc32_z_power8.lo: $(SRCDIR)contrib/power/crc32_z_power8.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) -mcpu=power8 $(ZINC) -DPIC -c -o objs/crc32_z_power8.o $(SRCDIR)contrib/power/crc32_z_power8.c
diff --git a/configure b/configure
index dd01b5c0e..acf94a599 100755
--- a/configure
+++ b/configure
@@ -929,6 +929,32 @@ else
Index: zlib-1.2.13/configure
===================================================================
--- zlib-1.2.13.orig/configure
+++ zlib-1.2.13/configure
@@ -921,6 +921,32 @@ else
echo "Checking for Power optimizations support... No." | tee -a configure.log
fi
@ -89,7 +89,7 @@ index dd01b5c0e..acf94a599 100755
# show the results in the log
echo >> configure.log
echo ALL = $ALL >> configure.log
@@ -960,6 +986,7 @@ echo mandir = $mandir >> configure.log
@@ -952,6 +978,7 @@ echo mandir = $mandir >> configure.log
echo prefix = $prefix >> configure.log
echo sharedlibdir = $sharedlibdir >> configure.log
echo uname = $uname >> configure.log
@ -97,7 +97,7 @@ index dd01b5c0e..acf94a599 100755
# udpate Makefile with the configure results
sed < ${SRCDIR}Makefile.in "
@@ -969,6 +996,7 @@ sed < ${SRCDIR}Makefile.in "
@@ -961,6 +988,7 @@ sed < ${SRCDIR}Makefile.in "
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
/^LDSHARED *=/s#=.*#=$LDSHARED#
/^CPP *=/s#=.*#=$CPP#
@ -105,10 +105,10 @@ index dd01b5c0e..acf94a599 100755
/^STATICLIB *=/s#=.*#=$STATICLIB#
/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
diff --git a/contrib/gcc/zifunc.h b/contrib/gcc/zifunc.h
index daf4fe442..b62379ed8 100644
--- a/contrib/gcc/zifunc.h
+++ b/contrib/gcc/zifunc.h
Index: zlib-1.2.13/contrib/gcc/zifunc.h
===================================================================
--- zlib-1.2.13.orig/contrib/gcc/zifunc.h
+++ zlib-1.2.13/contrib/gcc/zifunc.h
@@ -8,9 +8,28 @@
/* Helpers for arch optimizations */
@ -139,11 +139,10 @@ index daf4fe442..b62379ed8 100644
/* This is a helper macro to declare a resolver for an indirect function
* (ifunc). Let's say you have function
*
diff --git a/contrib/s390/crc32-vx.c b/contrib/s390/crc32-vx.c
new file mode 100644
index 000000000..fa5387c11
Index: zlib-1.2.13/contrib/s390/crc32-vx.c
===================================================================
--- /dev/null
+++ b/contrib/s390/crc32-vx.c
+++ zlib-1.2.13/contrib/s390/crc32-vx.c
@@ -0,0 +1,195 @@
+/*
+ * Hardware-accelerated CRC-32 variants for Linux on z Systems
@ -340,11 +339,10 @@ index 000000000..fa5387c11
+
+ return ((uv4si)v2)[2];
+}
diff --git a/contrib/s390/crc32_z_resolver.c b/contrib/s390/crc32_z_resolver.c
new file mode 100644
index 000000000..9749cab40
Index: zlib-1.2.13/contrib/s390/crc32_z_resolver.c
===================================================================
--- /dev/null
+++ b/contrib/s390/crc32_z_resolver.c
+++ zlib-1.2.13/contrib/s390/crc32_z_resolver.c
@@ -0,0 +1,41 @@
+#include <sys/auxv.h>
+#include "../gcc/zifunc.h"
@ -387,11 +385,11 @@ index 000000000..9749cab40
+ return s390_crc32_vx;
+ return crc32_z_default;
+}
diff --git a/crc32.c b/crc32.c
index ae7b7e792..c2122615b 100644
--- a/crc32.c
+++ b/crc32.c
@@ -736,12 +736,12 @@ local z_word_t crc_word_big(data)
Index: zlib-1.2.13/crc32.c
===================================================================
--- zlib-1.2.13.orig/crc32.c
+++ zlib-1.2.13/crc32.c
@@ -745,12 +745,12 @@ local z_word_t crc_word_big(data)
#endif
/* ========================================================================= */
@ -406,7 +404,7 @@ index ae7b7e792..c2122615b 100644
unsigned long ZEXPORT crc32_z(crc, buf, len)
unsigned long crc;
@@ -1064,10 +1064,15 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
@@ -1073,10 +1073,15 @@ unsigned long ZEXPORT crc32_z(crc, buf,
return crc ^ 0xffffffff;
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9
size 1490071

View File

@ -1,7 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iF0EABECAB0WIQRe1GpnIdNlWHeR4qp4P82OWLyvugUCYkEexwAKCRB4P82OWLyv
ulGRAJ9CLw3LBVZKeIM2JY0MS3obrzTSzgCgqEHUCY42CMzYyrTLazKS6ymTC/4=
=mgXG
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,27 @@
From e554695638228b846d49657f31eeff0ca4680e8a Mon Sep 17 00:00:00 2001
From: Mark Adler <madler@alumni.caltech.edu>
Date: Thu, 15 Dec 2022 09:07:13 -0800
Subject: [PATCH] Fix bug in deflateBound() for level 0 and memLevel 9.
memLevel 9 would cause deflateBound() to assume the use of fixed
blocks, even if the compression level was 0, which forces stored
blocks. That could result in a bound less than the size of the
compressed data. Now level 0 always uses the stored blocks bound.
---
deflate.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/deflate.c b/deflate.c
index cd538b8ac..4a512e1f9 100644
--- a/deflate.c
+++ b/deflate.c
@@ -752,7 +752,8 @@ uLong ZEXPORT deflateBound(strm, sourceLen)
/* if not default parameters, return one of the conservative bounds */
if (s->w_bits != 15 || s->hash_bits != 8 + 7)
- return (s->w_bits <= s->hash_bits ? fixedlen : storelen) + wraplen;
+ return (s->w_bits <= s->hash_bits && s->level ? fixedlen : storelen) +
+ wraplen;
/* default settings: return tight bound for that case -- ~0.03% overhead
plus a small constant */

View File

@ -3,8 +3,8 @@ Index: deflate.c
--- deflate.c.orig
+++ deflate.c
@@ -1233,15 +1233,16 @@ local void lm_init (s)
/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
* match.S. The code will be functionally equivalent.
* string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
* OUT assertion: the match length is not greater than s->lookahead.
*/
-local uInt longest_match(s, cur_match)
+local uInt longest_match(s, pcur_match)
@ -27,14 +27,14 @@ Index: deflate.c
*/
register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
- register ush scan_start = *(ushf*)scan;
- register ush scan_end = *(ushf*)(scan+best_len-1);
- register ush scan_end = *(ushf*)(scan + best_len - 1);
+ register uInt scan_start = *(ushf*)scan;
+ register uInt scan_end = *(ushf*)(scan+best_len-1);
+ register uInt scan_end = *(ushf*)(scan + best_len - 1);
#else
register Bytef *strend = s->window + s->strstart + MAX_MATCH;
- register Byte scan_end1 = scan[best_len-1];
- register Byte scan_end1 = scan[best_len - 1];
- register Byte scan_end = scan[best_len];
+ register uInt scan_end1 = scan[best_len-1];
+ register uInt scan_end1 = scan[best_len - 1];
+ register uInt scan_end = scan[best_len];
#endif

BIN
zlib-1.2.13.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

7
zlib-1.2.13.tar.gz.asc Normal file
View File

@ -0,0 +1,7 @@
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iF0EABECAB0WIQRe1GpnIdNlWHeR4qp4P82OWLyvugUCY0h42QAKCRB4P82OWLyv
upvZAKCF7EgWGaMEfO78WnkA8hivLlBMlACgyI7Vm2A5BI2jI+h23yqrKjgQC5s=
=umRA
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,33 @@
-------------------------------------------------------------------
Thu Jan 19 11:07:25 UTC 2023 - Danilo Spinella <danilo.spinella@suse.com>
- Update to 1.13:
* Fix configure issue that discarded provided CC definition
* Correct incorrect inputs provided to the CRC functions
* Repair prototypes and exporting of new CRC functions
* Fix inflateBack to detect invalid input with distances too far
* Have infback() deliver all of the available output up to any error
* Fix a bug when getting a gzip header extra field with inflate()
* Fix bug in block type selection when Z_FIXED used
* Tighten deflateBound bounds
* Remove deleted assembler code references
* Various portability and appearance improvements
- Added patches:
* zlib-1.2.13-IBM-Z-hw-accelerated-deflate-s390x.patch
* zlib-1.2.13-fix-bug-deflateBound.patch
* zlib-1.2.13-optimized-s390.patch
- Refreshed patches:
* zlib-1.2.12-add-optimized-slide_hash-for-power.patch
* zlib-1.2.12-add-vectorized-longest_match-for-power.patch
* zlib-1.2.12-s390-vectorize-crc32.patch
- Removed patches:
* zlib-1.2.12-fix-configure.patch
* zlib-1.2.12-IBM-Z-hw-accelerated-deflate-s390x.patch
* zlib-1.2.12-optimized-crc32-power8.patch
* zlib-1.2.12-correct-inputs-provided-to-crc-func.patch
* zlib-1.2.12-fix-CVE-2022-37434.patch
* zlib-1.2.11-optimized-s390.patch
-------------------------------------------------------------------
Sun Dec 11 16:41:51 UTC 2022 - Dirk Müller <dmueller@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package zlib
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,7 +17,7 @@
Name: zlib
Version: 1.2.12
Version: 1.2.13
Release: 0
Summary: Library implementing the DEFLATE compression algorithm
License: Zlib
@ -30,26 +30,23 @@ Source5: baselibs.conf
Source6: zlib-rpmlintrc
#PATCH-FIX-SUSE: compiler check of varguments passed to gzprintf
Patch1: zlib-format.patch
#PATCH-FIX-UPSTREAM do not store negative values in uInt
#PATCH-FIX-SUSE do not store negative values in uInt
Patch2: 0001-Do-not-try-to-store-negative-values-in-unsigned-int.patch
#PATCH-FIX-SUSE do not check exact version match as the lib can be updated
# we should simply rely on soname versioning to protect us
Patch3: zlib-no-version-check.patch
#PATCH-FIX-UPSTREAM https://github.com/madler/zlib/commit/ec3df00224d4
Patch4: zlib-1.2.12-correct-inputs-provided-to-crc-func.patch
#PATCH-FIX-UPSTREAM https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d
Patch5: zlib-1.2.12-fix-CVE-2022-37434.patch
#PATCH-FIX-UPSTREAM https://github.com/madler/zlib/pull/229
Patch6: minizip-dont-install-crypt-header.patch
# The following patches are taken from https://github.com/iii-i/zlib/commits/crc32vx-v3
#PATCH-FIX-SUSE https://github.com/madler/zlib/pull/229
Patch4: minizip-dont-install-crypt-header.patch
# PATCH-FIX-UPSTREAM https://github.com/madler/zlib/commit/e554695638228b846d49657f31eeff0ca4680e8a
Patch5: zlib-1.2.13-fix-bug-deflateBound.patch
#PATCH-FIX-SUSE https://github.com/madler/zlib/pull/410
Patch6: zlib-1.2.13-IBM-Z-hw-accelerated-deflate-s390x.patch
# Patches taken from https://github.com/iii-i/zlib/releases/tag/crc32vx-v3
Patch7: zlib-1.2.5-minizip-fixuncrypt.patch
Patch8: zlib-1.2.11-optimized-s390.patch
Patch8: zlib-1.2.13-optimized-s390.patch
# https://github.com/iii-i/zlib/commit/171d0ff3c9ed40da0ac14085ab16b766b1162069
Patch9: zlib-1.2.12-IBM-Z-hw-accelerated-deflate-s390x.patch
Patch10: zlib-1.2.11-covscan-issues.patch
Patch11: zlib-1.2.11-covscan-issues-rhel9.patch
Patch12: zlib-1.2.12-optimized-crc32-power8.patch
Patch13: zlib-1.2.12-fix-configure.patch
Patch14: zlib-1.2.12-s390-vectorize-crc32.patch
# The following patches are taken from https://github.com/mscastanho/zlib/commits/power-optimizations-1.2.12
Patch15: zlib-1.2.12-adler32-vector-optimizations-for-power.patch
@ -148,11 +145,8 @@ It should exit 0
%patch6 -p1
%patch7 -p1
%patch8
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1