]> git.ipfire.org Git - thirdparty/zlib-ng.git/log
thirdparty/zlib-ng.git
3 years agoAdd assert for tzcnt if building with X86_NOCHECK_TZCNT
Pavel P [Tue, 17 Jan 2023 01:42:24 +0000 (04:42 +0300)] 
Add assert for tzcnt if building with X86_NOCHECK_TZCNT

3 years agoAdd temporary cmake build dirs/files to gitignore
Pavel P [Sun, 22 Jan 2023 21:48:10 +0000 (00:48 +0300)] 
Add temporary cmake build dirs/files to gitignore

3 years agoFix typo found by codespell
Dimitri Papadopoulos [Thu, 2 Feb 2023 15:06:52 +0000 (16:06 +0100)] 
Fix typo found by codespell

3 years agoFix ABI checking...
Mika T. Lindqvist [Tue, 13 Dec 2022 20:06:43 +0000 (22:06 +0200)] 
Fix ABI checking...
* Ubuntu 22.04 use different format for ABI files so old ones need to be removed
* Use more recent zlib-ng commit to avoid issues with internal adler32 and crc32 functions

3 years agoMatch __builtin_ctzl/__builtin_ctzll signatures
Pavel P [Tue, 17 Jan 2023 01:39:37 +0000 (04:39 +0300)] 
Match __builtin_ctzl/__builtin_ctzll signatures

make sure input/output args match original functions from clang/gcc

3 years agoFix MSVC warnings in benchmark code
Cameron Cawley [Fri, 30 Sep 2022 17:59:55 +0000 (18:59 +0100)] 
Fix MSVC warnings in benchmark code

3 years agoUse size_t instead of uint64_t for len in all adler32 functions
Cameron Cawley [Fri, 30 Sep 2022 15:54:16 +0000 (16:54 +0100)] 
Use size_t instead of uint64_t for len in all adler32 functions

3 years agoUse size_t instead of uint64_t for len in all crc32 functions
Cameron Cawley [Fri, 30 Sep 2022 15:06:42 +0000 (16:06 +0100)] 
Use size_t instead of uint64_t for len in all crc32 functions

3 years agoFix compilation error where `crc32_fold` type matches field name in struct functable_s
Pavel P [Fri, 13 Jan 2023 18:31:48 +0000 (21:31 +0300)] 
Fix compilation error where `crc32_fold` type matches field name in struct functable_s

If functable.h is included by a c++ compiler, compiler issues the following error (VS 2022):
```
zlib-ng/functable.h(20,49): error C2327: 'functable_s::crc32_fold': is not a type name, static, or enumerator
```
The error happens on line 20 because on previous line crc32_fold is declared as a struct member. Using `struct crc32_fold_s` instead of `crc32_fold` fixes the error.

3 years agoDo not use cpuid.h on Windows
Pavel P [Tue, 17 Jan 2023 02:50:14 +0000 (05:50 +0300)] 
Do not use cpuid.h on Windows

According to msdn docs __cpuid/__cpuidex/_xgetbv are provided by intrin.h and should be used on windows

3 years agoMake sure inflate_p.h is fully guarded by header guard
Pavel P [Fri, 13 Jan 2023 18:23:07 +0000 (21:23 +0300)] 
Make sure inflate_p.h is fully guarded by header guard

3 years agoUse const char* for z_error argument
Pavel P [Fri, 13 Jan 2023 18:21:43 +0000 (21:21 +0300)] 
Use const char* for z_error argument

3 years agoDelete ctzl.h
Cameron Cawley [Wed, 11 Jan 2023 20:04:41 +0000 (20:04 +0000)] 
Delete ctzl.h

3 years agoChange pkgcheck to use macos-11 runner
Mika Lindqvist [Wed, 18 Jan 2023 23:47:14 +0000 (01:47 +0200)] 
Change pkgcheck to use macos-11 runner
* macos-latest runner doesn't have XCode 11.7.0 anymore, newer XCode versions have incompatible toolchain

3 years agoChange configure workflow to use gcc-11 for MacOS
Mika Lindqvist [Thu, 19 Jan 2023 00:01:11 +0000 (02:01 +0200)] 
Change configure workflow to use gcc-11 for MacOS
* gcc-9 is not installed on macos-latest runner

3 years agoFix visibility of a few internal functions.
Hans Kristian Rosbach [Thu, 29 Dec 2022 12:39:35 +0000 (13:39 +0100)] 
Fix visibility of a few internal functions.

3 years agoCorrect indents
Piotr Kubaj [Sat, 12 Nov 2022 00:51:22 +0000 (01:51 +0100)] 
Correct indents

3 years agoFix configure script for FreeBSD/powerpc*
Piotr Kubaj [Mon, 3 Oct 2022 23:43:02 +0000 (01:43 +0200)] 
Fix configure script for FreeBSD/powerpc*

3 years agoAdd FreeBSD/powerpc* support to cmake/detect-intrinsics.cmake
Piotr Kubaj [Tue, 27 Sep 2022 22:57:46 +0000 (00:57 +0200)] 
Add FreeBSD/powerpc* support to cmake/detect-intrinsics.cmake

3 years agoFix build on FreeBSD/powerpc*
Piotr Kubaj [Tue, 6 Sep 2022 17:19:15 +0000 (19:19 +0200)] 
Fix build on FreeBSD/powerpc*

Use elf_aux_info() instead of getauxval() on FreeBSD.

3 years agoAllow gtest_zlib to be manually disabled
Cameron Cawley [Thu, 13 Oct 2022 17:52:50 +0000 (18:52 +0100)] 
Allow gtest_zlib to be manually disabled

3 years agoPrefix shared functions to prevent symbol conflict when linking native api against...
Nathan Moinvaziri [Sat, 25 Jun 2022 22:25:22 +0000 (15:25 -0700)] 
Prefix shared functions to prevent symbol conflict when linking native api against compat api.

3 years agoAdd missing symbol name mangling
Dženan Zukić [Thu, 4 Aug 2022 20:55:30 +0000 (16:55 -0400)] 
Add missing symbol name mangling

See https://github.com/InsightSoftwareConsortium/ITK/issues/3530

3 years agoIncrease ghostflow-director max-size for crc32_braid_tbl.h
Dženan Zukić [Thu, 4 Aug 2022 21:47:33 +0000 (17:47 -0400)] 
Increase ghostflow-director max-size for crc32_braid_tbl.h

3 years agoIBM zSystems DFLTCC: Do not update strm.adler for raw streams
Ilya Leoshkevich [Thu, 22 Dec 2022 09:34:57 +0000 (10:34 +0100)] 
IBM zSystems DFLTCC: Do not update strm.adler for raw streams

Commit d38dd9240f2d ("IBM Z DFLTCC: Fix updating strm.adler with
inflate()") broke libxml2, as can be seen with the repro from [1]:

    $ echo "<a></a>" | gzip >file.xml.gz
    $ python3 -c 'import libxml2; libxml2.parseFile("file.xml.gz")'
    file.xml.gz:1: parser error : Document is empty

This is because libxml2 expects strm.adler to be untouched for raw
streams.

Fix this and a similar issue in deflate by adding state->wrap checks.
Add tests.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2155328
[2] https://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.10.3/xzlib.c#L607

3 years agoForce ppc64le to ubuntu 20.04 to prevent illegal instruction.
Nathan Moinvaziri [Tue, 27 Dec 2022 22:42:22 +0000 (14:42 -0800)] 
Force ppc64le to ubuntu 20.04 to prevent illegal instruction.

3 years agoForce sparc64 to ubuntu 20.04 to prevent segfault.
Nathan Moinvaziri [Tue, 27 Dec 2022 22:24:40 +0000 (14:24 -0800)] 
Force sparc64 to ubuntu 20.04 to prevent segfault.

3 years agoFixed MSAN failed to allocate error on Ubuntu 22.
Nathan Moinvaziri [Tue, 27 Dec 2022 23:27:13 +0000 (15:27 -0800)] 
Fixed MSAN failed to allocate error on Ubuntu 22.

https://github.com/llvm/llvm-project/issues/55785

3 years agoUse Clang 11.1.0 sources same as Clang version on Ubuntu 22.
Nathan Moinvaziri [Tue, 27 Dec 2022 23:25:07 +0000 (15:25 -0800)] 
Use Clang 11.1.0 sources same as Clang version on Ubuntu 22.

3 years agoTell scan-build ASSERT_TRUE() behaves like assert().
Mika T. Lindqvist [Thu, 15 Dec 2022 04:51:51 +0000 (06:51 +0200)] 
Tell scan-build ASSERT_TRUE() behaves like assert().

3 years agollvm-cov-11 needs llvm-11 on Ubuntu 22.04.
Mika T. Lindqvist [Sun, 11 Dec 2022 14:26:00 +0000 (16:26 +0200)] 
llvm-cov-11 needs llvm-11 on Ubuntu 22.04.

3 years agoIBM zSystems DFLTCC: Support inflate with small window
Ilya Leoshkevich [Thu, 20 Oct 2022 00:28:47 +0000 (02:28 +0200)] 
IBM zSystems DFLTCC: Support inflate with small window

There is no hardware control for DFLTCC window size, and because of
that supporting small windows for deflate is not trivial: one has to
make sure that DFLTCC does not emit large distances, which most likely
entails somehow trimming the window and/or input in order to make sure
that whave + avail_in <= wsize.

But inflate is much easier: one only has to allocate enough space. Do
that in dfltcc_alloc_window(), and also introduce ZCOPY_WINDOW() in
order to copy everything, not just what the software implementation
cares about.

After this change, software and hardware window formats no longer
match: the software will use wbits and wsize, and the hardware will use
HB_BITS and HB_SIZE. Unlike deflate, inflate does not switch between
software and hardware implementations mid-stream, which leaves only
inflateSetDictionary() and inflateGetDictionary() interesting.

3 years agoAdd CodeQL workflow for GitHub code scanning
LGTM Migrator [Wed, 9 Nov 2022 11:28:47 +0000 (11:28 +0000)] 
Add CodeQL workflow for GitHub code scanning

3 years agoFixed cast to smaller integer type on MSYS2 Clang64.
Nathan Moinvaziri [Sat, 19 Nov 2022 23:03:41 +0000 (15:03 -0800)] 
Fixed cast to smaller integer type on MSYS2 Clang64.

zlib/crc32_braid.c:128:24: error: cast to smaller integer type 'unsigned long'
 from 'const uint8_t *' (aka 'const unsigned char *')

3 years agoUpdate wine32 dependencies for Ubuntu 22.04
Mika T. Lindqvist [Sun, 4 Dec 2022 17:51:12 +0000 (19:51 +0200)] 
Update wine32 dependencies for Ubuntu 22.04

3 years agoUbuntu 22.04 CI image doesn't have clang-11 installed.
Mika T. Lindqvist [Mon, 5 Dec 2022 12:06:09 +0000 (14:06 +0200)] 
Ubuntu 22.04 CI image doesn't have clang-11 installed.

3 years agoUse CMake detection for Emscripten due to a bug in vcpkg.
Ingvar Stepanyan [Fri, 4 Nov 2022 16:31:13 +0000 (16:31 +0000)] 
Use CMake detection for Emscripten due to a bug in vcpkg.

When installing for wasm32 with vcpkg, CMake's try_run does not end up running
with the correct compiler. This issue has been mention in a few existing vcpkg
portfiles.

Alternatively, we could check the VCPKG_TARGET_ARCHITECTURE variable for wasm32
but instead we check for EMSCRIPTEN CMake variable.

3 years agoAll overriding the emulator used by configure script with EMU_RUN.
Nathan Moinvaziri [Mon, 10 Oct 2022 01:41:50 +0000 (18:41 -0700)] 
All overriding the emulator used by configure script with EMU_RUN.

3 years agoUpload generated makefiles when configure runs fail.
Nathan Moinvaziri [Mon, 22 Aug 2022 01:59:45 +0000 (18:59 -0700)] 
Upload generated makefiles when configure runs fail.

3 years agoAdded cmake and configure matrix runs for Emscripten.
Nathan Moinvaziri [Mon, 22 Aug 2022 01:37:14 +0000 (18:37 -0700)] 
Added cmake and configure matrix runs for Emscripten.

3 years agoRemove unused qemu-run variable from configure workflow matrix.
Nathan Moinvaziri [Mon, 22 Aug 2022 00:48:25 +0000 (17:48 -0700)] 
Remove unused qemu-run variable from configure workflow matrix.

The configure script automatically determines this with variable QEMU_ARCH.

3 years agoDon't run deflate concurrency Google Test for Emscripten/WASM32.
Nathan Moinvaziri [Sat, 20 Aug 2022 16:09:55 +0000 (09:09 -0700)] 
Don't run deflate concurrency Google Test for Emscripten/WASM32.

3 years agoTurn off tests for Emscripten that use large amounts of data.
Nathan Moinvaziri [Mon, 22 Aug 2022 02:26:32 +0000 (19:26 -0700)] 
Turn off tests for Emscripten that use large amounts of data.

3 years agoAdd support for compiling to WebAssembly using Emscripten.
Piotr Sikora [Mon, 22 Aug 2022 00:41:54 +0000 (17:41 -0700)] 
Add support for compiling to WebAssembly using Emscripten.

Co-authored-by: Nathan Moinvaziri <nathan@nathanm.com>
3 years agoSupport using aligned_alloc() for memory allocation
Cameron Cawley [Thu, 13 Oct 2022 13:59:18 +0000 (14:59 +0100)] 
Support using aligned_alloc() for memory allocation

3 years agoIntroduce ZLIBNG_ENABLE_TESTS
Ilya Leoshkevich [Tue, 27 Sep 2022 22:50:36 +0000 (00:50 +0200)] 
Introduce ZLIBNG_ENABLE_TESTS

This patch adds the ability to run zlib-ng test suite against the
original zlib as follows:

    cmake -DZLIB_COMPAT=ON -DZLIBNG_ENABLE_TESTS=OFF .
    make
    LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu make test

The benefit of this is that modifications to the original zlib can be
tested with a more extensive zlib-ng's testsuite, and the assumptions
that the zlib-ng tests make can be validated against the original zlib.

In addition to a number of tests that exercise purely zlib-ng specific
API, there are a few that expect zlib-ng specific behavior from the
original zlib API:

- deflate() (obviously) emits different streams
- zlib-ng's deflatePrime() can take more than 16 bits
- zVersion() returns a different string

Adjust or disable the respective tests for ZLIBNG_ENABLE_TESTS=OFF.

3 years agoMakefile.in: distclean should remove zlib.pc instead of clean
tch69 [Thu, 27 Oct 2022 14:42:19 +0000 (21:42 +0700)] 
Makefile.in: distclean should remove zlib.pc instead of clean

3 years agoDetect the availability of _Thread_local using a configure check
Cameron Cawley [Thu, 29 Sep 2022 18:30:31 +0000 (19:30 +0100)] 
Detect the availability of _Thread_local using a configure check

3 years agoEnable and fix -Wimplicit-fallthrough warnings
Cameron Cawley [Thu, 13 Oct 2022 15:07:37 +0000 (16:07 +0100)] 
Enable and fix -Wimplicit-fallthrough warnings

3 years ago[MinGW] Disable GCC warning about using MS format specifiers in ISO C conformant...
Mika Lindqvist [Thu, 13 Oct 2022 15:18:52 +0000 (18:18 +0300)] 
[MinGW] Disable GCC warning about using MS format specifiers in ISO C conformant code

3 years agoFix typo in README.md
Cameron Cawley [Wed, 12 Oct 2022 21:21:21 +0000 (22:21 +0100)] 
Fix typo in README.md

3 years agoFix deflate() with Z_BEST_COMPRESSION ignoring the dictionary
Ilya Leoshkevich [Thu, 20 Oct 2022 04:28:44 +0000 (06:28 +0200)] 
Fix deflate() with Z_BEST_COMPRESSION ignoring the dictionary

deflate_slow() uses s->quick_insert_string(), while
deflateSetDictionary() uses functable.insert_string(). These functions
use different hashing algorithms, which leads to deflate_slow()
ignoring the dictionary.

Fix by using s->insert_string() instead of functable.insert_string(),
which is set by lm_set_level() and matches what deflate_*() uses
(suggested by Mika Lindqvist).

3 years agoImprove Microsoft Visual Studio CI
Vladislav Shchapov [Sun, 2 Oct 2022 11:23:25 +0000 (16:23 +0500)] 
Improve Microsoft Visual Studio CI

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
3 years agoFix crc32_fold_pclmulqdq.c(241): error C2719: 'fold3': formal parameter with requeste...
Vladislav Shchapov [Sun, 2 Oct 2022 13:16:24 +0000 (18:16 +0500)] 
Fix crc32_fold_pclmulqdq.c(241): error C2719: 'fold3': formal parameter with requested alignment of 16 won't be aligned (MSVC 2015 Win32).

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
3 years agoFix missing intrinsics (MSVS 2015, 2017)
Vladislav Shchapov [Tue, 11 Oct 2022 13:12:16 +0000 (18:12 +0500)] 
Fix missing intrinsics (MSVS 2015, 2017)

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
3 years agoFix AVX2 detect
Vladislav Shchapov [Sun, 2 Oct 2022 18:01:52 +0000 (23:01 +0500)] 
Fix AVX2 detect

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
3 years agoFix memcpy() overflow in adler32_fold.c and crc32_fold.c
Mika Lindqvist [Wed, 5 Oct 2022 10:58:28 +0000 (13:58 +0300)] 
Fix memcpy() overflow in adler32_fold.c and crc32_fold.c
* On 32-bit platforms, last parameter of memcpy() is limited to SSIZE_MAX, but is likely to overlap if used

3 years agoFix compiler warnings when ARM_NEON_HASLD4 is undefined
Cameron Cawley [Sat, 1 Oct 2022 15:01:52 +0000 (16:01 +0100)] 
Fix compiler warnings when ARM_NEON_HASLD4 is undefined

3 years agoSimplify feature checks in neon_intrins.h
Cameron Cawley [Thu, 29 Sep 2022 20:45:39 +0000 (21:45 +0100)] 
Simplify feature checks in neon_intrins.h

3 years agoMove the NEON compatibility defines into a separate file
Cameron Cawley [Thu, 29 Sep 2022 18:55:34 +0000 (19:55 +0100)] 
Move the NEON compatibility defines into a separate file

3 years agoUse static inline in x86_features.c
Cameron Cawley [Sun, 25 Sep 2022 20:42:36 +0000 (21:42 +0100)] 
Use static inline in x86_features.c

3 years agoCheck that the OS supports saving the YMM registers before enabling AVX2
Cameron Cawley [Sun, 25 Sep 2022 19:11:14 +0000 (20:11 +0100)] 
Check that the OS supports saving the YMM registers before enabling AVX2

3 years agoUse short decompress option name for gzip compatibility. #1347
Nathan Moinvaziri [Wed, 28 Sep 2022 16:38:06 +0000 (09:38 -0700)] 
Use short decompress option name for gzip compatibility. #1347

Long option names in BusyBoxy is an optional feature, so use short option
names by default.

3 years agoRemove unused tryboth() function
Hans Kristian Rosbach [Sun, 25 Sep 2022 15:59:44 +0000 (17:59 +0200)] 
Remove unused tryboth() function

3 years agovpclmulqdq compilation fails without avx512f also enabled
Hans Kristian Rosbach [Wed, 14 Sep 2022 19:30:43 +0000 (21:30 +0200)] 
vpclmulqdq compilation fails without avx512f also enabled

3 years agoMake visibility tests run the same way as the other tests.
Hans Kristian Rosbach [Wed, 14 Sep 2022 19:29:41 +0000 (21:29 +0200)] 
Make visibility tests run the same way as the other tests.
Fix indentation.

3 years agoDon't try to link gz* objects twice.
Hans Kristian Rosbach [Wed, 14 Sep 2022 19:27:48 +0000 (21:27 +0200)] 
Don't try to link gz* objects twice.

3 years agoRemove errant space in cmake posix specifier
Hans Kristian Rosbach [Wed, 14 Sep 2022 19:26:32 +0000 (21:26 +0200)] 
Remove errant space in cmake posix specifier

3 years agoIBM Z DFLTCC: Fix updating strm.adler with inflate()
Ilya Leoshkevich [Sat, 17 Sep 2022 13:32:29 +0000 (15:32 +0200)] 
IBM Z DFLTCC: Fix updating strm.adler with inflate()

inflate() does not update strm.adler with DFLTCC.
Add a missing assignment to dfltcc_inflate() to fix this.
Note that deflate() is not affected.
Also add a test to prevent regressions.

3 years ago[Compat] Don't use uint32_t for z_crc_t
Mika Lindqvist [Sun, 11 Sep 2022 13:15:10 +0000 (16:15 +0300)] 
[Compat] Don't use uint32_t for z_crc_t
* We don't include stdint.h as it must be included before stdarg.h and other headers might include stdarg.h before us

See #1342

3 years agomsvc/armv7: disable crc32_acle
Shawn Hoffman [Tue, 6 Sep 2022 20:11:16 +0000 (13:11 -0700)] 
msvc/armv7: disable crc32_acle
msvc compiler targeting 32bit arm supports
only armv7 and lacks these intrinsics

3 years agoFixed casting warning from uint64_t to size_t in adler32_copy benchmarks
Nathan Moinvaziri [Sun, 11 Sep 2022 19:36:59 +0000 (15:36 -0400)] 
Fixed casting warning from uint64_t to size_t in adler32_copy benchmarks

3 years agoFixed undefined variable random_ints in adler32_copy benchmarks.
Nathan Moinvaziri [Sun, 11 Sep 2022 19:36:33 +0000 (15:36 -0400)] 
Fixed undefined variable random_ints in adler32_copy benchmarks.

3 years agoPin Google Benchmark to v1.7.0 since master tag has been removed.
Nathan Moinvaziri [Sun, 11 Sep 2022 19:35:24 +0000 (15:35 -0400)] 
Pin Google Benchmark to v1.7.0 since master tag has been removed.

3 years agoInflate: Increase max root table sizes to 10 and 9
Dougall Johnson [Mon, 22 Aug 2022 00:57:39 +0000 (10:57 +1000)] 
Inflate: Increase max root table sizes to 10 and 9

This increases the size of the `codes` array by 1920 bytes (33%), but
improves performance a little. Root table size is still limited by the
maximum code length in use, so tiny files typically see no change to
table-building time, as they don't use longer codes.

3 years agoFix build failure introduced by 8df665005952cdbe7dc995d409ffe4f861e7a83e
Mika Lindqvist [Sun, 11 Sep 2022 15:57:02 +0000 (18:57 +0300)] 
Fix build failure introduced by 8df665005952cdbe7dc995d409ffe4f861e7a83e
* We need absolute path for libz.a

3 years agoFix wine32 dependencies for MinGW i686.
Mika Lindqvist [Mon, 29 Aug 2022 07:50:05 +0000 (10:50 +0300)] 
Fix wine32 dependencies for MinGW i686.
* Downgrade broken libgd3

3 years agoAdd CVE-2022-37434 test.
Vladislav Shchapov [Fri, 19 Aug 2022 11:33:59 +0000 (16:33 +0500)] 
Add CVE-2022-37434 test.

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
3 years agoIf the extra field was larger than the space the user provided with
Mika Lindqvist [Fri, 19 Aug 2022 12:00:21 +0000 (15:00 +0300)] 
If the extra field was larger than the space the user provided with
inflateGetHeader(), and if multiple calls of inflate() delivered
the extra header data, then there could be a buffer overflow of the
provided space. This commit assures that provided space is not
exceeded.

See #1323.

3 years agoformat Vcpkg
FrankXie [Fri, 26 Aug 2022 02:19:03 +0000 (19:19 -0700)] 
format Vcpkg

3 years agoformat and add vcpkg headings.
FrankXie [Fri, 26 Aug 2022 02:16:00 +0000 (19:16 -0700)] 
format and add vcpkg headings.

3 years agoAdd vcpkg installation instructions
FrankXie [Thu, 25 Aug 2022 03:02:12 +0000 (20:02 -0700)] 
Add vcpkg installation instructions

3 years agoAdd add_subdirectory test.
Vladislav Shchapov [Wed, 17 Aug 2022 16:06:37 +0000 (21:06 +0500)] 
Add add_subdirectory test.

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
3 years agoFix build as subproject.
Vladislav Shchapov [Wed, 17 Aug 2022 13:13:39 +0000 (18:13 +0500)] 
Fix build as subproject.

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
3 years agofix ACLE detection on msvc/arm64
Shawn Hoffman [Sun, 24 Jul 2022 04:01:04 +0000 (21:01 -0700)] 
fix ACLE detection on msvc/arm64

3 years agomsvc/arm64: fix narrowing/signed conversion warning in NEON_accum32
Shawn Hoffman [Sun, 24 Jul 2022 04:01:47 +0000 (21:01 -0700)] 
msvc/arm64: fix narrowing/signed conversion warning in NEON_accum32

3 years agoRemove extra compiler names
Long Nguyen [Sat, 13 Aug 2022 03:38:02 +0000 (10:38 +0700)] 
Remove extra compiler names

3 years agoSet `CMAKE_*_COMPILER_TARGET` to full triplet for mingw toolchains
Long Nguyen [Tue, 12 Jul 2022 09:27:52 +0000 (16:27 +0700)] 
Set `CMAKE_*_COMPILER_TARGET` to full triplet for mingw toolchains

3 years agoRemove ZLIB_DUAL_LINK option to simplify dual link tests.
Nathan Moinvaziri [Sat, 20 Aug 2022 16:55:49 +0000 (09:55 -0700)] 
Remove ZLIB_DUAL_LINK option to simplify dual link tests.

3 years agoActually run `configure` CI on macOS with GCC
Mosè Giordano [Wed, 24 Aug 2022 19:39:03 +0000 (20:39 +0100)] 
Actually run `configure` CI on macOS with GCC

`gcc` is an alias for Apple Clang on macOS.  See for example https://github.com/zlib-ng/zlib-ng/runs/7963904948?check_suite_focus=true
```
gcc -O2  -std=c11 -Wall -fPIC -DNDEBUG -DHAVE_POSIX_MEMALIGN -DWITH_GZFILEOP -fno-semantic-interposition -DHAVE_VISIBILITY_HIDDEN -DHAVE_VISIBILITY_INTERNAL -DHAVE_BUILTIN_CTZ -DHAVE_BUILTIN_CTZLL -DX86_FEATURES -DX86_AVX2 -DX86_AVX2_ADLER32 -DX86_AVX_CHUNKSET -DX86_AVX512 -DX86_AVX512_ADLER32 -DX86_MASK_INTRIN -DX86_AVX512VNNI -DX86_AVX512VNNI_ADLER32 -DX86_SSE41 -DX86_SSE42_CRC_HASH -DX86_SSE42_ADLER32 -DX86_SSE42_CRC_INTRIN -DX86_SSE2 -DX86_SSE2_CHUNKSET -DX86_SSSE3 -DX86_SSSE3_ADLER32 -DX86_PCLMULQDQ_CRC -DPIC -I/Users/runner/work/zlib-ng/zlib-ng -c -o adler32.lo /Users/runner/work/zlib-ng/zlib-ng/adler32.c
clang: warning: argument unused during compilation: '-fno-semantic-interposition' [-Wunused-command-line-argument]
```

In order to use the real GCC you have to call `gcc-9`, `gcc-10`, or `gcc-11`: https://github.com/actions/runner-images/blob/06dd4c14e4aa8c14febdd8d6cf123b8d770b4e4a/images/macos/macos-11-Readme.md#language-and-runtime.

3 years agoFixed content already populated error in CMake scripts. #1327
Nathan Moinvaziri [Sun, 21 Aug 2022 17:03:32 +0000 (10:03 -0700)] 
Fixed content already populated error in CMake scripts. #1327

Should only need to use either FetchContent_MakeAvailable or
FetchContent_GetProperties and FetchContent_Populate but not both methods. We
use the later for CMake compatibility with lower versions.

3 years agocmake: respect custom `RC` flags and delete `GCC_WINDRES`
Viktor Szakats [Sun, 17 Jul 2022 19:33:01 +0000 (19:33 +0000)] 
cmake: respect custom `RC` flags and delete `GCC_WINDRES`

Before this patch, `zlib.rc` was compiled using a manual command [1] when
using the MinGW (and MSYS/Cygwin) toolchains. This method ignores
`CMAKE_RC_FLAGS` and offers no other way to pass a custom flag, breaking
the build in cases where a custom `windres` option is required. E.g.
`--target=` or `-I` on some platforms and configuration, in particular
with `llvm-windres`.

This patch deletes the special case for these toolchains and lets CMake
compile the `.rc` file the default way used for all Windows targets.

I'm not entirely sure why this special case was added back in 2011. The
need to pass `-DGCC_WINDRES` is my suspect. We can resolve this much
simpler by adding this line for the targets that require it:
   set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -DGCC_WINDRES")

But, the `.rc` line protected by `GCC_WINDRES`, these days work just fine
with `windres`. Moreover, that protected line are oboslete flags from the
16-bit era, which for a long time have no effect, as documented here:
<https://docs.microsoft.com/windows/win32/menurc/common-resource-attributes>

So, this patch deletes `GCC_WINDRES` from the project entirely.

[1] dc5a43e

3 years agoReorganize cmake scripts for tests.
Nathan Moinvaziri [Mon, 4 Jul 2022 18:53:46 +0000 (11:53 -0700)] 
Reorganize cmake scripts for tests.

* Moves cmake scripts for testing into test/cmake.
* Separates out related add_tests into separate cmake scripts.
* Moves building test binaries into CMakeLists.txt in test directory.

3 years agoFix inflateBack to detect invalid input with distances too far.
Mark Adler [Thu, 30 Jun 2022 19:04:27 +0000 (12:04 -0700)] 
Fix inflateBack to detect invalid input with distances too far.

3 years agoDon't use unaligned access for memcpy instructions due to GCC 11 assuming it is align...
Nathan Moinvaziri [Wed, 29 Jun 2022 15:57:11 +0000 (08:57 -0700)] 
Don't use unaligned access for memcpy instructions due to GCC 11 assuming it is aligned in certain instances.

3 years agoTreat arm64 as aarch64 for Apple M1.
Mika Lindqvist [Sat, 9 Jul 2022 09:33:02 +0000 (12:33 +0300)] 
Treat arm64 as aarch64 for Apple M1.

3 years agoFixed functions declared without a prototype warning in tools.
Nathan Moinvaziri [Sat, 2 Jul 2022 20:59:19 +0000 (13:59 -0700)] 
Fixed functions declared without a prototype warning in tools.

  tools/maketrees.c:101:29: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
static void gen_trees_header()

  tools/makecrct.c:65:27: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
static void make_crc_table()

3 years agoDon't use zlib fork identifier in copyright statement.
Nathan Moinvaziri [Thu, 30 Jun 2022 18:23:23 +0000 (11:23 -0700)] 
Don't use zlib fork identifier in copyright statement.

3 years agoUse 15 (0xf) for ZLIB_VER_SUBREVISION to indicate zlib fork.
Nathan Moinvaziri [Thu, 30 Jun 2022 18:23:37 +0000 (11:23 -0700)] 
Use 15 (0xf) for ZLIB_VER_SUBREVISION to indicate zlib fork.

3 years agoSet max time for job to complete to 60 minutes.
Nathan Moinvaziri [Sun, 19 Jun 2022 21:42:57 +0000 (14:42 -0700)] 
Set max time for job to complete to 60 minutes.