Skip to content

Commit 27ea887

Browse files
committed
deps: update zlib to upstream 8bbd6c31
Updated as described in doc/contributing/maintaining-zlib.md.
1 parent da44fd8 commit 27ea887

File tree

110 files changed

+18312
-3455
lines changed

Some content is hidden

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

110 files changed

+18312
-3455
lines changed

deps/zlib/BUILD.gn

+223-82
Large diffs are not rendered by default.

deps/zlib/DIR_METADATA

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
monorail: {
2+
component: "Internals"
3+
}

deps/zlib/LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
version 1.2.11, January 15th, 2017
1+
version 1.2.12, March 27th, 2022
22

3-
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
3+
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
44

55
This software is provided 'as-is', without any express or implied
66
warranty. In no event will the authors be held liable for any damages

deps/zlib/OWNERS

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
22
33
4-
5-
6-
7-
# COMPONENT: Internals
4+
5+

deps/zlib/README.chromium

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Name: zlib
22
Short Name: zlib
33
URL: http://zlib.net/
4-
Version: 1.2.11
4+
Version: 1.2.13
5+
CPEPrefix: cpe:/a:zlib:zlib:1.2.13
56
Security Critical: yes
67
License: Custom license
78
License File: LICENSE
@@ -26,3 +27,6 @@ Local Modifications:
2627
- Plus the changes in 'patches' folder.
2728
- Code in contrib/ other than contrib/minizip was added to match zlib's
2829
contributor layout.
30+
- In sync with 1.2.13 official release
31+
- ZIP reader modified to allow for progress callbacks during extraction.
32+
- ZIP reader modified to add detection of AES encrypted content.

deps/zlib/adler32.c

+5-7
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
5959
# define MOD63(a) a %= BASE
6060
#endif
6161

62-
#if defined(ADLER32_SIMD_SSSE3)
63-
#include "adler32_simd.h"
64-
#include "x86.h"
65-
#elif defined(ADLER32_SIMD_NEON)
62+
#include "cpu_features.h"
63+
#if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON)
6664
#include "adler32_simd.h"
6765
#endif
6866

@@ -76,10 +74,10 @@ uLong ZEXPORT adler32_z(adler, buf, len)
7674
unsigned n;
7775

7876
#if defined(ADLER32_SIMD_SSSE3)
79-
if (x86_cpu_enable_ssse3 && buf && len >= 64)
77+
if (buf != Z_NULL && len >= 64 && x86_cpu_enable_ssse3)
8078
return adler32_simd_(adler, buf, len);
8179
#elif defined(ADLER32_SIMD_NEON)
82-
if (buf && len >= 64)
80+
if (buf != Z_NULL && len >= 64)
8381
return adler32_simd_(adler, buf, len);
8482
#endif
8583

@@ -108,7 +106,7 @@ uLong ZEXPORT adler32_z(adler, buf, len)
108106
*/
109107
if (buf == Z_NULL) {
110108
if (!len) /* Assume user is calling adler32(0, NULL, 0); */
111-
x86_check_features();
109+
cpu_check_features();
112110
return 1L;
113111
}
114112
#else

deps/zlib/adler32_simd.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* adler32_simd.c
22
*
3-
* Copyright 2017 The Chromium Authors. All rights reserved.
3+
* Copyright 2017 The Chromium Authors
44
* Use of this source code is governed by a BSD-style license that can be
55
* found in the Chromium source repository LICENSE file.
66
*
@@ -50,13 +50,9 @@
5050
#define NMAX 5552
5151

5252
#if defined(ADLER32_SIMD_SSSE3)
53-
#ifndef __GNUC__
54-
#define __attribute__()
55-
#endif
5653

5754
#include <tmmintrin.h>
5855

59-
__attribute__((target("ssse3")))
6056
uint32_t ZLIB_INTERNAL adler32_simd_( /* SSSE3 */
6157
uint32_t adler,
6258
const unsigned char *buf,

deps/zlib/adler32_simd.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* adler32_simd.h
22
*
3-
* Copyright 2017 The Chromium Authors. All rights reserved.
3+
* Copyright 2017 The Chromium Authors
44
* Use of this source code is governed by a BSD-style license that can be
55
* found in the Chromium source repository LICENSE file.
66
*/

deps/zlib/arm_features.c

-90
This file was deleted.

deps/zlib/arm_features.h

-13
This file was deleted.

deps/zlib/chromeconf.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2017 The Chromium Authors. All rights reserved.
1+
/* Copyright 2017 The Chromium Authors
22
* Use of this source code is governed by a BSD-style license that can be
33
* found in the LICENSE file. */
44

@@ -49,6 +49,9 @@
4949
#define crc32 Cr_z_crc32
5050
#define crc32_combine Cr_z_crc32_combine
5151
#define crc32_combine64 Cr_z_crc32_combine64
52+
#define crc32_combine_gen64 Cr_z_crc32_combine_gen64
53+
#define crc32_combine_gen Cr_z_crc32_combine_gen
54+
#define crc32_combine_op Cr_z_crc32_combine_op
5255
#define crc32_z Cr_z_crc32_z
5356
#define deflate Cr_z_deflate
5457
#define deflateBound Cr_z_deflateBound
@@ -191,5 +194,10 @@
191194
#define arm_cpu_enable_pmull Cr_z_arm_cpu_enable_pmull
192195
#define arm_check_features Cr_z_arm_check_features
193196
#define armv8_crc32_little Cr_z_armv8_crc32_little
197+
#define armv8_crc32_pmull_little Cr_z_armv8_crc32_pmull_little
198+
199+
/* Symbols added by cpu_features.c */
200+
#define cpu_check_features Cr_z_cpu_check_features
201+
#define x86_cpu_enable_sse2 Cr_z_x86_cpu_enable_sse2
194202

195203
#endif /* THIRD_PARTY_ZLIB_CHROMECONF_H_ */

deps/zlib/compress.c

+3-3
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
sourceLen = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +

deps/zlib/contrib/bench/check.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
#
3+
# Copyright 2022 The Chromium Authors
4+
# Use of this source code is governed by a BSD-style license that can be
5+
# found in the chromium source repository LICENSE file.
6+
#
7+
# Given a zlib_bench executable and some data files, run zlib_bench --check
8+
# over those data files, for all zlib types (gzip|zlib|raw) and compression
9+
# levels 1..9 for each type. Example:
10+
#
11+
# check.sh ./out/Release/zlib_bench [--check-binary] ~/snappy/testdata/*
12+
#
13+
# The --check-binary option modifies --check output: the compressed data is
14+
# also written to the program output.
15+
16+
ZLIB_BENCH="$1" && shift
17+
18+
CHECK_TYPE="--check"
19+
if [[ "${1}" == "--check-binary" ]]; then
20+
CHECK_TYPE="$1" && shift # output compressed data too
21+
fi
22+
23+
DATA_FILES="$*"
24+
25+
echo ${ZLIB_BENCH} | grep -E "/(zlib_bench|a.out)$" > /dev/null
26+
if [[ $? != 0 ]] || [[ -z "${DATA_FILES}" ]]; then
27+
echo "usage: check.sh zlib_bench [--check-binary] files ..." >&2
28+
exit 1;
29+
fi
30+
31+
for type in gzip zlib raw; do
32+
for level in $(seq 1 9); do
33+
${ZLIB_BENCH} $type --compression $level ${CHECK_TYPE} ${DATA_FILES}
34+
done
35+
done

0 commit comments

Comments
 (0)