Skip to content

Commit

Permalink
deps: update zlib to upstream 8bbd6c31
Browse files Browse the repository at this point in the history
Updated as described in doc/contributing/maintaining-zlib.md.
  • Loading branch information
lpinca committed Nov 9, 2022
1 parent da44fd8 commit e10de81
Show file tree
Hide file tree
Showing 110 changed files with 18,311 additions and 3,454 deletions.
305 changes: 223 additions & 82 deletions deps/zlib/BUILD.gn

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions deps/zlib/DIR_METADATA
@@ -0,0 +1,3 @@
monorail: {
component: "Internals"
}
4 changes: 2 additions & 2 deletions deps/zlib/LICENSE
@@ -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
@@ -1,7 +1,5 @@
agl@chromium.org
cavalcantii@chromium.org
cblume@chromium.org
mtklein@chromium.org
scroggo@chromium.org

# COMPONENT: Internals
noel@chromium.org
scroggo@google.com
6 changes: 5 additions & 1 deletion deps/zlib/README.chromium
@@ -1,7 +1,8 @@
Name: zlib
Short Name: zlib
URL: http://zlib.net/
Version: 1.2.11
Version: 1.2.13
CPEPrefix: cpe:/a:zlib:zlib:1.2.13
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.13 official release
- 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
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
6 changes: 1 addition & 5 deletions deps/zlib/adler32_simd.c
@@ -1,6 +1,6 @@
/* adler32_simd.c
*
* Copyright 2017 The Chromium Authors. All rights reserved.
* Copyright 2017 The Chromium Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the Chromium source repository LICENSE file.
*
Expand Down Expand Up @@ -50,13 +50,9 @@
#define NMAX 5552

#if defined(ADLER32_SIMD_SSSE3)
#ifndef __GNUC__
#define __attribute__()
#endif

#include <tmmintrin.h>

__attribute__((target("ssse3")))
uint32_t ZLIB_INTERNAL adler32_simd_( /* SSSE3 */
uint32_t adler,
const unsigned char *buf,
Expand Down
2 changes: 1 addition & 1 deletion deps/zlib/adler32_simd.h
@@ -1,6 +1,6 @@
/* adler32_simd.h
*
* Copyright 2017 The Chromium Authors. All rights reserved.
* Copyright 2017 The Chromium Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the Chromium source repository LICENSE file.
*/
Expand Down
90 changes: 0 additions & 90 deletions deps/zlib/arm_features.c

This file was deleted.

13 changes: 0 additions & 13 deletions deps/zlib/arm_features.h

This file was deleted.

10 changes: 9 additions & 1 deletion deps/zlib/chromeconf.h
@@ -1,4 +1,4 @@
/* Copyright 2017 The Chromium Authors. All rights reserved.
/* Copyright 2017 The Chromium Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */

Expand Down 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 @@ -191,5 +194,10 @@
#define arm_cpu_enable_pmull Cr_z_arm_cpu_enable_pmull
#define arm_check_features Cr_z_arm_check_features
#define armv8_crc32_little Cr_z_armv8_crc32_little
#define armv8_crc32_pmull_little Cr_z_armv8_crc32_pmull_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_ */
6 changes: 3 additions & 3 deletions deps/zlib/compress.c
Expand Up @@ -19,7 +19,7 @@
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
Expand Down Expand Up @@ -65,7 +65,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)

/* ===========================================================================
*/
int ZEXPORT compress (dest, destLen, source, sourceLen)
int ZEXPORT compress(dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
Expand All @@ -78,7 +78,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
If the default memLevel or windowBits for deflateInit() is changed, then
this function needs to be updated.
*/
uLong ZEXPORT compressBound (sourceLen)
uLong ZEXPORT compressBound(sourceLen)
uLong sourceLen;
{
sourceLen = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
Expand Down
35 changes: 35 additions & 0 deletions deps/zlib/contrib/bench/check.sh
@@ -0,0 +1,35 @@
#!/bin/bash
#
# Copyright 2022 The Chromium Authors
# 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

0 comments on commit e10de81

Please sign in to comment.