Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch up master to base zlib repo master #1

Open
wants to merge 323 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
323 commits
Select commit Hold shift + click to select a range
feafcfa
No need to check for NULL argument to free().
madler Dec 30, 2016
ee7d7b5
Add deflateGetDictionary() function.
madler Dec 31, 2016
79b5c5a
Use snprintf() for later versions of Microsoft C.
madler Dec 31, 2016
d6f0da2
Fix character encoding and link in contrib README.
madler Dec 31, 2016
50dca6d
Fix init macros to use z_ prefix when requested.
madler Dec 31, 2016
f12d3dc
Detect clang in cc version.
madler Dec 31, 2016
d465465
Replace as400 with os400 for OS/400 support (Monnerat).
madler Dec 31, 2016
fb26fc4
Allow minigzip to compile when testing with ./configure --solo.
madler Dec 31, 2016
8f147c3
Avoid some random compiler warnings on various platforms.
madler Dec 31, 2016
f3fcb92
Use intptr_t for z_ssize_t on MSVC.
madler Dec 31, 2016
b7fbee2
Use a uniform approach for the largest value of an unsigned type.
madler Dec 31, 2016
cca27e9
Avoid the need for ssize_t.
madler Dec 31, 2016
61b91f2
Make z_size_t unsigned long for non-standard C.
madler Jan 1, 2017
b9ae6f0
Add crc32_z() and adler32_z() functions with size_t lengths.
madler Jan 1, 2017
14e3194
Update Visual Studio project files (AraHaan).
madler Jan 1, 2017
2fa463b
zlib 1.2.9
madler Dec 31, 2016
6bdca50
Fix some stray 1.2.8.1 version numbers.
madler Jan 2, 2017
20e4725
Change version number to zlib 1.2.9.1.
madler Jan 2, 2017
7358ef2
Avoid warnings on snprintf() return value.
madler Jan 1, 2017
52aa550
Minor edits and clarifications of comments.
madler Jan 2, 2017
bc5503b
Fix bug in deflate_stored() for zero-length input.
madler Jan 2, 2017
0b5c158
Fix bug in gzwrite.c that produced corrupt gzip files.
madler Jan 3, 2017
c7d7775
Remove files to be installed before copying them in Makefile.in.
madler Jan 3, 2017
1e3bccd
Add warnings when compiling with assembler code.
madler Jan 3, 2017
e13def0
Fix compilation with --solo and --debug combined.
madler Jan 3, 2017
4a090ad
zlib 1.2.10
madler Jan 3, 2017
11ceaed
Change version number to 1.2.10.1.
madler Jan 15, 2017
c38a260
Delete user-specific Visual Studio project files.
madler Jan 5, 2017
74d2696
Update location of Visual Studio project files.
madler Jan 5, 2017
4c7c907
Fix deflate stored bug when pulling last block from window.
madler Jan 13, 2017
37ed211
Update vestigial comment from very old Info-ZIP deflate.
madler Jan 14, 2017
7d9c9d4
Update high water mark in deflate_stored.
madler Jan 15, 2017
cbbd203
Permit immediate deflateParams changes before any deflate input.
madler Jan 15, 2017
cacf7f1
zlib 1.2.11
madler Jan 15, 2017
7d60b86
Change version number to 1.2.11.1.
madler Jan 16, 2017
5ff9890
Cygwin does not have _wopen(), so do not create gzopen_w() there.
madler Jan 16, 2017
f969409
Permit a deflateParams() parameter change as soon as possible.
madler Jan 16, 2017
2d80d3f
Limit hash table inserts after switch from stored deflate.
madler Jan 21, 2017
8ba393e
Fix bug when window full in deflate_stored().
madler Jan 21, 2017
38e8ce3
Fix CLEAR_HASH macro to be usable as a single statement.
madler Jan 23, 2017
a362293
Avoid a conversion error in gzseek when off_t type too small.
madler Feb 5, 2017
e00a2bd
Have Makefile return non-zero error code on test failure.
madler Feb 12, 2017
793ad7f
Avoid some conversion warnings in gzread.c and gzwrite.c.
madler Feb 12, 2017
e1f1a3a
Update use of errno for newer Windows CE versions.
madler Feb 12, 2017
60a5ecc
Small speedup to inflate [psumbera].
madler Feb 12, 2017
9028763
Return an error if the gzputs string length can't fit in an int.
madler Feb 12, 2017
be5e364
Add address checking in clang to -w option of configure.
madler Feb 19, 2017
89245c0
Don't compute check value for raw inflate if asked to validate.
madler Mar 30, 2017
44e8ac8
Handle case where inflateSync used when header never processed.
madler Apr 16, 2017
3c46f5d
Avoid the use of ptrdiff_t.
madler Jun 3, 2017
ae49d14
Avoid an undefined behavior of memcpy() in gzappend().
madler Oct 13, 2017
b25d5fc
Avoid undefined behaviors of memcpy() in gz*printf().
madler Oct 13, 2017
723e928
Avoid an undefined behavior of memcpy() in _tr_stored_block().
madler Oct 13, 2017
a577351
Make the names in functions declarations identical to definitions.
madler Oct 13, 2017
288f108
Remove old assembler code in which bugs have manifested.
madler Oct 13, 2017
c376a41
Fix deflateEnd() to not report an error at start of raw deflate.
madler Oct 13, 2017
ba9df21
Add legal disclaimer to README.
madler Oct 13, 2017
bf88202
Emphasize the need to continue decompressing gzip members.
madler Jan 9, 2018
e99813d
Correct the initialization requirements for deflateInit2().
madler Jan 31, 2018
5c44459
Fix a bug that can crash deflate on some input when using Z_FIXED.
madler Apr 18, 2018
4346a16
Assure that the number of bits for deflatePrime() is valid.
madler Apr 18, 2018
194e558
Use a structure to make globals in enough.c evident.
madler Aug 1, 2018
4c14b51
Use a macro for the printf format of big_t in enough.c.
madler Aug 1, 2018
8ba2cdb
Clean up code style in enough.c, update version.
madler Aug 1, 2018
5b13810
Use inline function instead of macro for index in enough.c.
madler Aug 2, 2018
d00c147
Clarify that prefix codes are counted in enough.c.
madler Aug 4, 2018
cd16ff0
Show all the codes for the maximum tables size in enough.c.
madler Aug 4, 2018
354fa43
Add gznorm.c example, which normalizes gzip files.
madler Oct 6, 2018
921d81b
Fix the zran.c example to work on a multiple-member gzip file.
madler Oct 8, 2018
47cb412
Add tables for crc32_combine(), to speed it up by a factor of 200.
madler Nov 3, 2018
41d86c7
Add crc32_combine_gen() and crc32_combine_op() for fast combines.
madler Nov 4, 2018
f8719f5
Speed up software CRC-32 computation by a factor of 1.5 to 3.
madler Dec 11, 2018
7c0c75e
Use atomic test and set, if available, for dynamic CRC tables.
madler Dec 26, 2018
0d36ec4
Don't bother computing check value after successful inflateSync().
madler Jan 3, 2019
aec89fa
Correct comment in crc32.c.
madler Feb 4, 2019
52fc78b
Add use of the ARMv8 crc32 instructions when requested.
madler Feb 18, 2019
deb44b5
Use ARM crc32 instructions if the ARM architecture has them.
madler Feb 18, 2019
0e96d8e
Explicitly note that the 32-bit check values are 32 bits.
madler Apr 5, 2019
79baebe
Avoid adding empty gzip member after gzflush with Z_FINISH.
madler Apr 14, 2019
0206436
Fix memory leak on error in gzlog.c.
madler May 26, 2019
d71dc66
Fix error in comment on the polynomial representation of a byte.
madler Jul 9, 2019
e54494e
Clarify gz* function interfaces, referring to parameter names.
madler Aug 31, 2020
53ce271
Change macro name in inflate.c to avoid collision in VxWorks.
madler Sep 17, 2020
506424c
Correct typo in blast.c.
madler Jan 18, 2021
0530dbc
Improve portability of contrib/minizip.
madler Feb 10, 2021
c3f3043
Fix indentation in minizip's zip.c.
madler Jul 8, 2021
8678871
Replace black/white with allow/block. (theresa-m)
madler Jan 1, 2022
b135d46
minizip warning fix if MAXU32 already defined. (gvollant)
madler Jan 1, 2022
58ca4e5
Fix unztell64() in minizip to work past 4GB. (Daniël Hörchner)
madler Jan 1, 2022
2014a99
Clean up minizip to reduce warnings for testing.
madler Jan 1, 2022
76f70ab
Add fallthrough comments for gcc.
madler Mar 27, 2022
735eaa1
Eliminate use of ULL constants.
madler Mar 27, 2022
6847291
Separate out address sanitizing from warnings in configure.
madler Mar 27, 2022
1a1e8da
Remove destructive aspects of make distclean.
madler Mar 27, 2022
e9a52aa
Check for cc masquerading as gcc or clang in configure.
madler Mar 27, 2022
296967c
Fix crc32.c to compile local functions only if used.
madler Mar 27, 2022
21767c6
zlib 1.2.12
madler Mar 27, 2022
a4c1758
Change version number on develop branch to 1.2.12.1.
madler Mar 28, 2022
3df8424
Silence some warnings from Visual Studio C.
madler Mar 28, 2022
05796d3
Fix configure issue that discarded provided CC definition.
madler Mar 29, 2022
ce12773
Fix compile with Windows 10 SDK. (gvollant)
madler Mar 29, 2022
ec3df00
Correct incorrect inputs provided to the CRC functions.
madler Mar 30, 2022
441a2ac
Have build test report library version if it doesn't match zlib.h.
May 26, 2022
6c532a8
Fix missing ZEXPORT for crc32_combine_op().
Jun 4, 2022
7ecf7c7
Fix odd error in Visual C compiler preventing automatic promotion.
Jun 4, 2022
2333419
Fix inflateBack to detect invalid input with distances too far.
Jun 27, 2022
b8bd098
Have infback() deliver all of the available output up to any error.
Jul 24, 2022
eff308a
Fix a bug when getting a gzip header extra field with inflate().
Jul 30, 2022
22aec0c
Add -g when debugging with -fsanitize=address to include symbols.
Jul 31, 2022
1eb7682
Fix extra field processing bug that dereferences NULL state->head.
Aug 8, 2022
5752b17
Fix some typos.
Aug 22, 2022
59b948a
Fix typo in contrib readme.
Aug 28, 2022
2d6d59e
Avoid conversion warning in minigzip.c.
Oct 1, 2022
7fabcb5
Fix bug in block type selection when Z_FIXED used.
Oct 2, 2022
4078713
Tighten deflateBound bounds.
Oct 4, 2022
456775a
Add WIN32_LEAN_AND_MEAN for windows.h include.
Oct 3, 2022
3e4aa45
Add new crc32 functions to z_ prefix defines.
Oct 3, 2022
84c6716
Minor formatting improvements.
Oct 2, 2022
d39a255
Add missing symbols to os400/bndsrc.
Oct 3, 2022
cc8d08c
Update copyright year in win32/zlib1.rc.
Oct 6, 2022
095da07
Remove -pedantic from configure -w compile options.
Oct 6, 2022
d0704a8
Remove deleted assembler code references.
Oct 6, 2022
9331fec
Remove redundant check in gz_look().
Oct 6, 2022
2d283ad
Fix c89 compatibility in minizip's ioapi.c. [gvollant]
Oct 6, 2022
9b291c9
Fix incorrect cast in minizip's ioapi.c.
Oct 6, 2022
138c93c
Security and warning fixes for minizip. [gvollant]
Oct 6, 2022
a9e14e8
Avoid undefined negation behavior if windowBits is INT_MIN.
Oct 6, 2022
888b3da
Provide missing function prototypes in CRC-32 code. [fredgan]
Oct 7, 2022
4572dfb
Remove some harmless semicolons in minizip.
Oct 7, 2022
352cb28
Add a separate LICENSE file to the distribution.
Oct 7, 2022
67eb09a
Add continuous integration workflows. [nmoinvaz]
Oct 7, 2022
8cca42c
Remove bypass of MinGW gcc case in configure.
Oct 9, 2022
013c0ca
Search for system name in CHOST instead of trying to extract it.
Oct 9, 2022
19f8551
Don't try to include unistd.h on Windows with LLVM.
Oct 10, 2022
d30b763
Remove vestigial line from configure.
Oct 10, 2022
e61ff99
Comment out unused code in contrib/minizip/minizip.c.
Oct 10, 2022
2bb4961
Avoid C89 warning in contrib/minizip/crypt.h.
Oct 10, 2022
40c5a9b
Find other BSD's without *64 functions in contrib/minizip/ioapi.h.
Oct 10, 2022
29fd715
Turn off RWX segment warnings on sparc systems.
Oct 10, 2022
0091cb0
Fix linking on AIX with gcc.
Oct 10, 2022
723abd5
Minor formatting changes in configure.
Oct 10, 2022
462986f
CI: Make in-source builds default so we can upload failure logs.
nmoinvaz Oct 11, 2022
594e8e8
CI: Upload build errors on failure.
nmoinvaz Oct 11, 2022
e029de6
CI: Run infcover during test runs.
nmoinvaz Oct 11, 2022
76f3536
CI: Add instance for GCC -O3 on Ubuntu in cmake workflow.
nmoinvaz Oct 11, 2022
b85c172
CI: Add instances for ARM using QEMU in configure workflow.
nmoinvaz Oct 11, 2022
da6f162
CI: Run test applications against QEMU.
nmoinvaz Oct 11, 2022
f5ceeb9
CI: Add instances for PPC using QEMU in configure workflow.
nmoinvaz Oct 11, 2022
2a9cb5a
CI: Add instance for Clang on macOS in configure workflow.
nmoinvaz Oct 11, 2022
d4fb7dd
CI: Add instances for S390X using QEMU in configure workflow.
nmoinvaz Oct 11, 2022
aefaf43
CI: Add instance for GCC on Windows.
nmoinvaz Oct 11, 2022
04f42ce
zlib 1.2.13
Oct 13, 2022
41fda48
Change version number on develop branch to 1.2.13.1.
madler Oct 15, 2022
76820e4
Update broken article link in README.
madler Nov 8, 2022
e554695
Fix bug in deflateBound() for level 0 and memLevel 9.
madler Dec 15, 2022
02a6049
Fix crash when gzsetparams() attempted for transparent write.
madler Dec 27, 2022
a9b4c1d
Update zlib_how.html to match the web page, and add a license.
madler Jan 25, 2023
fa8cd50
Make z_size_t 64 bits when compiling on Windows with Z_SOLO.
madler Jan 26, 2023
12b345c
Assure that inflatePrime() can't shift a 32-bit integer by 32 bits.
madler Feb 17, 2023
eb0e038
Rewrite of zran in examples. See version history in zran.c.
madler Feb 19, 2023
7e6dc42
Add a NOPRIME #define to zran.c to not use inflatePrime().
madler Apr 13, 2023
5799c14
Turn off C2X warning about deprecated K&R function syntax.
madler Apr 14, 2023
e9d5486
Remove K&R function definitions from zlib.
madler Apr 14, 2023
c4aa356
Remove K&R function definitions from infback9.
madler Apr 15, 2023
bf2578b
Remove K&R function definitions from contrib/minizip.
madler Apr 15, 2023
6658868
Remove use of OF() from contrib/untgz and render it compilable.
madler Apr 15, 2023
9b962a4
No include file is needed for __int64 type on Windows.
madler Apr 17, 2023
05527a1
Fix cast in minizip's ioapi.c for Windows.
madler Apr 17, 2023
3365464
Fix warnings on test/infcover.c.
madler Apr 18, 2023
b8a8373
Fix test/example.c to work with FORCE_STORED.
madler Apr 18, 2023
904016e
Update Java and Perl links in README.
madler May 1, 2023
48c3741
Remove duplicate "the" in zlib.h.
pmqs May 1, 2023
263a982
Correct comment in zlib.h on os setting in gzip header.
madler May 17, 2023
a88f727
Document in zlib.h the initialization of stream fields by the Init
madler Jul 10, 2023
a566e15
Avoid compiler complaints if _TIME_BITS defined when building zlib.
madler Jul 30, 2023
f209ca7
minizip: Fix being unable to open empty zip file
RedworkDE Feb 15, 2023
7b28ecc
Remove duplicated code #806
gvollant Jul 29, 2023
e0bd0ad
Fix reading disk number start on zip64 files in minizip.
madler Jul 30, 2023
379bbda
Fix typos found by codespell in minizip
DimitriPapadopoulos Feb 2, 2023
3061e50
Fix logic error in minizip argument processing.
madler Jul 30, 2023
dcd0d86
Match sign of printf directive to sign of argument in minizip.
madler Jul 30, 2023
b3f23f7
Match sign of printf directive to sign of argument in testzlib.
madler Jul 30, 2023
f679a93
Correct dummy filetime() prototype in minizip.c.
xiaoxiang781216 Sep 8, 2022
aa154e3
Support Haiku in minizip.
gvollant Jul 29, 2023
be7aa11
Read multiple bytes instead of byte-by-byte in minizip unzip.c.
eugenegff Aug 3, 2023
2bcc748
Add minizip testing to Makefile.
madler Aug 3, 2023
c7ddcc2
Fix some spelling errors.
DimitriPapadopoulos Feb 2, 2023
7dd6aa7
Fix bug when gzungetc() is used immediately after gzopen().
madler Aug 11, 2023
1411cca
Add memory sanitizer to configure (--memory).
madler Aug 12, 2023
981ee75
Suppress MSAN detections in deflate's slide_hash().
ahunt Jun 4, 2021
c97a8f1
Replace gcc-9 with gcc-11 for macOS testing.
DimitriPapadopoulos Aug 6, 2023
384e50e
Remove TRYFREE macro from minizip.
madler Aug 14, 2023
89ef46b
Remove redundant includes in minizip.
madler Aug 14, 2023
6951bc6
Fix typos in contrib/ada.
DimitriPapadopoulos Aug 6, 2023
d982514
Fix bug when using gzflush() with a very small buffer.
madler Aug 15, 2023
d524e2a
zlib now uses ANSI C function prototypes, so zlib2ansi not needed.
madler Aug 17, 2023
efc9c7b
Add license to contrib/untgz.
bgermann Nov 14, 2022
5f52b25
Move load flags before object file in Makefile.in for Z/OS.
madler Aug 17, 2023
22fc208
Clarify requirement in zlib.h to avoid multiple flush markers.
madler Aug 17, 2023
9889e98
Avoid cmake deprecation warning.
bmarques1995 Mar 14, 2023
daf27ae
Look for a cross-compile libtool first in configure.
Un1q32 Mar 5, 2023
f5ae600
Revert flipping of load flags in Makefile.in for z/OS.
madler Aug 18, 2023
e13289e
Fix typo in preceding reversion commit.
madler Aug 18, 2023
25bbd7f
Avoid uninitialized and unused warnings in contrib/minizip.
madler Aug 18, 2023
899ffef
Use original make and options when Makefile runs make.
madler Aug 18, 2023
09155ea
zlib 1.3
madler Aug 18, 2023
3a98b57
Change version number on develop branch to 1.3.0.1.
madler Aug 18, 2023
5dc7681
Fix version numbering for Darwin shared library.
madler Aug 18, 2023
0f68a0d
Limit the length of Darwin shared library version number.
madler Aug 18, 2023
4c5a81c
Remove carriage returns from contrib/vstudio/readme.txt.
madler Aug 19, 2023
d7de597
Add VS2022 project files.
AraHaan Oct 24, 2022
4a47c1b
Add project and solution files for building a nuget package.
AraHaan Oct 25, 2022
726e189
Remove Windows ARM and ARM64 builds from cmake workflow.
madler Aug 19, 2023
73331a6
Reject overflows of zip header fields in minizip.
zmodem Aug 18, 2023
60bfe64
Rename contrib/vstudio/vc143 to vc17.
madler Aug 19, 2023
7192d69
Update vc directory in contrib/nuget.
madler Aug 20, 2023
8988e03
Update version numbers and year in contrib/vstudio/vc17.
madler Aug 20, 2023
79a0e44
Update version and date in contrib/nuget.
madler Aug 20, 2023
88e50f1
Update miniunz version.
tbeu Nov 15, 2016
5af7cef
Fix bug in inflateSync() for data held in bit buffer.
madler Aug 24, 2023
bd9c329
Make internal functions static in the test code.
delphij Sep 3, 2023
ac8f12c
Add LIT_MEM define to use more memory for a small deflate speedup.
madler Sep 19, 2023
15c45ad
Fix decision on the emission of Zip64 end records in minizip.
madler Nov 7, 2023
643e17b
Correct repeated words in source file comments and a readme.
ivanov Nov 15, 2023
431a9b6
Add bounds checking to ERR_MSG() macro, used by zError().
madler Dec 7, 2023
4bd9a71
Remove fdopen #defines in zutil.h.
madler Dec 13, 2023
ee474ff
Fix pending buffer overflow assert with LIT_MEM allocation.
zmodem Dec 15, 2023
60c3198
Fix the copy of pending_buf in deflateCopy() for the LIT_MEM case.
zmodem Dec 20, 2023
36e369e
Note that the len2 argument of crc_combine*() must be non-negative.
madler Jan 11, 2024
762cf49
Refer to correct function in contrib/minizip/unzip.c comment.
WilliamLeara Dec 11, 2023
190168c
Correct case of MSDOS in contrib/minizip/miniunz.c.
WilliamLeara Dec 11, 2023
16799d0
Fix "the the" in examples/gzlog.c.
WilliamLeara Dec 11, 2023
01155cc
Fix random typos over several source and text files.
THE-Spellchecker Dec 2, 2023
44dc43a
Add a CMake option to link the C runtime statically.
tbeu Nov 19, 2023
14a5f8f
Neutralize zip file traversal attacks in miniunz.
mswilson Jan 17, 2024
6201f89
Add cmake option to control the build of the example executables.
Feb 10, 2017
01253ec
Make the existence of gz_intmax() unconditional.
speedym Oct 9, 2023
fe41d18
Correct typos in source code.
DimitriPapadopoulos Aug 6, 2023
2526346
Remove mentions of an official zlib DLL distribution.
madler Jan 18, 2024
ade6825
Fix cmake build on AIX.
gastush Sep 30, 2022
3f635df
Remove unused Z_ARG macro.
madler Jan 18, 2024
7b632b4
Revert "Add a CMake option to link the C runtime statically."
madler Jan 19, 2024
7af6320
Fix a bug in ZLIB_DEBUG compiles in check_match().
madler Jan 19, 2024
84f0baf
Remove carriage returns from zlib.map.
madler Jan 19, 2024
9404df5
Use updated zconf.h when building out of directory with configure.
dankegel May 22, 2020
88ec246
Remove -w compile option in configure test.
madler Jan 21, 2024
c06dfec
Use Makefile compiler for minizip-test target.
madler Jan 21, 2024
2e3d86c
Add target include directories to CMakeLists.txt.
Mar 26, 2018
1a8db63
Move the load flags before the object files in Makefile tests.
madler Jan 22, 2024
51b7f2a
zlib 1.3.1
madler Jan 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CMake
on: [push, pull_request]
jobs:
ci-cmake:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-latest
compiler: gcc

# Test out of source builds
- name: Ubuntu GCC OSB
os: ubuntu-latest
compiler: gcc
build-dir: ../build
src-dir: ../zlib

- name: Ubuntu GCC -O3
os: ubuntu-latest
compiler: gcc
cflags: -O3

- name: Ubuntu Clang
os: ubuntu-latest
compiler: clang

- name: Ubuntu Clang Debug
os: ubuntu-latest
compiler: clang
build-config: Debug

- name: Windows MSVC Win32
os: windows-latest
compiler: cl
cmake-args: -A Win32

- name: Windows MSVC Win64
os: windows-latest
compiler: cl
cmake-args: -A x64

- name: Windows GCC
os: windows-latest
compiler: gcc
cmake-args: -G Ninja

- name: macOS Clang
os: macos-latest
compiler: clang

- name: macOS GCC
os: macos-latest
compiler: gcc-11

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install packages (Windows)
if: runner.os == 'Windows'
run: |
choco install --no-progress ninja ${{ matrix.packages }}

- name: Generate project files
run: cmake -S ${{ matrix.src-dir || '.' }} -B ${{ matrix.build-dir || '.' }} ${{ matrix.cmake-args }} -D CMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }}
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}

- name: Compile source code
run: cmake --build ${{ matrix.build-dir || '.' }} --config ${{ matrix.build-config || 'Release' }}

- name: Run test cases
run: ctest -C Release --output-on-failure --max-width 120
working-directory: ${{ matrix.build-dir || '.' }}

- name: Upload build errors
uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.name }} (cmake)
path: |
**/CMakeFiles/CMakeOutput.log
**/CMakeFiles/CMakeError.log
retention-days: 7
136 changes: 136 additions & 0 deletions .github/workflows/configure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Configure
on: [push, pull_request]
jobs:
ci-configure:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-latest
compiler: gcc
configure-args: --warn

# Test out of source builds
- name: Ubuntu GCC OSB
os: ubuntu-latest
compiler: gcc
configure-args: --warn
build-dir: ../build
src-dir: ../zlib

- name: Ubuntu GCC ARM SF
os: ubuntu-latest
compiler: arm-linux-gnueabi-gcc
configure-args: --warn
chost: arm-linux-gnueabi
packages: qemu qemu-user gcc-arm-linux-gnueabi libc-dev-armel-cross
qemu-run: qemu-arm -L /usr/arm-linux-gnueabi

- name: Ubuntu GCC ARM HF
os: ubuntu-latest
compiler: arm-linux-gnueabihf-gcc
configure-args: --warn
chost: arm-linux-gnueabihf
packages: qemu qemu-user gcc-arm-linux-gnueabihf libc-dev-armhf-cross
qemu-run: qemu-arm -L /usr/arm-linux-gnueabihf

- name: Ubuntu GCC AARCH64
os: ubuntu-latest
compiler: aarch64-linux-gnu-gcc
configure-args: --warn
chost: aarch64-linux-gnu
packages: qemu qemu-user gcc-aarch64-linux-gnu libc-dev-arm64-cross
qemu-run: qemu-aarch64 -L /usr/aarch64-linux-gnu

- name: Ubuntu GCC PPC
os: ubuntu-latest
compiler: powerpc-linux-gnu-gcc
configure-args: --warn --static
chost: powerpc-linux-gnu
packages: qemu qemu-user gcc-powerpc-linux-gnu libc-dev-powerpc-cross
qemu-run: qemu-ppc -L /usr/powerpc-linux-gnu
cflags: -static
ldflags: -static

- name: Ubuntu GCC PPC64
os: ubuntu-latest
compiler: powerpc64-linux-gnu-gcc
configure-args: --warn --static
chost: powerpc-linux-gnu
packages: qemu qemu-user gcc-powerpc64-linux-gnu libc-dev-ppc64-cross
qemu-run: qemu-ppc64 -L /usr/powerpc64-linux-gnu
cflags: -static
ldflags: -static

- name: Ubuntu GCC PPC64LE
os: ubuntu-latest
compiler: powerpc64le-linux-gnu-gcc
configure-args: --warn
chost: powerpc64le-linux-gnu
packages: qemu qemu-user gcc-powerpc64le-linux-gnu libc-dev-ppc64el-cross
qemu-run: qemu-ppc64le -L /usr/powerpc64le-linux-gnu

- name: Ubuntu GCC S390X
os: ubuntu-latest
compiler: s390x-linux-gnu-gcc
configure-args: --warn --static
chost: s390x-linux-gnu
packages: qemu qemu-user gcc-s390x-linux-gnu libc-dev-s390x-cross
qemu-run: qemu-s390x -L /usr/s390x-linux-gnu
cflags: -static
ldflags: -static

- name: macOS GCC
os: macos-latest
compiler: gcc-11
configure-args: --warn

- name: macOS Clang
os: macos-latest
compiler: clang
configure-args: --warn

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install packages (Ubuntu)
if: runner.os == 'Linux' && matrix.packages
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.packages }}

- name: Generate project files
run: |
[ -d ${{ matrix.build-dir || '.' }} ] || mkdir ${{ matrix.build-dir || '.' }}
cd ${{ matrix.build-dir || '.' }}
${{ matrix.src-dir || '.' }}/configure ${{ matrix.configure-args }}
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}
LDFLAGS: ${{ matrix.ldflags }}
CHOST: ${{ matrix.chost }}

- name: Compile source code
run: make -j2
working-directory: ${{ matrix.build-dir }}

- name: Run test cases
run: |
make test
make cover
working-directory: ${{ matrix.build-dir }}
env:
QEMU_RUN: ${{ matrix.qemu-run }}

- name: Upload build errors
uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.name }} (configure)
path: |
${{ matrix.build-dir || '.' }}/configure.log
retention-days: 7
25 changes: 25 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: OSS-Fuzz
on: [pull_request]
jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'zlib'
dry-run: false

- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'zlib'
fuzz-seconds: 300
dry-run: false

- name: Upload Crash
uses: actions/upload-artifact@v3
if: failure()
with:
name: artifacts
path: ./out/artifacts
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,21 @@
/example
/example64
/examplesh
/libz.so*
**/libz.so*
/minigzip
/minigzip64
/minigzipsh
/zlib.pc
/configure.log

.DS_Store
.vs
*.user
*.nupkg
contrib/vstudio/vc143/x86
contrib/vstudio/vc143/x64
contrib/vstudio/vc143/arm
contrib/vstudio/vc143/arm64
contrib/nuget/bin
contrib/nuget/obj
*.included
83 changes: 26 additions & 57 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
cmake_minimum_required(VERSION 2.4.4)
cmake_minimum_required(VERSION 2.4.4...3.15.0)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)

project(zlib C)

set(VERSION "1.2.8")
set(VERSION "1.3.1")

option(ASM686 "Enable building i686 assembly implementation")
option(AMD64 "Enable building amd64 assembly implementation")
option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON)

set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
Expand Down Expand Up @@ -129,39 +128,6 @@ if(NOT MINGW)
)
endif()

if(CMAKE_COMPILER_IS_GNUCC)
if(ASM686)
set(ZLIB_ASMS contrib/asm686/match.S)
elseif (AMD64)
set(ZLIB_ASMS contrib/amd64/amd64-match.S)
endif ()

if(ZLIB_ASMS)
add_definitions(-DASMV)
set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
endif()
endif()

if(MSVC)
if(ASM686)
ENABLE_LANGUAGE(ASM_MASM)
set(ZLIB_ASMS
contrib/masmx86/inffas32.asm
contrib/masmx86/match686.asm
)
elseif (AMD64)
ENABLE_LANGUAGE(ASM_MASM)
set(ZLIB_ASMS
contrib/masmx64/gvmat64.asm
contrib/masmx64/inffasx64.asm
)
endif()

if(ZLIB_ASMS)
add_definitions(-DASMV -DASMINF)
endif()
endif()

# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
Expand All @@ -183,8 +149,10 @@ if(MINGW)
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
endif(MINGW)

add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES SOVERSION 1)

Expand All @@ -202,7 +170,7 @@ endif()
if(UNIX)
# On unix-like platforms the library is almost always called libz
set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
if(NOT APPLE)
if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
elseif(BUILD_SHARED_LIBS AND WIN32)
Expand All @@ -229,21 +197,22 @@ endif()
#============================================================================
# Example binaries
#============================================================================

add_executable(example test/example.c)
target_link_libraries(example zlib)
add_test(example example)

add_executable(minigzip test/minigzip.c)
target_link_libraries(minigzip zlib)

if(HAVE_OFF64_T)
add_executable(example64 test/example.c)
target_link_libraries(example64 zlib)
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
add_test(example64 example64)

add_executable(minigzip64 test/minigzip.c)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
if(ZLIB_BUILD_EXAMPLES)
add_executable(example test/example.c)
target_link_libraries(example zlib)
add_test(example example)

add_executable(minigzip test/minigzip.c)
target_link_libraries(minigzip zlib)

if(HAVE_OFF64_T)
add_executable(example64 test/example.c)
target_link_libraries(example64 zlib)
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
add_test(example64 example64)

add_executable(minigzip64 test/minigzip.c)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()
endif()
Loading