Skip to content

Commit 094bb40

Browse files
committed
Merge commit '04f42ceca40f73e2978b50e93806c2a18c1281fc'
2 parents 05bdc78 + 04f42ce commit 094bb40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+925
-969
lines changed

.github/workflows/cmake.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: CMake
2+
on: [push, pull_request]
3+
jobs:
4+
ci-cmake:
5+
name: ${{ matrix.name }}
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
include:
11+
- name: Ubuntu GCC
12+
os: ubuntu-latest
13+
compiler: gcc
14+
15+
# Test out of source builds
16+
- name: Ubuntu GCC OSB
17+
os: ubuntu-latest
18+
compiler: gcc
19+
build-dir: ../build
20+
src-dir: ../zlib
21+
22+
- name: Ubuntu GCC -O3
23+
os: ubuntu-latest
24+
compiler: gcc
25+
cflags: -O3
26+
27+
- name: Ubuntu Clang
28+
os: ubuntu-latest
29+
compiler: clang
30+
31+
- name: Ubuntu Clang Debug
32+
os: ubuntu-latest
33+
compiler: clang
34+
build-config: Debug
35+
36+
- name: Windows MSVC Win32
37+
os: windows-latest
38+
compiler: cl
39+
cmake-args: -A Win32
40+
41+
- name: Windows MSVC Win64
42+
os: windows-latest
43+
compiler: cl
44+
cmake-args: -A x64
45+
46+
- name: Windows GCC
47+
os: windows-latest
48+
compiler: gcc
49+
cmake-args: -G Ninja
50+
51+
- name: macOS Clang
52+
os: macos-latest
53+
compiler: clang
54+
55+
- name: macOS GCC
56+
os: macos-latest
57+
compiler: gcc-9
58+
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v3
62+
63+
- name: Install packages (Windows)
64+
if: runner.os == 'Windows'
65+
run: |
66+
choco install --no-progress ninja ${{ matrix.packages }}
67+
68+
- name: Generate project files
69+
run: cmake -S ${{ matrix.src-dir || '.' }} -B ${{ matrix.build-dir || '.' }} ${{ matrix.cmake-args }} -D CMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }}
70+
env:
71+
CC: ${{ matrix.compiler }}
72+
CFLAGS: ${{ matrix.cflags }}
73+
74+
- name: Compile source code
75+
run: cmake --build ${{ matrix.build-dir || '.' }} --config ${{ matrix.build-config || 'Release' }}
76+
77+
- name: Run test cases
78+
run: ctest -C Release --output-on-failure --max-width 120
79+
working-directory: ${{ matrix.build-dir || '.' }}
80+
81+
- name: Upload build errors
82+
uses: actions/upload-artifact@v3
83+
if: failure()
84+
with:
85+
name: ${{ matrix.name }} (cmake)
86+
path: |
87+
**/CMakeFiles/CMakeOutput.log
88+
**/CMakeFiles/CMakeError.log
89+
retention-days: 7

.github/workflows/configure.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: Configure
2+
on: [push, pull_request]
3+
jobs:
4+
ci-configure:
5+
name: ${{ matrix.name }}
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
include:
11+
- name: Ubuntu GCC
12+
os: ubuntu-latest
13+
compiler: gcc
14+
configure-args: --warn
15+
16+
# Test out of source builds
17+
- name: Ubuntu GCC OSB
18+
os: ubuntu-latest
19+
compiler: gcc
20+
configure-args: --warn
21+
build-dir: ../build
22+
src-dir: ../zlib
23+
24+
- name: Ubuntu GCC ARM SF
25+
os: ubuntu-latest
26+
compiler: arm-linux-gnueabi-gcc
27+
configure-args: --warn
28+
chost: arm-linux-gnueabi
29+
packages: qemu qemu-user gcc-arm-linux-gnueabi libc-dev-armel-cross
30+
qemu-run: qemu-arm -L /usr/arm-linux-gnueabi
31+
32+
- name: Ubuntu GCC ARM HF
33+
os: ubuntu-latest
34+
compiler: arm-linux-gnueabihf-gcc
35+
configure-args: --warn
36+
chost: arm-linux-gnueabihf
37+
packages: qemu qemu-user gcc-arm-linux-gnueabihf libc-dev-armhf-cross
38+
qemu-run: qemu-arm -L /usr/arm-linux-gnueabihf
39+
40+
- name: Ubuntu GCC AARCH64
41+
os: ubuntu-latest
42+
compiler: aarch64-linux-gnu-gcc
43+
configure-args: --warn
44+
chost: aarch64-linux-gnu
45+
packages: qemu qemu-user gcc-aarch64-linux-gnu libc-dev-arm64-cross
46+
qemu-run: qemu-aarch64 -L /usr/aarch64-linux-gnu
47+
48+
- name: Ubuntu GCC PPC
49+
os: ubuntu-latest
50+
compiler: powerpc-linux-gnu-gcc
51+
configure-args: --warn --static
52+
chost: powerpc-linux-gnu
53+
packages: qemu qemu-user gcc-powerpc-linux-gnu libc-dev-powerpc-cross
54+
qemu-run: qemu-ppc -L /usr/powerpc-linux-gnu
55+
cflags: -static
56+
ldflags: -static
57+
58+
- name: Ubuntu GCC PPC64
59+
os: ubuntu-latest
60+
compiler: powerpc64-linux-gnu-gcc
61+
configure-args: --warn --static
62+
chost: powerpc-linux-gnu
63+
packages: qemu qemu-user gcc-powerpc64-linux-gnu libc-dev-ppc64-cross
64+
qemu-run: qemu-ppc64 -L /usr/powerpc64-linux-gnu
65+
cflags: -static
66+
ldflags: -static
67+
68+
- name: Ubuntu GCC PPC64LE
69+
os: ubuntu-latest
70+
compiler: powerpc64le-linux-gnu-gcc
71+
configure-args: --warn
72+
chost: powerpc64le-linux-gnu
73+
packages: qemu qemu-user gcc-powerpc64le-linux-gnu libc-dev-ppc64el-cross
74+
qemu-run: qemu-ppc64le -L /usr/powerpc64le-linux-gnu
75+
76+
- name: Ubuntu GCC S390X
77+
os: ubuntu-latest
78+
compiler: s390x-linux-gnu-gcc
79+
configure-args: --warn --static
80+
chost: s390x-linux-gnu
81+
packages: qemu qemu-user gcc-s390x-linux-gnu libc-dev-s390x-cross
82+
qemu-run: qemu-s390x -L /usr/s390x-linux-gnu
83+
cflags: -static
84+
ldflags: -static
85+
86+
- name: macOS GCC
87+
os: macos-latest
88+
compiler: gcc-9
89+
configure-args: --warn
90+
91+
- name: macOS Clang
92+
os: macos-latest
93+
compiler: clang
94+
configure-args: --warn
95+
96+
steps:
97+
- name: Checkout repository
98+
uses: actions/checkout@v3
99+
100+
- name: Install packages (Ubuntu)
101+
if: runner.os == 'Linux' && matrix.packages
102+
run: |
103+
sudo apt-get update
104+
sudo apt-get install -y ${{ matrix.packages }}
105+
106+
- name: Generate project files
107+
run: |
108+
[ -d ${{ matrix.build-dir || '.' }} ] || mkdir ${{ matrix.build-dir || '.' }}
109+
cd ${{ matrix.build-dir || '.' }}
110+
${{ matrix.src-dir || '.' }}/configure ${{ matrix.configure-args }}
111+
env:
112+
CC: ${{ matrix.compiler }}
113+
CFLAGS: ${{ matrix.cflags }}
114+
LDFLAGS: ${{ matrix.ldflags }}
115+
CHOST: ${{ matrix.chost }}
116+
117+
- name: Compile source code
118+
run: make -j2
119+
working-directory: ${{ matrix.build-dir }}
120+
121+
- name: Run test cases
122+
run: |
123+
make test
124+
make cover
125+
working-directory: ${{ matrix.build-dir }}
126+
env:
127+
QEMU_RUN: ${{ matrix.qemu-run }}
128+
129+
- name: Upload build errors
130+
uses: actions/upload-artifact@v3
131+
if: failure()
132+
with:
133+
name: ${{ matrix.name }} (configure)
134+
path: |
135+
${{ matrix.build-dir || '.' }}/configure.log
136+
retention-days: 7

.github/workflows/fuzz.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: OSS-Fuzz
2+
on: [pull_request]
3+
jobs:
4+
Fuzzing:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Build Fuzzers
8+
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
9+
with:
10+
oss-fuzz-project-name: 'zlib'
11+
dry-run: false
12+
13+
- name: Run Fuzzers
14+
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
15+
with:
16+
oss-fuzz-project-name: 'zlib'
17+
fuzz-seconds: 300
18+
dry-run: false
19+
20+
- name: Upload Crash
21+
uses: actions/upload-artifact@v3
22+
if: failure()
23+
with:
24+
name: artifacts
25+
path: ./out/artifacts

CMakeLists.txt

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
33

44
project(zlib C)
55

6-
set(VERSION "1.2.12")
7-
8-
option(ASM686 "Enable building i686 assembly implementation")
9-
option(AMD64 "Enable building amd64 assembly implementation")
6+
set(VERSION "1.2.13")
107

118
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
129
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
@@ -129,39 +126,6 @@ if(NOT MINGW)
129126
)
130127
endif()
131128

132-
if(CMAKE_COMPILER_IS_GNUCC)
133-
if(ASM686)
134-
set(ZLIB_ASMS contrib/asm686/match.S)
135-
elseif (AMD64)
136-
set(ZLIB_ASMS contrib/amd64/amd64-match.S)
137-
endif ()
138-
139-
if(ZLIB_ASMS)
140-
add_definitions(-DASMV)
141-
set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
142-
endif()
143-
endif()
144-
145-
if(MSVC)
146-
if(ASM686)
147-
ENABLE_LANGUAGE(ASM_MASM)
148-
set(ZLIB_ASMS
149-
contrib/masmx86/inffas32.asm
150-
contrib/masmx86/match686.asm
151-
)
152-
elseif (AMD64)
153-
ENABLE_LANGUAGE(ASM_MASM)
154-
set(ZLIB_ASMS
155-
contrib/masmx64/gvmat64.asm
156-
contrib/masmx64/inffasx64.asm
157-
)
158-
endif()
159-
160-
if(ZLIB_ASMS)
161-
add_definitions(-DASMV -DASMINF)
162-
endif()
163-
endif()
164-
165129
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
166130
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
167131
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
@@ -183,8 +147,8 @@ if(MINGW)
183147
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
184148
endif(MINGW)
185149

186-
add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
187-
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
150+
add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
151+
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
188152
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
189153
set_target_properties(zlib PROPERTIES SOVERSION 1)
190154

ChangeLog

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11

22
ChangeLog file for zlib
33

4+
Changes in 1.2.13 (13 Oct 2022)
5+
- Fix configure issue that discarded provided CC definition
6+
- Correct incorrect inputs provided to the CRC functions
7+
- Repair prototypes and exporting of new CRC functions
8+
- Fix inflateBack to detect invalid input with distances too far
9+
- Have infback() deliver all of the available output up to any error
10+
- Fix a bug when getting a gzip header extra field with inflate()
11+
- Fix bug in block type selection when Z_FIXED used
12+
- Tighten deflateBound bounds
13+
- Remove deleted assembler code references
14+
- Various portability and appearance improvements
15+
416
Changes in 1.2.12 (27 Mar 2022)
517
- Cygwin does not have _wopen(), so do not create gzopen_w() there
618
- Permit a deflateParams() parameter change as soon as possible
@@ -159,7 +171,7 @@ Changes in 1.2.7.1 (24 Mar 2013)
159171
- Fix types in contrib/minizip to match result of get_crc_table()
160172
- Simplify contrib/vstudio/vc10 with 'd' suffix
161173
- Add TOP support to win32/Makefile.msc
162-
- Suport i686 and amd64 assembler builds in CMakeLists.txt
174+
- Support i686 and amd64 assembler builds in CMakeLists.txt
163175
- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h
164176
- Add vc11 and vc12 build files to contrib/vstudio
165177
- Add gzvprintf() as an undocumented function in zlib
@@ -359,14 +371,14 @@ Changes in 1.2.5.1 (10 Sep 2011)
359371
- Use u4 type for crc_table to avoid conversion warnings
360372
- Apply casts in zlib.h to avoid conversion warnings
361373
- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
362-
- Improve inflateSync() documentation to note indeterminancy
374+
- Improve inflateSync() documentation to note indeterminacy
363375
- Add deflatePending() function to return the amount of pending output
364376
- Correct the spelling of "specification" in FAQ [Randers-Pehrson]
365377
- Add a check in configure for stdarg.h, use for gzprintf()
366378
- Check that pointers fit in ints when gzprint() compiled old style
367379
- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
368380
- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
369-
- Add debug records in assmebler code [Londer]
381+
- Add debug records in assembler code [Londer]
370382
- Update RFC references to use http://tools.ietf.org/html/... [Li]
371383
- Add --archs option, use of libtool to configure for Mac OS X [Borstel]
372384

@@ -1033,7 +1045,7 @@ Changes in 1.2.0.1 (17 March 2003)
10331045
- Include additional header file on VMS for off_t typedef
10341046
- Try to use _vsnprintf where it supplants vsprintf [Vollant]
10351047
- Add some casts in inffast.c
1036-
- Enchance comments in zlib.h on what happens if gzprintf() tries to
1048+
- Enhance comments in zlib.h on what happens if gzprintf() tries to
10371049
write more than 4095 bytes before compression
10381050
- Remove unused state from inflateBackEnd()
10391051
- Remove exit(0) from minigzip.c, example.c
@@ -1211,7 +1223,7 @@ Changes in 1.0.9 (17 Feb 1998)
12111223
- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
12121224
- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
12131225
- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
1214-
the declaration of FAR (Gilles VOllant)
1226+
the declaration of FAR (Gilles Vollant)
12151227
- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
12161228
- read_buf buf parameter of type Bytef* instead of charf*
12171229
- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
@@ -1567,7 +1579,7 @@ Changes in 0.4:
15671579
- renamed deflateOptions as deflateInit2, call one or the other but not both
15681580
- added the method parameter for deflateInit2
15691581
- added inflateInit2
1570-
- simplied considerably deflateInit and inflateInit by not supporting
1582+
- simplified considerably deflateInit and inflateInit by not supporting
15711583
user-provided history buffer. This is supported only in deflateInit2
15721584
and inflateInit2
15731585

0 commit comments

Comments
 (0)