Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package zlib-ng for openSUSE:Factory checked in at 2024-10-23 21:08:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/zlib-ng (Old) and /work/SRC/openSUSE:Factory/.zlib-ng.new.26871 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "zlib-ng" Wed Oct 23 21:08:00 2024 rev:20 rq:1217258 version:2.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/zlib-ng/zlib-ng.changes 2024-09-04 13:23:42.723476884 +0200 +++ /work/SRC/openSUSE:Factory/.zlib-ng.new.26871/zlib-ng.changes 2024-10-23 21:08:04.705211177 +0200 @@ -1,0 +2,13 @@ +Wed Oct 23 08:51:08 UTC 2024 - Guillaume GARDET <guillaume.gar...@opensuse.org> + +- Update to 2.2.2: + * Changelog at https://github.com/zlib-ng/zlib-ng/releases/tag/2.2.2 + +------------------------------------------------------------------- +Wed Oct 23 07:49:03 UTC 2024 - Dominique Leuenberger <dims...@opensuse.org> + +- Install the ld.so configuration file also with the -32bit + package, as otherwise biarch installs won't find that library + (boo#1232065). + +------------------------------------------------------------------- Old: ---- zlib-ng-2.2.1.tar.gz New: ---- zlib-ng-2.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zlib-ng.spec ++++++ --- /var/tmp/diff_new_pack.yBYgle/_old 2024-10-23 21:08:05.317236586 +0200 +++ /var/tmp/diff_new_pack.yBYgle/_new 2024-10-23 21:08:05.321236752 +0200 @@ -30,7 +30,7 @@ %define soversion 2 %endif Name: zlib-ng%{?compat_suffix} -Version: 2.2.1 +Version: 2.2.2 Release: 0 Summary: Zlib replacement with SIMD optimizations License: Zlib @@ -96,7 +96,7 @@ %if %{with zlib_compat} mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d mkdir -p %{buildroot}%{_libdir}/zlib-ng-compat -(cat > %{buildroot}%{_sysconfdir}/ld.so.conf.d/zlib-ng-compat.conf) <<-EOF +(cat > %{buildroot}%{_sysconfdir}/ld.so.conf.d/zlib-ng-compat-%{_arch}.conf) <<-EOF %{_libdir}/zlib-ng-compat EOF pushd %{buildroot}%{_libdir}/ @@ -142,7 +142,7 @@ %files -n libz-ng%{?compat_suffix}%{soversion} %if %{with zlib_compat} -%config %{_sysconfdir}/ld.so.conf.d/zlib-ng-compat.conf +%config %{_sysconfdir}/ld.so.conf.d/zlib-ng-compat-%{_arch}.conf %dir %{_libdir}/zlib-ng-compat/ %{_libdir}/zlib-ng-compat/libz.so.%{soversion}* %else ++++++ baselibs.conf ++++++ --- /var/tmp/diff_new_pack.yBYgle/_old 2024-10-23 21:08:05.357238246 +0200 +++ /var/tmp/diff_new_pack.yBYgle/_new 2024-10-23 21:08:05.361238413 +0200 @@ -1,3 +1,4 @@ libz-ng2 libz-ng-compat1 + +/etc/ld.so.conf.d/zlib-ng-compat-.*.conf ++++++ zlib-ng-2.2.1.tar.gz -> zlib-ng-2.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/CMakeLists.txt new/zlib-ng-2.2.2/CMakeLists.txt --- old/zlib-ng-2.2.1/CMakeLists.txt 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/CMakeLists.txt 2024-09-17 14:12:24.000000000 +0200 @@ -191,9 +191,9 @@ # (who'd use cmake from an IDE...) but checking for ICC before checking for MSVC should # avoid mistakes. # /Oi ? - set(WARNFLAGS /W3) + set(WARNFLAGS /W3 /w34242 /WX) set(WARNFLAGS_MAINTAINER /W4) - set(WARNFLAGS_DISABLE) + set(WARNFLAGS_DISABLE /wd4206 /wd4054) if(BASEARCH_ARM_FOUND) add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE) if(NOT "${ARCH}" MATCHES "aarch64") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/Makefile.in new/zlib-ng-2.2.2/Makefile.in --- old/zlib-ng-2.2.1/Makefile.in 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/Makefile.in 2024-09-17 14:12:24.000000000 +0200 @@ -30,7 +30,7 @@ LDSHAREDFLAGS=-shared LDVERSIONSCRIPT= -VER=2.2.1 +VER=2.2.2 VER1=2 STATICLIB=$(LIBNAME1).a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/arm/chunkset_neon.c new/zlib-ng-2.2.2/arch/arm/chunkset_neon.c --- old/zlib-ng-2.2.1/arch/arm/chunkset_neon.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/arm/chunkset_neon.c 2024-09-17 14:12:24.000000000 +0200 @@ -84,7 +84,9 @@ a = vld1_u8(buf); b = vld1_u8(buf + 8); ret0 = vtbl1_u8(a, perm_vec0); - uint8x8x2_t ab = {{a, b}}; + uint8x8x2_t ab; + ab.val[0] = a; + ab.val[1] = b; ret1 = vtbl2_u8(ab, perm_vec1); return vcombine_u8(ret0, ret1); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/arm/neon_intrins.h new/zlib-ng-2.2.2/arch/arm/neon_intrins.h --- old/zlib-ng-2.2.1/arch/arm/neon_intrins.h 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/arm/neon_intrins.h 2024-09-17 14:12:24.000000000 +0200 @@ -36,20 +36,20 @@ # ifndef ARM_NEON_HASLD4 static inline uint16x8x4_t vld1q_u16_x4(uint16_t const *a) { - uint16x8x4_t ret = (uint16x8x4_t) {{ - vld1q_u16(a), - vld1q_u16(a+8), - vld1q_u16(a+16), - vld1q_u16(a+24)}}; + uint16x8x4_t ret; + ret.val[0] = vld1q_u16(a); + ret.val[1] = vld1q_u16(a+8); + ret.val[2] = vld1q_u16(a+16); + ret.val[3] = vld1q_u16(a+24); return ret; } static inline uint8x16x4_t vld1q_u8_x4(uint8_t const *a) { - uint8x16x4_t ret = (uint8x16x4_t) {{ - vld1q_u8(a), - vld1q_u8(a+16), - vld1q_u8(a+32), - vld1q_u8(a+48)}}; + uint8x16x4_t ret; + ret.val[0] = vld1q_u8(a); + ret.val[1] = vld1q_u8(a+16); + ret.val[2] = vld1q_u8(a+32); + ret.val[3] = vld1q_u8(a+48); return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/arm/slide_hash_armv6.c new/zlib-ng-2.2.2/arch/arm/slide_hash_armv6.c --- old/zlib-ng-2.2.1/arch/arm/slide_hash_armv6.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/arm/slide_hash_armv6.c 2024-09-17 14:12:24.000000000 +0200 @@ -39,7 +39,8 @@ } Z_INTERNAL void slide_hash_armv6(deflate_state *s) { - unsigned int wsize = s->w_size; + Assert(s->w_size <= UINT16_MAX, "w_size should fit in uint16_t"); + uint16_t wsize = (uint16_t)s->w_size; slide_hash_chain(s->head, HASH_SIZE, wsize); slide_hash_chain(s->prev, wsize, wsize); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/arm/slide_hash_neon.c new/zlib-ng-2.2.2/arch/arm/slide_hash_neon.c --- old/zlib-ng-2.2.1/arch/arm/slide_hash_neon.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/arm/slide_hash_neon.c 2024-09-17 14:12:24.000000000 +0200 @@ -38,7 +38,8 @@ } Z_INTERNAL void slide_hash_neon(deflate_state *s) { - unsigned int wsize = s->w_size; + Assert(s->w_size <= UINT16_MAX, "w_size should fit in uint16_t"); + uint16_t wsize = (uint16_t)s->w_size; slide_hash_chain(s->head, HASH_SIZE, wsize); slide_hash_chain(s->prev, wsize, wsize); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/generic/crc32_braid_c.c new/zlib-ng-2.2.2/arch/generic/crc32_braid_c.c --- old/zlib-ng-2.2.1/arch/generic/crc32_braid_c.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/generic/crc32_braid_c.c 2024-09-17 14:12:24.000000000 +0200 @@ -192,7 +192,8 @@ #endif #endif words += N; - c = ZSWAPWORD(comb); + Assert(comb <= UINT32_MAX, "comb should fit in uint32_t"); + c = (uint32_t)ZSWAPWORD(comb); /* Update the pointer to the remaining bytes to process. */ buf = (const unsigned char *)words; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/power/slide_ppc_tpl.h new/zlib-ng-2.2.2/arch/power/slide_ppc_tpl.h --- old/zlib-ng-2.2.1/arch/power/slide_ppc_tpl.h 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/power/slide_ppc_tpl.h 2024-09-17 14:12:24.000000000 +0200 @@ -24,7 +24,8 @@ } void Z_INTERNAL SLIDE_PPC(deflate_state *s) { - uint16_t wsize = s->w_size; + Assert(s->w_size <= UINT16_MAX, "w_size should fit in uint16_t"); + uint16_t wsize = (uint16_t)s->w_size; slide_hash_chain(s->head, HASH_SIZE, wsize); slide_hash_chain(s->prev, wsize, wsize); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/riscv/riscv_features.c new/zlib-ng-2.2.2/arch/riscv/riscv_features.c --- old/zlib-ng-2.2.1/arch/riscv/riscv_features.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/riscv/riscv_features.c 2024-09-17 14:12:24.000000000 +0200 @@ -14,7 +14,10 @@ int Z_INTERNAL is_kernel_version_greater_or_equal_to_6_5() { struct utsname buffer; - uname(&buffer); + if (uname(&buffer) == -1) { + // uname failed + return 0; + } int major, minor; if (sscanf(buffer.release, "%d.%d", &major, &minor) != 2) { @@ -49,4 +52,20 @@ riscv_check_features_runtime(features); else riscv_check_features_compile_time(features); + if (features->has_rvv) { + size_t e8m1_vec_len; + intptr_t vtype_reg_val; + // Check that a vuint8m1_t vector is at least 16 bytes and that tail + // agnostic and mask agnostic mode are supported + // + __asm__ volatile( + "vsetvli %0, zero, e8, m1, ta, ma\n\t" + "csrr %1, vtype" + : "=r"(e8m1_vec_len), "=r"(vtype_reg_val)); + + // The RVV target is supported if the VILL bit of VTYPE (the MSB bit of + // VTYPE) is not set and the length of a vuint8m1_t vector is at least 16 + // bytes + features->has_rvv = (vtype_reg_val >= 0 && e8m1_vec_len >= 16); + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/riscv/slide_hash_rvv.c new/zlib-ng-2.2.2/arch/riscv/slide_hash_rvv.c --- old/zlib-ng-2.2.1/arch/riscv/slide_hash_rvv.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/riscv/slide_hash_rvv.c 2024-09-17 14:12:24.000000000 +0200 @@ -23,6 +23,7 @@ } Z_INTERNAL void slide_hash_rvv(deflate_state *s) { + Assert(s->w_size <= UINT16_MAX, "w_size should fit in uint16_t"); uint16_t wsize = (uint16_t)s->w_size; slide_hash_chain(s->head, HASH_SIZE, wsize); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/s390/s390_features.c new/zlib-ng-2.2.2/arch/s390/s390_features.c --- old/zlib-ng-2.2.1/arch/s390/s390_features.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/s390/s390_features.c 2024-09-17 14:12:24.000000000 +0200 @@ -6,7 +6,7 @@ #endif #ifndef HWCAP_S390_VXRS -#define HWCAP_S390_VXRS HWCAP_S390_VX +#define HWCAP_S390_VXRS (1 << 11) #endif void Z_INTERNAL s390_check_features(struct s390_cpu_features *features) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/x86/adler32_avx512_p.h new/zlib-ng-2.2.2/arch/x86/adler32_avx512_p.h --- old/zlib-ng-2.2.1/arch/x86/adler32_avx512_p.h 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/x86/adler32_avx512_p.h 2024-09-17 14:12:24.000000000 +0200 @@ -3,6 +3,17 @@ #include <immintrin.h> #include <stdint.h> + +/* Written because Visual C++ toolchains before v142 have constant overflow in AVX512 intrinsic macros */ +#if defined(_MSC_VER) && !defined(_MM_K0_REG8) +# undef _mm512_extracti64x4_epi64 +# define _mm512_extracti64x4_epi64(v1, e1) _mm512_maskz_extracti64x4_epi64(UINT8_MAX, v1, e1) +# undef _mm512_set1_epi16 +# define _mm512_set1_epi16(e1) _mm512_maskz_set1_epi16(UINT32_MAX, e1) +# undef _mm512_maddubs_epi16 +# define _mm512_maddubs_epi16(v1, v2) _mm512_maskz_maddubs_epi16(UINT32_MAX, v1, v2) +#endif + /* Written because *_add_epi32(a) sets off ubsan */ static inline uint32_t _mm512_reduce_add_epu32(__m512i x) { __m256i a = _mm512_extracti64x4_epi64(x, 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/x86/slide_hash_avx2.c new/zlib-ng-2.2.2/arch/x86/slide_hash_avx2.c --- old/zlib-ng-2.2.1/arch/x86/slide_hash_avx2.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/x86/slide_hash_avx2.c 2024-09-17 14:12:24.000000000 +0200 @@ -31,6 +31,7 @@ } Z_INTERNAL void slide_hash_avx2(deflate_state *s) { + Assert(s->w_size <= UINT16_MAX, "w_size should fit in uint16_t"); uint16_t wsize = (uint16_t)s->w_size; const __m256i ymm_wsize = _mm256_set1_epi16((short)wsize); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/x86/slide_hash_sse2.c new/zlib-ng-2.2.2/arch/x86/slide_hash_sse2.c --- old/zlib-ng-2.2.1/arch/x86/slide_hash_sse2.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/x86/slide_hash_sse2.c 2024-09-17 14:12:24.000000000 +0200 @@ -52,6 +52,7 @@ } Z_INTERNAL void slide_hash_sse2(deflate_state *s) { + Assert(s->w_size <= UINT16_MAX, "w_size should fit in uint16_t"); uint16_t wsize = (uint16_t)s->w_size; const __m128i xmm_wsize = _mm_set1_epi16((short)wsize); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/arch/x86/x86_intrins.h new/zlib-ng-2.2.2/arch/x86/x86_intrins.h --- old/zlib-ng-2.2.1/arch/x86/x86_intrins.h 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/arch/x86/x86_intrins.h 2024-09-17 14:12:24.000000000 +0200 @@ -84,4 +84,9 @@ #endif // __AVX512F__ #endif // defined(_MSC_VER) && _MSC_VER < 1914 +/* Visual C++ toolchains before v142 have constant overflow in AVX512 intrinsics */ +#if defined(_MSC_VER) && defined(__AVX512F__) && !defined(_MM_K0_REG8) +# undef _mm512_extracti32x4_epi32 +# define _mm512_extracti32x4_epi32(v1, e1) _mm512_maskz_extracti32x4_epi32(UINT8_MAX, v1, e1) +#endif #endif // include guard X86_INTRINS_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/cmake/detect-intrinsics.cmake new/zlib-ng-2.2.2/cmake/detect-intrinsics.cmake --- old/zlib-ng-2.2.1/cmake/detect-intrinsics.cmake 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/cmake/detect-intrinsics.cmake 2024-09-17 14:12:24.000000000 +0200 @@ -66,7 +66,7 @@ return __uqsub16(a, b); #endif } - int main(void) { return 0; }" + int main(void) { return f(1,2); }" HAVE_ARMV6_INTRIN ) set(CMAKE_REQUIRED_FLAGS) @@ -433,7 +433,7 @@ check_c_source_compiles( "#include <sys/auxv.h> #ifndef HWCAP_S390_VXRS - #define HWCAP_S390_VXRS HWCAP_S390_VX + #define HWCAP_S390_VXRS (1 << 11) #endif int main() { return (getauxval(AT_HWCAP) & HWCAP_S390_VXRS); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/configure new/zlib-ng-2.2.2/configure --- old/zlib-ng-2.2.1/configure 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/configure 2024-09-17 14:12:24.000000000 +0200 @@ -1243,7 +1243,7 @@ unsigned int f(unsigned int a, unsigned int b) { return __uqsub16(a, b); } -int main(void) { return 0; } +int main(void) { return f(1, 2); } EOF if try ${CC} ${CFLAGS} ${armv6flag} $test.c; then echo "Checking for ARMv6 intrinsics ... Yes." | tee -a configure.log diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/deflate.c new/zlib-ng-2.2.2/deflate.c --- old/zlib-ng-2.2.1/deflate.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/deflate.c 2024-09-17 14:12:24.000000000 +0200 @@ -204,7 +204,7 @@ /* Define sizes */ int window_size = DEFLATE_ADJUST_WINDOW_SIZE((1 << windowBits) * 2); - int prev_size = (1 << windowBits) * sizeof(Pos); + int prev_size = (1 << windowBits) * (int)sizeof(Pos); int head_size = HASH_SIZE * sizeof(Pos); int pending_size = lit_bufsize * LIT_BUFS; int state_size = sizeof(deflate_state); @@ -239,7 +239,7 @@ int total_size = PAD_64(curr_size + (WINDOW_PAD_SIZE - 1)); /* Allocate buffer, align to 64-byte cacheline, and zerofill the resulting buffer */ - char *original_buf = strm->zalloc(strm->opaque, 1, total_size); + char *original_buf = (char *)strm->zalloc(strm->opaque, 1, total_size); if (original_buf == NULL) return NULL; @@ -248,7 +248,7 @@ /* Initialize alloc_bufs */ deflate_allocs *alloc_bufs = (struct deflate_allocs_s *)(buff + alloc_pos); - alloc_bufs->buf_start = (char *)original_buf; + alloc_bufs->buf_start = original_buf; alloc_bufs->zfree = strm->zfree; /* Assign buffers */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/deflate.h new/zlib-ng-2.2.2/deflate.h --- old/zlib-ng-2.2.1/deflate.h 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/deflate.h 2024-09-17 14:12:24.000000000 +0200 @@ -243,6 +243,10 @@ int nice_match; /* Stop searching when current match exceeds this */ +#if defined(_M_IX86) || defined(_M_ARM) + int padding[2]; +#endif + struct crc32_fold_s ALIGNED_(16) crc_fold; /* used by trees.c: */ @@ -323,7 +327,10 @@ /* Number of valid bits in bi_buf. All bits above the last valid bit are always zero. */ /* Reserved for future use and alignment purposes */ - int32_t reserved[11]; + int32_t reserved[19]; +#if defined(_M_IX86) || defined(_M_ARM) + int32_t padding2[4]; +#endif }; typedef enum { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/deflate_fast.c new/zlib-ng-2.2.2/deflate_fast.c --- old/zlib-ng-2.2.1/deflate_fast.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/deflate_fast.c 2024-09-17 14:12:24.000000000 +0200 @@ -58,7 +58,9 @@ } if (match_len >= WANT_MIN_MATCH) { - check_match(s, s->strstart, s->match_start, match_len); + Assert(s->strstart <= UINT16_MAX, "strstart should fit in uint16_t"); + Assert(s->match_start <= UINT16_MAX, "match_start should fit in uint16_t"); + check_match(s, (Pos)s->strstart, (Pos)s->match_start, match_len); bflush = zng_tr_tally_dist(s, s->strstart - s->match_start, match_len - STD_MIN_MATCH); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/deflate_p.h new/zlib-ng-2.2.2/deflate_p.h --- old/zlib-ng-2.2.1/deflate_p.h 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/deflate_p.h 2024-09-17 14:12:24.000000000 +0200 @@ -78,8 +78,10 @@ /* dist: distance of matched string */ /* len: match length-STD_MIN_MATCH */ #ifdef LIT_MEM - s->d_buf[s->sym_next] = dist; - s->l_buf[s->sym_next++] = len; + Assert(dist <= UINT16_MAX, "dist should fit in uint16_t"); + Assert(len <= UINT8_MAX, "len should fit in uint8_t"); + s->d_buf[s->sym_next] = (uint16_t)dist; + s->l_buf[s->sym_next++] = (uint8_t)len; #else s->sym_buf[s->sym_next++] = (uint8_t)(dist); s->sym_buf[s->sym_next++] = (uint8_t)(dist >> 8); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/deflate_quick.c new/zlib-ng-2.2.2/deflate_quick.c --- old/zlib-ng-2.2.1/deflate_quick.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/deflate_quick.c 2024-09-17 14:12:24.000000000 +0200 @@ -102,7 +102,8 @@ if (UNLIKELY(match_len > STD_MAX_MATCH)) match_len = STD_MAX_MATCH; - check_match(s, s->strstart, hash_head, match_len); + Assert(s->strstart <= UINT16_MAX, "strstart should fit in uint16_t"); + check_match(s, (Pos)s->strstart, hash_head, match_len); zng_tr_emit_dist(s, static_ltree, static_dtree, match_len - STD_MIN_MATCH, (uint32_t)dist); s->lookahead -= match_len; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/deflate_rle.c new/zlib-ng-2.2.2/deflate_rle.c --- old/zlib-ng-2.2.1/deflate_rle.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/deflate_rle.c 2024-09-17 14:12:24.000000000 +0200 @@ -58,7 +58,8 @@ /* Emit match if have run of STD_MIN_MATCH or longer, else emit literal */ if (match_len >= STD_MIN_MATCH) { - check_match(s, s->strstart, s->strstart - 1, match_len); + Assert(s->strstart <= UINT16_MAX, "strstart should fit in uint16_t"); + check_match(s, (Pos)s->strstart, (Pos)(s->strstart - 1), match_len); bflush = zng_tr_tally_dist(s, 1, match_len - STD_MIN_MATCH); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/deflate_slow.c new/zlib-ng-2.2.2/deflate_slow.c --- old/zlib-ng-2.2.1/deflate_slow.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/deflate_slow.c 2024-09-17 14:12:24.000000000 +0200 @@ -78,7 +78,8 @@ unsigned int max_insert = s->strstart + s->lookahead - STD_MIN_MATCH; /* Do not insert strings in hash table beyond this. */ - check_match(s, s->strstart-1, s->prev_match, s->prev_length); + Assert((s->strstart-1) <= UINT16_MAX, "strstart-1 should fit in uint16_t"); + check_match(s, (Pos)(s->strstart - 1), s->prev_match, s->prev_length); bflush = zng_tr_tally_dist(s, s->strstart -1 - s->prev_match, s->prev_length - STD_MIN_MATCH); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/functable.c new/zlib-ng-2.2.2/functable.c --- old/zlib-ng-2.2.1/functable.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/functable.c 2024-09-17 14:12:24.000000000 +0200 @@ -5,14 +5,15 @@ #ifndef DISABLE_RUNTIME_CPU_DETECTION #include "zbuild.h" -#include "functable.h" -#include "cpu_features.h" -#include "arch_functions.h" #if defined(_MSC_VER) # include <intrin.h> #endif +#include "functable.h" +#include "cpu_features.h" +#include "arch_functions.h" + /* Platform has pointer size atomic store */ #if defined(__GNUC__) || defined(__clang__) # define FUNCTABLE_ASSIGN(VAR, FUNC_NAME) \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/inffast_tpl.h new/zlib-ng-2.2.2/inffast_tpl.h --- old/zlib-ng-2.2.1/inffast_tpl.h 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/inffast_tpl.h 2024-09-17 14:12:24.000000000 +0200 @@ -249,7 +249,8 @@ if (op < len) { /* still need some from output */ len -= op; out = chunkcopy_safe(out, from, op, safe); - out = CHUNKUNROLL(out, &dist, &len); + if (!extra_safe) + out = CHUNKUNROLL(out, &dist, &len); out = chunkcopy_safe(out, out - dist, len, safe); } else { out = chunkcopy_safe(out, from, len, safe); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/inflate.c new/zlib-ng-2.2.2/inflate.c --- old/zlib-ng-2.2.1/inflate.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/inflate.c 2024-09-17 14:12:24.000000000 +0200 @@ -170,7 +170,7 @@ int total_size = PAD_64(curr_size + (WINDOW_PAD_SIZE - 1)); /* Allocate buffer, align to 64-byte cacheline, and zerofill the resulting buffer */ - char *original_buf = strm->zalloc(strm->opaque, 1, total_size); + char *original_buf = (char *)strm->zalloc(strm->opaque, 1, total_size); if (original_buf == NULL) return NULL; @@ -179,7 +179,7 @@ /* Initialize alloc_bufs */ inflate_allocs *alloc_bufs = (struct inflate_allocs_s *)(buff + alloc_pos); - alloc_bufs->buf_start = (char *)original_buf; + alloc_bufs->buf_start = original_buf; alloc_bufs->zfree = strm->zfree; alloc_bufs->window = (unsigned char *)HINT_ALIGNED_WINDOW((buff + window_pos)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/inflate.h new/zlib-ng-2.2.2/inflate.h --- old/zlib-ng-2.2.1/inflate.h 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/inflate.h 2024-09-17 14:12:24.000000000 +0200 @@ -115,6 +115,11 @@ uint32_t whave; /* valid bytes in the window */ uint32_t wnext; /* window write index */ unsigned char *window; /* allocated sliding window, if needed */ +#if defined(_M_IX86) || defined(_M_ARM) + uint32_t padding; +#else + uint32_t padding[2]; +#endif struct crc32_fold_s ALIGNED_(16) crc_fold; @@ -148,6 +153,9 @@ #ifdef HAVE_ARCH_INFLATE_STATE arch_inflate_state arch; /* architecture-specific extensions */ #endif +#if defined(_M_IX86) || defined(_M_ARM) + int padding2[8]; +#endif }; void Z_INTERNAL PREFIX(fixedtables)(struct inflate_state *state); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/insert_string_tpl.h new/zlib-ng-2.2.2/insert_string_tpl.h --- old/zlib-ng-2.2.1/insert_string_tpl.h 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/insert_string_tpl.h 2024-09-17 14:12:24.000000000 +0200 @@ -29,9 +29,15 @@ # define HASH_CALC_MASK HASH_MASK #endif #ifndef HASH_CALC_READ -# if BYTE_ORDER == LITTLE_ENDIAN -# define HASH_CALC_READ \ - memcpy(&val, strstart, sizeof(val)); +# ifdef UNALIGNED_OK +# if BYTE_ORDER == LITTLE_ENDIAN +# define HASH_CALC_READ \ + memcpy(&val, strstart, sizeof(val)); +# else +# define HASH_CALC_READ \ + memcpy(&val, strstart, sizeof(val)); \ + val = ZSWAP32(val); +# endif # else # define HASH_CALC_READ \ val = ((uint32_t)(strstart[0])); \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/test/CMakeLists.txt new/zlib-ng-2.2.2/test/CMakeLists.txt --- old/zlib-ng-2.2.1/test/CMakeLists.txt 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/test/CMakeLists.txt 2024-09-17 14:12:24.000000000 +0200 @@ -201,6 +201,13 @@ add_executable(gtest_zlib ${TEST_SRCS}) configure_test_executable(gtest_zlib) + if(MSVC) + target_compile_options(gtest_zlib PRIVATE /wd4389) + if(BASEARCH_ARM_FOUND) + target_compile_options(gtest_zlib PRIVATE /EHsc) + endif() + endif() + if(WITH_SANITIZER STREQUAL "Memory") target_link_directories(gtest_zlib PRIVATE $ENV{LLVM_BUILD_DIR}/lib) target_link_options(gtest_zlib PRIVATE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/test/fuzz/fuzzer_minigzip.c new/zlib-ng-2.2.2/test/fuzz/fuzzer_minigzip.c --- old/zlib-ng-2.2.1/test/fuzz/fuzzer_minigzip.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/test/fuzz/fuzzer_minigzip.c 2024-09-17 14:12:24.000000000 +0200 @@ -302,7 +302,9 @@ } if (len == 0) break; - assert(0 == memcmp(data + offset, buf, len)); + int c = memcmp(data + offset, buf, len); + assert(0 == c); + Z_UNUSED(c); // in Release build, assert() is a no-op. offset += len; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/test/test_gzio.cc new/zlib-ng-2.2.2/test/test_gzio.cc --- old/zlib-ng-2.2.1/test/test_gzio.cc 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/test/test_gzio.cc 2024-09-17 14:12:24.000000000 +0200 @@ -30,6 +30,7 @@ gzFile file; int err; + Z_UNUSED(compr); /* Write gz file with test data */ file = PREFIX(gzopen)(TESTFILE, "wb"); ASSERT_TRUE(file != NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/zbuild.h new/zlib-ng-2.2.2/zbuild.h --- old/zlib-ng-2.2.1/zbuild.h 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/zbuild.h 2024-09-17 14:12:24.000000000 +0200 @@ -225,7 +225,7 @@ # include <stdio.h> extern int Z_INTERNAL z_verbose; extern void Z_INTERNAL z_error(const char *m); -# define Assert(cond, msg) {if (!(cond)) z_error(msg);} +# define Assert(cond, msg) {int _cond = (cond); if (!_cond) z_error(msg);} # define Trace(x) {if (z_verbose >= 0) fprintf x;} # define Tracev(x) {if (z_verbose > 0) fprintf x;} # define Tracevv(x) {if (z_verbose > 1) fprintf x;} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/zlib-ng.h.in new/zlib-ng-2.2.2/zlib-ng.h.in --- old/zlib-ng-2.2.1/zlib-ng.h.in 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/zlib-ng.h.in 2024-09-17 14:12:24.000000000 +0200 @@ -48,11 +48,11 @@ extern "C" { #endif -#define ZLIBNG_VERSION "2.2.1" -#define ZLIBNG_VERNUM 0x020201F0L /* MMNNRRSM: major minor revision status modified */ +#define ZLIBNG_VERSION "2.2.2" +#define ZLIBNG_VERNUM 0x020202F0L /* MMNNRRSM: major minor revision status modified */ #define ZLIBNG_VER_MAJOR 2 #define ZLIBNG_VER_MINOR 2 -#define ZLIBNG_VER_REVISION 1 +#define ZLIBNG_VER_REVISION 2 #define ZLIBNG_VER_STATUS F /* 0=devel, 1-E=beta, F=Release (DEPRECATED) */ #define ZLIBNG_VER_STATUSH 0xF /* Hex values: 0=devel, 1-E=beta, F=Release */ #define ZLIBNG_VER_MODIFIED 0 /* non-zero if modified externally from zlib-ng */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/zlib.h.in new/zlib-ng-2.2.2/zlib.h.in --- old/zlib-ng-2.2.1/zlib.h.in 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/zlib.h.in 2024-09-17 14:12:24.000000000 +0200 @@ -49,11 +49,11 @@ extern "C" { #endif -#define ZLIBNG_VERSION "2.2.1" -#define ZLIBNG_VERNUM 0x020201F0L /* MMNNRRSM: major minor revision status modified */ +#define ZLIBNG_VERSION "2.2.2" +#define ZLIBNG_VERNUM 0x020202F0L /* MMNNRRSM: major minor revision status modified */ #define ZLIBNG_VER_MAJOR 2 #define ZLIBNG_VER_MINOR 2 -#define ZLIBNG_VER_REVISION 1 +#define ZLIBNG_VER_REVISION 2 #define ZLIBNG_VER_STATUS F /* 0=devel, 1-E=beta, F=Release (DEPRECATED) */ #define ZLIBNG_VER_STATUSH 0xF /* Hex values: 0=devel, 1-E=beta, F=Release */ #define ZLIBNG_VER_MODIFIED 0 /* non-zero if modified externally from zlib-ng */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-ng-2.2.1/zutil.c new/zlib-ng-2.2.2/zutil.c --- old/zlib-ng-2.2.1/zutil.c 2024-07-02 15:55:49.000000000 +0200 +++ new/zlib-ng-2.2.2/zutil.c 2024-09-17 14:12:24.000000000 +0200 @@ -21,7 +21,7 @@ }; const char PREFIX3(vstring)[] = - " zlib-ng 2.2.1"; + " zlib-ng 2.2.2"; #ifdef ZLIB_COMPAT const char * Z_EXPORT zlibVersion(void) {