Skip to content

Commit 7c625e7

Browse files
authored
CDRIVER-4624 upgrade zlib 1.2.12 to 1.2.13 (#1252)
* add zlib-1.2.13 * replace references of zlib-1.2.12 with zlib-1.2.13 * remove zlib-1.2.12
1 parent 2d27a11 commit 7c625e7

Some content is hidden

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

48 files changed

+396
-382
lines changed

.evergreen/.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
ignore:
22
- "src/libmongoc/tests/mock_server"
3-
- "src/zlib-1.2.12"
3+
- "src/zlib-1.2.13"

.evergreen/scripts/check-files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
cmake_produced = [
3939
"libbson/src/bson/bson-version.h",
4040
"libmongoc/src/mongoc/mongoc-version.h",
41-
"zlib-1.2.12/zconf.h",
41+
"zlib-1.2.13/zconf.h",
4242
]
4343

4444
for root, dirs, files in os.walk(REPO_SRC_DIR):

CMakeLists.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -316,21 +316,21 @@ if (ENABLE_MONGOC)
316316
set (SOURCE_DIR "${PROJECT_SOURCE_DIR}/")
317317

318318
set (ZLIB_SOURCES
319-
${SOURCE_DIR}/src/zlib-1.2.12/adler32.c
320-
${SOURCE_DIR}/src/zlib-1.2.12/crc32.c
321-
${SOURCE_DIR}/src/zlib-1.2.12/deflate.c
322-
${SOURCE_DIR}/src/zlib-1.2.12/infback.c
323-
${SOURCE_DIR}/src/zlib-1.2.12/inffast.c
324-
${SOURCE_DIR}/src/zlib-1.2.12/inflate.c
325-
${SOURCE_DIR}/src/zlib-1.2.12/inftrees.c
326-
${SOURCE_DIR}/src/zlib-1.2.12/trees.c
327-
${SOURCE_DIR}/src/zlib-1.2.12/zutil.c
328-
${SOURCE_DIR}/src/zlib-1.2.12/compress.c
329-
${SOURCE_DIR}/src/zlib-1.2.12/uncompr.c
330-
${SOURCE_DIR}/src/zlib-1.2.12/gzclose.c
331-
${SOURCE_DIR}/src/zlib-1.2.12/gzlib.c
332-
${SOURCE_DIR}/src/zlib-1.2.12/gzread.c
333-
${SOURCE_DIR}/src/zlib-1.2.12/gzwrite.c
319+
${SOURCE_DIR}/src/zlib-1.2.13/adler32.c
320+
${SOURCE_DIR}/src/zlib-1.2.13/crc32.c
321+
${SOURCE_DIR}/src/zlib-1.2.13/deflate.c
322+
${SOURCE_DIR}/src/zlib-1.2.13/infback.c
323+
${SOURCE_DIR}/src/zlib-1.2.13/inffast.c
324+
${SOURCE_DIR}/src/zlib-1.2.13/inflate.c
325+
${SOURCE_DIR}/src/zlib-1.2.13/inftrees.c
326+
${SOURCE_DIR}/src/zlib-1.2.13/trees.c
327+
${SOURCE_DIR}/src/zlib-1.2.13/zutil.c
328+
${SOURCE_DIR}/src/zlib-1.2.13/compress.c
329+
${SOURCE_DIR}/src/zlib-1.2.13/uncompr.c
330+
${SOURCE_DIR}/src/zlib-1.2.13/gzclose.c
331+
${SOURCE_DIR}/src/zlib-1.2.13/gzlib.c
332+
${SOURCE_DIR}/src/zlib-1.2.13/gzread.c
333+
${SOURCE_DIR}/src/zlib-1.2.13/gzwrite.c
334334
)
335335

336336
set (MONGOC_ENABLE_ICU 0)

src/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
add_subdirectory (tools)
55

66
# zconf.h is generated by configure_file() in the parent CMakeLists.txt
7-
extra_dist_generated (zlib-1.2.12/zconf.h)
7+
extra_dist_generated (zlib-1.2.13/zconf.h)
88
set (src_zlib_DIST
9-
src/zlib-1.2.12/crc32.h
10-
src/zlib-1.2.12/deflate.h
11-
src/zlib-1.2.12/gzguts.h
12-
src/zlib-1.2.12/inffast.h
13-
src/zlib-1.2.12/inffixed.h
14-
src/zlib-1.2.12/inflate.h
15-
src/zlib-1.2.12/inftrees.h
16-
src/zlib-1.2.12/trees.h
17-
src/zlib-1.2.12/zconf.h.in
18-
src/zlib-1.2.12/zlib.h
19-
src/zlib-1.2.12/zutil.h
9+
src/zlib-1.2.13/crc32.h
10+
src/zlib-1.2.13/deflate.h
11+
src/zlib-1.2.13/gzguts.h
12+
src/zlib-1.2.13/inffast.h
13+
src/zlib-1.2.13/inffixed.h
14+
src/zlib-1.2.13/inflate.h
15+
src/zlib-1.2.13/inftrees.h
16+
src/zlib-1.2.13/trees.h
17+
src/zlib-1.2.13/zconf.h.in
18+
src/zlib-1.2.13/zlib.h
19+
src/zlib-1.2.13/zutil.h
2020
)
2121
# Strip leading directory components to make the paths relative for MakeDist.
2222
# The ZLIB_SOURCES list is set in the top-level CMakeLists.txt.

src/libmongoc/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ endif ()
4848
# Copy zconf.h.in to zconf.h; even when using system zlib, the 'dist' target
4949
# will look for zconf.h in that location.
5050
configure_file (
51-
"${SOURCE_DIR}/src/zlib-1.2.12/zconf.h.in"
52-
"${CMAKE_BINARY_DIR}/src/zlib-1.2.12/zconf.h"
51+
"${SOURCE_DIR}/src/zlib-1.2.13/zconf.h.in"
52+
"${CMAKE_BINARY_DIR}/src/zlib-1.2.13/zconf.h"
5353
COPYONLY
5454
)
5555
set (ZLIB_INCLUDE_DIRS "")
@@ -80,17 +80,17 @@ if ( (ENABLE_ZLIB STREQUAL "BUNDLED")
8080
# This tells the bundled zlib where to find its generated headers
8181
target_include_directories (zlib_obj
8282
BEFORE PUBLIC
83-
"${SOURCE_DIR}/src/zlib-1.2.12"
84-
"${CMAKE_BINARY_DIR}/src/zlib-1.2.12"
83+
"${SOURCE_DIR}/src/zlib-1.2.13"
84+
"${CMAKE_BINARY_DIR}/src/zlib-1.2.13"
8585
)
8686
# Disable all warnings for compiling Zlib
8787
target_compile_options (zlib_obj PRIVATE -w)
8888
set (SOURCES ${SOURCES} $<TARGET_OBJECTS:zlib_obj>)
8989
# This tells mongoc_shared/mongoc_static where to find generated zlib headers
9090
set (
9191
ZLIB_INCLUDE_DIRS
92-
"${SOURCE_DIR}/src/zlib-1.2.12"
93-
"${CMAKE_BINARY_DIR}/src/zlib-1.2.12"
92+
"${SOURCE_DIR}/src/zlib-1.2.13"
93+
"${CMAKE_BINARY_DIR}/src/zlib-1.2.13"
9494
)
9595
endif ()
9696

src/zlib-1.2.12/zlib.3.pdf

-8.64 KB
Binary file not shown.

src/zlib-1.2.12/CMakeLists.txt renamed to src/zlib-1.2.13/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

src/zlib-1.2.12/ChangeLog renamed to src/zlib-1.2.13/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

File renamed without changes.
File renamed without changes.

src/zlib-1.2.12/Makefile.in renamed to src/zlib-1.2.13/Makefile.in

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
# Normally configure builds both a static and a shared library.
88
# If you want to build just a static library, use: ./configure --static
99

10-
# To use the asm code, type:
11-
# cp contrib/asm?86/match.S ./match.S
12-
# make LOC=-DASMV OBJA=match.o
13-
1410
# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
1511
# make install
1612
# To install in $HOME instead of /usr/local, use:
@@ -26,13 +22,13 @@ CFLAGS=-O
2622

2723
SFLAGS=-O
2824
LDFLAGS=
29-
TEST_LDFLAGS=-L. libz.a
25+
TEST_LDFLAGS=$(LDFLAGS) -L. libz.a
3026
LDSHARED=$(CC)
3127
CPP=$(CC) -E
3228

3329
STATICLIB=libz.a
3430
SHAREDLIB=libz.so
35-
SHAREDLIBV=libz.so.1.2.12
31+
SHAREDLIBV=libz.so.1.2.13
3632
SHAREDLIBM=libz.so.1
3733
LIBS=$(STATICLIB) $(SHAREDLIBV)
3834

@@ -87,7 +83,7 @@ test: all teststatic testshared
8783

8884
teststatic: static
8985
@TMPST=tmpst_$$; \
90-
if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
86+
if echo hello world | ${QEMU_RUN} ./minigzip | ${QEMU_RUN} ./minigzip -d && ${QEMU_RUN} ./example $$TMPST ; then \
9187
echo ' *** zlib test OK ***'; \
9288
else \
9389
echo ' *** zlib test FAILED ***'; false; \
@@ -100,7 +96,7 @@ testshared: shared
10096
DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
10197
SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
10298
TMPSH=tmpsh_$$; \
103-
if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
99+
if echo hello world | ${QEMU_RUN} ./minigzipsh | ${QEMU_RUN} ./minigzipsh -d && ${QEMU_RUN} ./examplesh $$TMPSH; then \
104100
echo ' *** zlib shared test OK ***'; \
105101
else \
106102
echo ' *** zlib shared test FAILED ***'; false; \
@@ -109,7 +105,7 @@ testshared: shared
109105

110106
test64: all64
111107
@TMP64=tmp64_$$; \
112-
if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
108+
if echo hello world | ${QEMU_RUN} ./minigzip64 | ${QEMU_RUN} ./minigzip64 -d && ${QEMU_RUN} ./example64 $$TMP64; then \
113109
echo ' *** zlib 64-bit test OK ***'; \
114110
else \
115111
echo ' *** zlib 64-bit test FAILED ***'; false; \
@@ -124,7 +120,7 @@ infcover: infcover.o libz.a
124120

125121
cover: infcover
126122
rm -f *.gcda
127-
./infcover
123+
${QEMU_RUN} ./infcover
128124
gcov inf*.c
129125

130126
libz.a: $(OBJS)
@@ -292,10 +288,10 @@ minigzip$(EXE): minigzip.o $(STATICLIB)
292288
$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
293289

294290
examplesh$(EXE): example.o $(SHAREDLIBV)
295-
$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
291+
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV)
296292

297293
minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
298-
$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
294+
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV)
299295

300296
example64$(EXE): example64.o $(STATICLIB)
301297
$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)

src/zlib-1.2.12/README renamed to src/zlib-1.2.13/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ZLIB DATA COMPRESSION LIBRARY
22

3-
zlib 1.2.12 is a general purpose data compression library. All the code is
3+
zlib 1.2.13 is a general purpose data compression library. All the code is
44
thread safe. The data format used by the zlib library is described by RFCs
55
(Request for Comments) 1950 to 1952 in the files
66
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
@@ -31,7 +31,7 @@ Mark Nelson <[email protected]> wrote an article about zlib for the Jan. 1997
3131
issue of Dr. Dobb's Journal; a copy of the article is available at
3232
http://marknelson.us/1997/01/01/zlib-engine/ .
3333

34-
The changes made in version 1.2.12 are documented in the file ChangeLog.
34+
The changes made in version 1.2.13 are documented in the file ChangeLog.
3535

3636
Unsupported third party contributions are provided in directory contrib/ .
3737

File renamed without changes.

src/zlib-1.2.12/compress.c renamed to src/zlib-1.2.13/compress.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
2020
Z_STREAM_ERROR if the level parameter is invalid.
2121
*/
22-
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
22+
int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
2323
Bytef *dest;
2424
uLongf *destLen;
2525
const Bytef *source;
@@ -65,7 +65,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
6565

6666
/* ===========================================================================
6767
*/
68-
int ZEXPORT compress (dest, destLen, source, sourceLen)
68+
int ZEXPORT compress(dest, destLen, source, sourceLen)
6969
Bytef *dest;
7070
uLongf *destLen;
7171
const Bytef *source;
@@ -78,7 +78,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
7878
If the default memLevel or windowBits for deflateInit() is changed, then
7979
this function needs to be updated.
8080
*/
81-
uLong ZEXPORT compressBound (sourceLen)
81+
uLong ZEXPORT compressBound(sourceLen)
8282
uLong sourceLen;
8383
{
8484
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +

0 commit comments

Comments
 (0)