diff -Nru zlib-1.2.11.dfsg/debian/changelog zlib-1.2.11.dfsg/debian/changelog --- zlib-1.2.11.dfsg/debian/changelog 2021-08-12 05:45:49.000000000 +0200 +++ zlib-1.2.11.dfsg/debian/changelog 2022-03-09 09:30:05.000000000 +0100 @@ -1,3 +1,12 @@ +zlib (1:1.2.11.dfsg-2ubuntu8) jammy; urgency=medium + + * d/p/410-lp1961427.patch ported from zlib #410, fixing + compressBound() with hw acceleration. LP: #1961427 + Refreshed some quilt patches just to remove offsets. + Thanks to Ilya Leoshkevich . + + -- Frank Heimes Wed, 09 Mar 2022 09:30:05 +0100 + zlib (1:1.2.11.dfsg-2ubuntu7) impish; urgency=medium [ Simon Chopin ] diff -Nru zlib-1.2.11.dfsg/debian/patches/335.diff zlib-1.2.11.dfsg/debian/patches/335.diff --- zlib-1.2.11.dfsg/debian/patches/335.diff 2020-09-07 05:27:36.000000000 +0200 +++ zlib-1.2.11.dfsg/debian/patches/335.diff 2022-03-09 08:17:28.000000000 +0100 @@ -2,7 +2,7 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -75,11 +75,11 @@ PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA) +@@ -75,11 +75,11 @@ all: static shared @@ -17,7 +17,7 @@ check: test -@@ -87,7 +87,7 @@ test: all teststatic testshared +@@ -87,7 +87,7 @@ teststatic: static @TMPST=tmpst_$$; \ @@ -26,7 +26,7 @@ echo ' *** zlib test OK ***'; \ else \ echo ' *** zlib test FAILED ***'; false; \ -@@ -100,7 +100,7 @@ testshared: shared +@@ -100,7 +100,7 @@ DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \ SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \ TMPSH=tmpsh_$$; \ @@ -35,7 +35,7 @@ echo ' *** zlib shared test OK ***'; \ else \ echo ' *** zlib shared test FAILED ***'; false; \ -@@ -109,7 +109,7 @@ testshared: shared +@@ -109,7 +109,7 @@ test64: all64 @TMP64=tmp64_$$; \ @@ -44,7 +44,7 @@ echo ' *** zlib 64-bit test OK ***'; \ else \ echo ' *** zlib 64-bit test FAILED ***'; false; \ -@@ -151,12 +151,18 @@ dfltcc.lo: $(SRCDIR)contrib/s390/dfltcc. +@@ -151,12 +151,18 @@ $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/dfltcc.o $(SRCDIR)contrib/s390/dfltcc.c -@mv objs/dfltcc.o $@ @@ -63,7 +63,7 @@ example64.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/example.c -@@ -170,6 +176,9 @@ adler32.o: $(SRCDIR)adler32.c +@@ -170,6 +176,9 @@ crc32.o: $(SRCDIR)crc32.c $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c @@ -73,7 +73,7 @@ deflate.o: $(SRCDIR)deflate.c $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c -@@ -220,6 +229,11 @@ crc32.lo: $(SRCDIR)crc32.c +@@ -220,6 +229,11 @@ $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c -@mv objs/crc32.o $@ @@ -85,7 +85,7 @@ deflate.lo: $(SRCDIR)deflate.c -@mkdir objs 2>/dev/null || test -d objs $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c -@@ -293,18 +307,27 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz. +@@ -293,18 +307,27 @@ ln -s $@ $(SHAREDLIBM) -@rmdir objs @@ -113,7 +113,7 @@ example64$(EXE): example64.o $(STATICLIB) $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) -@@ -374,8 +397,8 @@ zconf: $(SRCDIR)zconf.h.in +@@ -374,8 +397,8 @@ mostlyclean: clean clean: rm -f *.o *.lo *~ \ @@ -124,7 +124,7 @@ infcover \ libz.* foo.gz so_locations \ _match.s maketree contrib/infback9/*.o -@@ -399,7 +422,7 @@ tags: +@@ -399,7 +422,7 @@ adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h gzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h @@ -133,7 +133,7 @@ crc32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h deflate.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h infback.o inflate.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h -@@ -409,7 +432,7 @@ trees.o: $(SRCDIR)deflate.h $(SRCDIR)zut +@@ -409,7 +432,7 @@ adler32.lo zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h gzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h @@ -144,7 +144,7 @@ infback.lo inflate.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h --- a/configure +++ b/configure -@@ -839,6 +839,87 @@ else +@@ -846,6 +846,87 @@ echo "Checking for sys/sdt.h ... No." | tee -a configure.log fi @@ -2206,7 +2206,7 @@ +} --- a/crc32.c +++ b/crc32.c -@@ -199,13 +199,78 @@ const z_crc_t FAR * ZEXPORT get_crc_tabl +@@ -199,13 +199,78 @@ #define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 /* ========================================================================= */ @@ -2286,7 +2286,7 @@ #ifdef DYNAMIC_CRC_TABLE if (crc_table_empty) make_crc_table(); -@@ -217,22 +282,31 @@ unsigned long ZEXPORT crc32_z(crc, buf, +@@ -217,22 +282,31 @@ endian = 1; if (*((unsigned char *)(&endian))) @@ -2329,7 +2329,7 @@ /* ========================================================================= */ unsigned long ZEXPORT crc32(crc, buf, len) unsigned long crc; -@@ -271,6 +345,7 @@ local unsigned long crc32_little(crc, bu +@@ -271,6 +345,7 @@ register z_crc_t c; register const z_crc_t FAR *buf4; @@ -2337,7 +2337,7 @@ c = (z_crc_t)crc; c = ~c; while (len && ((ptrdiff_t)buf & 3)) { -@@ -311,6 +386,7 @@ local unsigned long crc32_big(crc, buf, +@@ -311,6 +386,7 @@ register z_crc_t c; register const z_crc_t FAR *buf4; diff -Nru zlib-1.2.11.dfsg/debian/patches/410-lp1899621.patch zlib-1.2.11.dfsg/debian/patches/410-lp1899621.patch --- zlib-1.2.11.dfsg/debian/patches/410-lp1899621.patch 2021-08-11 01:14:42.000000000 +0200 +++ zlib-1.2.11.dfsg/debian/patches/410-lp1899621.patch 2022-03-09 08:17:19.000000000 +0100 @@ -1,8 +1,6 @@ -diff --git a/contrib/s390/dfltcc.h b/contrib/s390/dfltcc.h -index e4447dd..bf41272 100644 --- a/contrib/s390/dfltcc.h +++ b/contrib/s390/dfltcc.h -@@ -51,5 +51,9 @@ int ZLIB_INTERNAL dfltcc_inflate_disable OF((z_streamp strm)); +@@ -51,5 +51,9 @@ do { \ if (dfltcc_was_inflate_used((strm))) return -(1L << 16); \ } while (0) @@ -12,8 +10,6 @@ + } while (0) #endif -diff --git a/inflate.c b/inflate.c -index 2b7d564..c9d6ae2 100644 --- a/inflate.c +++ b/inflate.c @@ -100,6 +100,7 @@ @@ -24,7 +20,7 @@ #endif #ifdef MAKEFIXED -@@ -1491,6 +1492,7 @@ z_streamp strm; +@@ -1483,6 +1484,7 @@ struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; diff -Nru zlib-1.2.11.dfsg/debian/patches/410-lp1961427.patch zlib-1.2.11.dfsg/debian/patches/410-lp1961427.patch --- zlib-1.2.11.dfsg/debian/patches/410-lp1961427.patch 1970-01-01 01:00:00.000000000 +0100 +++ zlib-1.2.11.dfsg/debian/patches/410-lp1961427.patch 2022-03-09 08:18:01.000000000 +0100 @@ -0,0 +1,86 @@ +--- a/compress.c ++++ b/compress.c +@@ -5,9 +5,15 @@ + + /* @(#) $Id$ */ + +-#define ZLIB_INTERNAL ++#include "zutil.h" + #include "zlib.h" + ++#ifdef DFLTCC ++# include "contrib/s390/dfltcc.h" ++#else ++#define DEFLATE_BOUND_COMPLEN(source_len) 0 ++#endif ++ + /* =========================================================================== + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte +@@ -81,6 +87,12 @@ + uLong ZEXPORT compressBound (sourceLen) + uLong sourceLen; + { ++ uLong complen = DEFLATE_BOUND_COMPLEN(sourceLen); ++ ++ if (complen > 0) ++ /* Architecture-specific code provided an upper bound. */ ++ return complen + ZLIB_WRAPLEN; ++ + return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + + (sourceLen >> 25) + 13; + } +--- a/contrib/s390/dfltcc.h ++++ b/contrib/s390/dfltcc.h +@@ -12,6 +12,28 @@ + voidpf ZLIB_INTERNAL dfltcc_alloc_window OF((z_streamp strm, uInt items, + uInt size)); + void ZLIB_INTERNAL dfltcc_free_window OF((z_streamp strm, voidpf w)); ++#define DFLTCC_BLOCK_HEADER_BITS 3 ++#define DFLTCC_HLITS_COUNT_BITS 5 ++#define DFLTCC_HDISTS_COUNT_BITS 5 ++#define DFLTCC_HCLENS_COUNT_BITS 4 ++#define DFLTCC_MAX_HCLENS 19 ++#define DFLTCC_HCLEN_BITS 3 ++#define DFLTCC_MAX_HLITS 286 ++#define DFLTCC_MAX_HDISTS 30 ++#define DFLTCC_MAX_HLIT_HDIST_BITS 7 ++#define DFLTCC_MAX_SYMBOL_BITS 16 ++#define DFLTCC_MAX_EOBS_BITS 15 ++#define DFLTCC_MAX_PADDING_BITS 7 ++#define DEFLATE_BOUND_COMPLEN(source_len) \ ++ ((DFLTCC_BLOCK_HEADER_BITS + \ ++ DFLTCC_HLITS_COUNT_BITS + \ ++ DFLTCC_HDISTS_COUNT_BITS + \ ++ DFLTCC_HCLENS_COUNT_BITS + \ ++ DFLTCC_MAX_HCLENS * DFLTCC_HCLEN_BITS + \ ++ (DFLTCC_MAX_HLITS + DFLTCC_MAX_HDISTS) * DFLTCC_MAX_HLIT_HDIST_BITS + \ ++ (source_len) * DFLTCC_MAX_SYMBOL_BITS + \ ++ DFLTCC_MAX_EOBS_BITS + \ ++ DFLTCC_MAX_PADDING_BITS) >> 3) + int ZLIB_INTERNAL dfltcc_can_inflate OF((z_streamp strm)); + typedef enum { + DFLTCC_INFLATE_CONTINUE, +--- a/contrib/s390/dfltcc_deflate.h ++++ b/contrib/s390/dfltcc_deflate.h +@@ -46,8 +46,7 @@ + #define DEFLATE_BOUND_ADJUST_COMPLEN(strm, complen, source_len) \ + do { \ + if (dfltcc_can_deflate((strm))) \ +- (complen) = (3 + 5 + 5 + 4 + 19 * 3 + (286 + 30) * 7 + \ +- (source_len) * 16 + 15 + 7) >> 3; \ ++ (complen) = DEFLATE_BOUND_COMPLEN(source_len); \ + } while (0) + #define DEFLATE_NEED_CONSERVATIVE_BOUND(strm) (dfltcc_can_deflate((strm))) + #define DEFLATE_HOOK dfltcc_deflate +--- a/zutil.h ++++ b/zutil.h +@@ -80,6 +80,8 @@ + + #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + ++#define ZLIB_WRAPLEN 6 /* zlib format overhead */ ++ + /* target dependencies */ + + #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) diff -Nru zlib-1.2.11.dfsg/debian/patches/series zlib-1.2.11.dfsg/debian/patches/series --- zlib-1.2.11.dfsg/debian/patches/series 2021-08-12 05:28:03.000000000 +0200 +++ zlib-1.2.11.dfsg/debian/patches/series 2022-03-09 08:04:55.000000000 +0100 @@ -5,3 +5,4 @@ 410-lp1899621.patch 335.diff lp1932010-ibm-z-add-vectorized-crc32-implementation.patch +410-lp1961427.patch