Skip to content

Commit 668805a

Browse files
meteorcloudysgowroji
authored andcommitted
Upgrade zlib to 1.2.12
Partial commit for third_party/*, see bazelbuild#15497. Signed-off-by: Sunil Gowroji <[email protected]>
1 parent 43cb21a commit 668805a

Some content is hidden

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

72 files changed

+12197
-1713
lines changed

third_party/zlib/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
33

44
project(zlib C)
55

6-
set(VERSION "1.2.11")
6+
set(VERSION "1.2.12")
77

88
option(ASM686 "Enable building i686 assembly implementation")
99
option(AMD64 "Enable building amd64 assembly implementation")

third_party/zlib/ChangeLog

+112-49
Large diffs are not rendered by default.

third_party/zlib/Makefile.in

+8-10
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ CPP=$(CC) -E
3232

3333
STATICLIB=libz.a
3434
SHAREDLIB=libz.so
35-
SHAREDLIBV=libz.so.1.2.11
35+
SHAREDLIBV=libz.so.1.2.12
3636
SHAREDLIBM=libz.so.1
3737
LIBS=$(STATICLIB) $(SHAREDLIBV)
3838

@@ -91,8 +91,8 @@ teststatic: static
9191
echo ' *** zlib test OK ***'; \
9292
else \
9393
echo ' *** zlib test FAILED ***'; false; \
94-
fi; \
95-
rm -f $$TMPST
94+
fi
95+
@rm -f tmpst_$$
9696

9797
testshared: shared
9898
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
@@ -104,17 +104,17 @@ testshared: shared
104104
echo ' *** zlib shared test OK ***'; \
105105
else \
106106
echo ' *** zlib shared test FAILED ***'; false; \
107-
fi; \
108-
rm -f $$TMPSH
107+
fi
108+
@rm -f tmpsh_$$
109109

110110
test64: all64
111111
@TMP64=tmp64_$$; \
112112
if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
113113
echo ' *** zlib 64-bit test OK ***'; \
114114
else \
115115
echo ' *** zlib 64-bit test FAILED ***'; false; \
116-
fi; \
117-
rm -f $$TMP64
116+
fi
117+
@rm -f tmp64_$$
118118

119119
infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
120120
$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
@@ -376,15 +376,13 @@ clean:
376376
rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
377377

378378
maintainer-clean: distclean
379-
distclean: clean zconf zconf.h.cmakein docs
379+
distclean: clean zconf zconf.h.cmakein
380380
rm -f Makefile zlib.pc configure.log
381381
-@rm -f .DS_Store
382382
@if [ -f Makefile.in ]; then \
383383
printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
384384
printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
385385
touch -r $(SRCDIR)Makefile.in Makefile ; fi
386-
@if [ ! -f zconf.h.in ]; then rm -f zconf.h zconf.h.cmakein ; fi
387-
@if [ ! -f zlib.3 ]; then rm -f zlib.3.pdf ; fi
388386

389387
tags:
390388
etags $(SRCDIR)*.[ch]

third_party/zlib/README

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ZLIB DATA COMPRESSION LIBRARY
22

3-
zlib 1.2.11 is a general purpose data compression library. All the code is
3+
zlib 1.2.12 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.11 are documented in the file ChangeLog.
34+
The changes made in version 1.2.12 are documented in the file ChangeLog.
3535

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

@@ -84,7 +84,7 @@ Acknowledgments:
8484

8585
Copyright notice:
8686

87-
(C) 1995-2017 Jean-loup Gailly and Mark Adler
87+
(C) 1995-2022 Jean-loup Gailly and Mark Adler
8888

8989
This software is provided 'as-is', without any express or implied
9090
warranty. In no event will the authors be held liable for any damages
@@ -108,7 +108,10 @@ Copyright notice:
108108
If you use the zlib library in a product, we would appreciate *not* receiving
109109
lengthy legal documents to sign. The sources are provided for free but without
110110
warranty of any kind. The library has been entirely written by Jean-loup
111-
Gailly and Mark Adler; it does not include third-party code.
111+
Gailly and Mark Adler; it does not include third-party code. We make all
112+
contributions to and distributions of this project solely in our personal
113+
capacity, and are not conveying any rights to any intellectual property of
114+
any third parties.
112115

113116
If you redistribute modified sources, we would appreciate that you include in
114117
the file ChangeLog history information documenting your changes. Please read

third_party/zlib/configure

+27-21
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ build64=0
8787
gcc=0
8888
warn=0
8989
debug=0
90+
sanitize=0
9091
old_cc="$CC"
9192
old_cflags="$CFLAGS"
9293
OBJC='$(OBJZ) $(OBJG)'
@@ -137,6 +138,7 @@ case "$1" in
137138
-c* | --const) zconst=1; shift ;;
138139
-w* | --warn) warn=1; shift ;;
139140
-d* | --debug) debug=1; shift ;;
141+
--sanitize) sanitize=1; shift ;;
140142
*)
141143
echo "unknown option: $1" | tee -a configure.log
142144
echo "$0 --help for help" | tee -a configure.log
@@ -165,8 +167,14 @@ extern int getchar();
165167
int hello() {return getchar();}
166168
EOF
167169

168-
test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
169-
cc=${CC-${CROSS_PREFIX}gcc}
170+
if test -z "$CC"; then
171+
echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
172+
if ${CROSS_PREFIX}gcc -v >/dev/null 2>&1; then
173+
cc=${CROSS_PREFIX}gcc
174+
else
175+
cc=${CROSS_PREFIX}cc
176+
fi
177+
fi
170178
cflags=${CFLAGS-"-O3"}
171179
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
172180
case "$cc" in
@@ -199,6 +207,9 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
199207
CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
200208
fi
201209
fi
210+
if test $sanitize -eq 1; then
211+
CFLAGS="${CFLAGS} -fsanitize=address"
212+
fi
202213
if test $debug -eq 1; then
203214
CFLAGS="${CFLAGS} -DZLIB_DEBUG"
204215
SFLAGS="${SFLAGS} -DZLIB_DEBUG"
@@ -367,8 +378,11 @@ else
367378
try()
368379
{
369380
show $*
370-
( $* ) >> configure.log 2>&1
381+
got=`( $* ) 2>&1`
371382
ret=$?
383+
if test "$got" != ""; then
384+
printf "%s\n" "$got" >> configure.log
385+
fi
372386
if test $ret -ne 0; then
373387
echo "(exit code "$ret")" >> configure.log
374388
fi
@@ -381,8 +395,11 @@ tryboth()
381395
show $*
382396
got=`( $* ) 2>&1`
383397
ret=$?
384-
printf %s "$got" >> configure.log
398+
if test "$got" != ""; then
399+
printf "%s\n" "$got" >> configure.log
400+
fi
385401
if test $ret -ne 0; then
402+
echo "(exit code "$ret")" >> configure.log
386403
return $ret
387404
fi
388405
test "$got" = ""
@@ -457,17 +474,11 @@ size_t dummy = 0;
457474
EOF
458475
if try $CC -c $CFLAGS $test.c; then
459476
echo "Checking for size_t... Yes." | tee -a configure.log
460-
need_sizet=0
461477
else
462478
echo "Checking for size_t... No." | tee -a configure.log
463-
need_sizet=1
464-
fi
465-
466-
echo >> configure.log
467-
468-
# find the size_t integer type, if needed
469-
if test $need_sizet -eq 1; then
470-
cat > $test.c <<EOF
479+
# find a size_t integer type
480+
# check for long long
481+
cat > $test.c << EOF
471482
long long dummy = 0;
472483
EOF
473484
if try $CC -c $CFLAGS $test.c; then
@@ -495,17 +506,13 @@ EOF
495506
if try $CC $CFLAGS -o $test $test.c; then
496507
sizet=`./$test`
497508
echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
509+
CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
510+
SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
498511
else
499-
echo "Failed to find a pointer-size integer type." | tee -a configure.log
500-
leave 1
512+
echo "Checking for a pointer-size integer type... not found." | tee -a configure.log
501513
fi
502514
fi
503515

504-
if test $need_sizet -eq 1; then
505-
CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
506-
SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
507-
fi
508-
509516
echo >> configure.log
510517

511518
# check for large file support, and if none, check for fseeko()
@@ -849,7 +856,6 @@ echo SHAREDLIBV = $SHAREDLIBV >> configure.log
849856
echo STATICLIB = $STATICLIB >> configure.log
850857
echo TEST = $TEST >> configure.log
851858
echo VER = $VER >> configure.log
852-
echo Z_U4 = $Z_U4 >> configure.log
853859
echo SRCDIR = $SRCDIR >> configure.log
854860
echo exec_prefix = $exec_prefix >> configure.log
855861
echo includedir = $includedir >> configure.log

third_party/zlib/contrib/README.contrib

-21
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ ada/ by Dmitriy Anisimkov <[email protected]>
88
Support for Ada
99
See http://zlib-ada.sourceforge.net/
1010

11-
amd64/ by Mikhail Teterin <[email protected]>
12-
asm code for AMD64
13-
See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393
14-
15-
asm686/ by Brian Raiter <[email protected]>
16-
asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax
17-
See http://www.muppetlabs.com/~breadbox/software/assembly.html
18-
1911
blast/ by Mark Adler <[email protected]>
2012
Decompressor for output of PKWare Data Compression Library (DCL)
2113

@@ -32,9 +24,6 @@ gcc_gvmat64/by Gilles Vollant <[email protected]>
3224
infback9/ by Mark Adler <[email protected]>
3325
Unsupported diffs to infback to decode the deflate64 format
3426

35-
inflate86/ by Chris Anderson <[email protected]>
36-
Tuned x86 gcc asm code to replace inflate_fast()
37-
3827
iostream/ by Kevin Ruland <[email protected]>
3928
A C++ I/O streams interface to the zlib gz* functions
4029

@@ -45,16 +34,6 @@ iostream3/ by Ludwig Schwardt <[email protected]>
4534
and Kevin Ruland <[email protected]>
4635
Yet another C++ I/O streams interface
4736

48-
masmx64/ by Gilles Vollant <[email protected]>
49-
x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to
50-
replace longest_match() and inflate_fast(), also masm x86
51-
64-bits translation of Chris Anderson inflate_fast()
52-
53-
masmx86/ by Gilles Vollant <[email protected]>
54-
x86 asm code to replace longest_match() and inflate_fast(),
55-
for Visual C++ and MASM (32 bits).
56-
Based on Brian Raiter (asm686) and Chris Anderson (inflate86)
57-
5837
minizip/ by Gilles Vollant <[email protected]>
5938
Mini zip and unzip based on zlib
6039
Includes Zip64 support by Mathias Svensson <[email protected]>

third_party/zlib/contrib/blast/blast.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow,
5757
* use by the application to pass an input descriptor to infun(), if desired.
5858
*
5959
* If left and in are not NULL and *left is not zero when blast() is called,
60-
* then the *left bytes are *in are consumed for input before infun() is used.
60+
* then the *left bytes at *in are consumed for input before infun() is used.
6161
*
6262
* The output function is invoked: err = outfun(how, buf, len), where the bytes
6363
* to be written are buf[0..len-1]. If err is not zero, then blast() returns

third_party/zlib/contrib/delphi/ZLib.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
152152
const OutBuf: Pointer; BufSize: Integer);
153153

154154
const
155-
zlib_version = '1.2.11';
155+
zlib_version = '1.2.12';
156156

157157
type
158158
EZlibError = class(Exception);

third_party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public class InfoTests
156156
public void Info_Version()
157157
{
158158
Info info = new Info();
159-
Assert.AreEqual("1.2.11", Info.Version);
159+
Assert.AreEqual("1.2.12", Info.Version);
160160
Assert.AreEqual(32, info.SizeOfUInt);
161161
Assert.AreEqual(32, info.SizeOfULong);
162162
Assert.AreEqual(32, info.SizeOfPointer);

third_party/zlib/contrib/infback9/inftree9.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* inftree9.c -- generate Huffman trees for efficient decoding
2-
* Copyright (C) 1995-2017 Mark Adler
2+
* Copyright (C) 1995-2022 Mark Adler
33
* For conditions of distribution and use, see copyright notice in zlib.h
44
*/
55

@@ -9,7 +9,7 @@
99
#define MAXBITS 15
1010

1111
const char inflate9_copyright[] =
12-
" inflate9 1.2.11 Copyright 1995-2017 Mark Adler ";
12+
" inflate9 1.2.12 Copyright 1995-2022 Mark Adler ";
1313
/*
1414
If you use the zlib library in a product, an acknowledgment is welcome
1515
in the documentation of your product. If for some reason you cannot
@@ -64,7 +64,7 @@ unsigned short FAR *work;
6464
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
6565
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
6666
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
67-
133, 133, 133, 133, 144, 77, 202};
67+
133, 133, 133, 133, 144, 199, 202};
6868
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
6969
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
7070
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,

third_party/zlib/contrib/minizip/Makefile

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CC=cc
2-
CFLAGS=-O -I../..
2+
CFLAGS := $(CFLAGS) -O -I../..
33

44
UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
55
ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a
@@ -16,10 +16,14 @@ minizip: $(ZIP_OBJS)
1616
$(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
1717

1818
test: miniunz minizip
19-
./minizip test readme.txt
19+
@rm -f test.*
20+
@echo hello hello hello > test.txt
21+
./minizip test test.txt
2022
./miniunz -l test.zip
21-
mv readme.txt readme.old
23+
@mv test.txt test.old
2224
./miniunz test.zip
25+
@cmp test.txt test.old
26+
@rm -f test.*
2327

2428
clean:
25-
/bin/rm -f *.o *~ minizip miniunz
29+
/bin/rm -f *.o *~ minizip miniunz test.*

third_party/zlib/contrib/minizip/configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- Autoconf -*-
22
# Process this file with autoconf to produce a configure script.
33

4-
AC_INIT([minizip], [1.2.11], [bugzilla.redhat.com])
4+
AC_INIT([minizip], [1.2.12], [bugzilla.redhat.com])
55
AC_CONFIG_SRCDIR([minizip.c])
66
AM_INIT_AUTOMAKE([foreign])
77
LT_INIT

third_party/zlib/contrib/minizip/crypt.h

+10-9
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
3838
* unpredictable manner on 16-bit systems; not a problem
3939
* with any known compiler so far, though */
4040

41+
(void)pcrc_32_tab;
4142
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
4243
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
4344
}
@@ -77,24 +78,24 @@ static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t* pcr
7778
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
7879

7980
#define zencode(pkeys,pcrc_32_tab,c,t) \
80-
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
81+
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), (Byte)t^(c))
8182

8283
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
8384

8485
#define RAND_HEAD_LEN 12
8586
/* "last resort" source for second part of crypt seed pattern */
8687
# ifndef ZCR_SEED2
87-
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
88+
# define ZCR_SEED2 3141592654L /* use PI as default pattern */
8889
# endif
8990

90-
static int crypthead(const char* passwd, /* password string */
91-
unsigned char* buf, /* where to write header */
92-
int bufSize,
93-
unsigned long* pkeys,
94-
const z_crc_t* pcrc_32_tab,
95-
unsigned long crcForCrypting)
91+
static unsigned crypthead(const char* passwd, /* password string */
92+
unsigned char* buf, /* where to write header */
93+
int bufSize,
94+
unsigned long* pkeys,
95+
const z_crc_t* pcrc_32_tab,
96+
unsigned long crcForCrypting)
9697
{
97-
int n; /* index in random header */
98+
unsigned n; /* index in random header */
9899
int t; /* temporary */
99100
int c; /* random byte */
100101
unsigned char header[RAND_HEAD_LEN-2]; /* random header */

0 commit comments

Comments
 (0)