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

deps: update zlib to upstream 926ac23 #44412

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
301 changes: 221 additions & 80 deletions deps/zlib/BUILD.gn

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions deps/zlib/DIR_METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
monorail: {
component: "Internals"
}
4 changes: 2 additions & 2 deletions deps/zlib/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version 1.2.11, January 15th, 2017
version 1.2.12, March 27th, 2022

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

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
6 changes: 2 additions & 4 deletions deps/zlib/OWNERS
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

# COMPONENT: Internals
[email protected]
[email protected]
6 changes: 5 additions & 1 deletion deps/zlib/README.chromium
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Name: zlib
Short Name: zlib
URL: http://zlib.net/
Version: 1.2.11
Version: 1.2.12.1
CPEPrefix: cpe:/a:zlib:zlib:1.2.12.1
Security Critical: yes
License: Custom license
License File: LICENSE
Expand All @@ -26,3 +27,6 @@ Local Modifications:
- Plus the changes in 'patches' folder.
- Code in contrib/ other than contrib/minizip was added to match zlib's
contributor layout.
- In sync with 1.2.12.1 develop branch.
- ZIP reader modified to allow for progress callbacks during extraction.
- ZIP reader modified to add detection of AES encrypted content.
12 changes: 5 additions & 7 deletions deps/zlib/adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
# define MOD63(a) a %= BASE
#endif

#if defined(ADLER32_SIMD_SSSE3)
#include "adler32_simd.h"
#include "x86.h"
#elif defined(ADLER32_SIMD_NEON)
#include "cpu_features.h"
#if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON)
#include "adler32_simd.h"
#endif

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

#if defined(ADLER32_SIMD_SSSE3)
if (x86_cpu_enable_ssse3 && buf && len >= 64)
if (buf != Z_NULL && len >= 64 && x86_cpu_enable_ssse3)
return adler32_simd_(adler, buf, len);
#elif defined(ADLER32_SIMD_NEON)
if (buf && len >= 64)
if (buf != Z_NULL && len >= 64)
return adler32_simd_(adler, buf, len);
#endif

Expand Down Expand Up @@ -108,7 +106,7 @@ uLong ZEXPORT adler32_z(adler, buf, len)
*/
if (buf == Z_NULL) {
if (!len) /* Assume user is calling adler32(0, NULL, 0); */
x86_check_features();
cpu_check_features();
return 1L;
}
#else
Expand Down
90 changes: 0 additions & 90 deletions deps/zlib/arm_features.c

This file was deleted.

7 changes: 7 additions & 0 deletions deps/zlib/chromeconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
#define crc32 Cr_z_crc32
#define crc32_combine Cr_z_crc32_combine
#define crc32_combine64 Cr_z_crc32_combine64
#define crc32_combine_gen64 Cr_z_crc32_combine_gen64
#define crc32_combine_gen Cr_z_crc32_combine_gen
#define crc32_combine_op Cr_z_crc32_combine_op
#define crc32_z Cr_z_crc32_z
#define deflate Cr_z_deflate
#define deflateBound Cr_z_deflateBound
Expand Down Expand Up @@ -192,4 +195,8 @@
#define arm_check_features Cr_z_arm_check_features
#define armv8_crc32_little Cr_z_armv8_crc32_little

/* Symbols added by cpu_features.c */
#define cpu_check_features Cr_z_cpu_check_features
#define x86_cpu_enable_sse2 Cr_z_x86_cpu_enable_sse2

#endif /* THIRD_PARTY_ZLIB_CHROMECONF_H_ */
35 changes: 35 additions & 0 deletions deps/zlib/contrib/bench/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
#
# Copyright 2022 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the chromium source repository LICENSE file.
#
# Given a zlib_bench executable and some data files, run zlib_bench --check
# over those data files, for all zlib types (gzip|zlib|raw) and compression
# levels 1..9 for each type. Example:
#
# check.sh ./out/Release/zlib_bench [--check-binary] ~/snappy/testdata/*
#
# The --check-binary option modifies --check output: the compressed data is
# also written to the program output.

ZLIB_BENCH="$1" && shift

CHECK_TYPE="--check"
if [[ "${1}" == "--check-binary" ]]; then
CHECK_TYPE="$1" && shift # output compressed data too
fi

DATA_FILES="$*"

echo ${ZLIB_BENCH} | grep -E "/(zlib_bench|a.out)$" > /dev/null
if [[ $? != 0 ]] || [[ -z "${DATA_FILES}" ]]; then
echo "usage: check.sh zlib_bench [--check-binary] files ..." >&2
exit 1;
fi

for type in gzip zlib raw; do
for level in $(seq 1 9); do
${ZLIB_BENCH} $type --compression $level ${CHECK_TYPE} ${DATA_FILES}
done
done
Loading