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 1.2.13.1-motley-526382e #49033

Closed
wants to merge 1 commit 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
5 changes: 5 additions & 0 deletions deps/zlib/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@ config("minizip_warnings") {
}

static_library("minizip") {
include_dirs = [
".",
"//third_party/zlib",
]

sources = [
"contrib/minizip/ioapi.c",
"contrib/minizip/ioapi.h",
Expand Down
14 changes: 14 additions & 0 deletions deps/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ check_include_file(stddef.h HAVE_STDDEF_H)

option(ENABLE_SIMD_OPTIMIZATIONS "Enable all SIMD optimizations" OFF)
option(ENABLE_SIMD_AVX512 "Enable SIMD AXV512 optimizations" OFF)
option(USE_ZLIB_RABIN_KARP_HASH "Enable bitstream compatibility with canonical zlib" OFF)

if (USE_ZLIB_RABIN_KARP_HASH)
add_definitions(-DUSE_ZLIB_RABIN_KARP_ROLLING_HASH)
endif()

# TODO(cavalcantii): add support for other OSes (e.g. Android, fuchsia, osx)
# and architectures (e.g. Arm).
Expand Down Expand Up @@ -238,3 +243,12 @@ enable_language(CXX)
set(CMAKE_CXX_STANDARD 14) # workaround for older compilers (e.g. g++ 5.4).
add_executable(zlib_bench contrib/bench/zlib_bench.cc)
target_link_libraries(zlib_bench zlib)

#============================================================================
# Minigzip tool
#============================================================================
add_executable(minizip_bin contrib/minizip/minizip.c contrib/minizip/ioapi.c
contrib/minizip/ioapi.h contrib/minizip/unzip.c
contrib/minizip/unzip.h contrib/minizip/zip.c contrib/minizip/zip.h
)
target_link_libraries(minizip_bin zlib)
4 changes: 2 additions & 2 deletions deps/zlib/adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
return adler | (sum2 << 16);
}

#if defined(ADLER32_SIMD_SSSE3)
#if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON)
/*
* Use SSSE3 to compute the adler32. Since this routine can be
* Use SIMD to compute the adler32. Since this function can be
* freely used, check CPU features here. zlib convention is to
* call adler32(0, NULL, 0), before making calls to adler32().
* So this is a good early (and infrequent) place to cache CPU
Expand Down
1 change: 1 addition & 0 deletions deps/zlib/contrib/minizip/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Short Name: minizip
URL: https://github.com/madler/zlib/tree/master/contrib/minizip
Version: 1.2.12
License: Zlib
License File: //third_party/zlib/LICENSE
Security Critical: yes
Shipped: yes

Expand Down
2 changes: 1 addition & 1 deletion deps/zlib/contrib/minizip/ioapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

#include <stdio.h>
#include <stdlib.h>
#include "third_party/zlib/zlib.h"
#include "zlib.h"

#if defined(USE_FILE32API)
#define fopen64 fopen
Expand Down
2 changes: 1 addition & 1 deletion deps/zlib/contrib/minizip/mztools.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "third_party/zlib/zlib.h"
#include "zlib.h"
#include "unzip.h"

#define READ_8(adr) ((unsigned char)*(adr))
Expand Down
2 changes: 1 addition & 1 deletion deps/zlib/contrib/minizip/mztools.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {
#endif

#ifndef _ZLIB_H
#include "third_party/zlib/zlib.h"
#include "zlib.h"
#endif

#include "unzip.h"
Expand Down
2 changes: 1 addition & 1 deletion deps/zlib/contrib/minizip/unzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#include <stdlib.h>
#include <string.h>

#include "third_party/zlib/zlib.h"
#include "zlib.h"
#include "unzip.h"

#ifdef STDC
Expand Down
2 changes: 1 addition & 1 deletion deps/zlib/contrib/minizip/unzip.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern "C" {
#endif

#ifndef _ZLIB_H
#include "third_party/zlib/zlib.h"
#include "zlib.h"
#endif

#ifndef _ZLIBIOAPI_H
Expand Down
2 changes: 1 addition & 1 deletion deps/zlib/contrib/minizip/zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "third_party/zlib/zlib.h"
#include "zlib.h"
#include "zip.h"

#ifdef STDC
Expand Down
2 changes: 1 addition & 1 deletion deps/zlib/contrib/minizip/zip.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extern "C" {
//#define HAVE_BZIP2

#ifndef _ZLIB_H
#include "third_party/zlib/zlib.h"
#include "zlib.h"
#endif

#ifndef _ZLIBIOAPI_H
Expand Down
87 changes: 0 additions & 87 deletions deps/zlib/patches/0000-build.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
diff --git a/contrib/minizip/ioapi.h b/contrib/minizip/ioapi.h
index 8dcbdb06e35a..c1b7a54847f5 100644
--- a/contrib/minizip/ioapi.h
+++ b/contrib/minizip/ioapi.h
@@ -43,7 +43,7 @@

#include <stdio.h>
#include <stdlib.h>
-#include "zlib.h"
+#include "third_party/zlib/zlib.h"

#if defined(USE_FILE32API)
#define fopen64 fopen
diff --git a/contrib/minizip/iowin32.c b/contrib/minizip/iowin32.c
index 274f39eb1dd2..246ceb91a139 100644
--- a/contrib/minizip/iowin32.c
Expand All @@ -35,45 +22,10 @@ index 274f39eb1dd2..246ceb91a139 100644

voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode));
uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
diff --git a/contrib/minizip/mztools.c b/contrib/minizip/mztools.c
index 96891c2e0b71..8bf9cca32633 100644
--- a/contrib/minizip/mztools.c
+++ b/contrib/minizip/mztools.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "zlib.h"
+#include "third_party/zlib/zlib.h"
#include "unzip.h"

#define READ_8(adr) ((unsigned char)*(adr))
diff --git a/contrib/minizip/mztools.h b/contrib/minizip/mztools.h
index a49a426ec2fc..f295ffeda6af 100644
--- a/contrib/minizip/mztools.h
+++ b/contrib/minizip/mztools.h
@@ -12,7 +12,7 @@ extern "C" {
#endif

#ifndef _ZLIB_H
-#include "zlib.h"
+#include "third_party/zlib/zlib.h"
#endif

#include "unzip.h"
diff --git a/contrib/minizip/unzip.c b/contrib/minizip/unzip.c
index bcfb9416ec35..199b4723fcfc 100644
--- a/contrib/minizip/unzip.c
+++ b/contrib/minizip/unzip.c
@@ -72,7 +72,7 @@
#define NOUNCRYPT
#endif

-#include "zlib.h"
+#include "third_party/zlib/zlib.h"
#include "unzip.h"

#ifdef STDC
@@ -1705,11 +1705,6 @@ extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len)

pfile_in_zip_read_info->stream.avail_out = (uInt)len;
Expand All @@ -86,45 +38,6 @@ index bcfb9416ec35..199b4723fcfc 100644
if ((len>pfile_in_zip_read_info->rest_read_compressed+
pfile_in_zip_read_info->stream.avail_in) &&
(pfile_in_zip_read_info->raw))
diff --git a/contrib/minizip/unzip.h b/contrib/minizip/unzip.h
index 2104e3915074..3c0143529b91 100644
--- a/contrib/minizip/unzip.h
+++ b/contrib/minizip/unzip.h
@@ -48,7 +48,7 @@ extern "C" {
#endif

#ifndef _ZLIB_H
-#include "zlib.h"
+#include "third_party/zlib/zlib.h"
#endif

#ifndef _ZLIBIOAPI_H
diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c
index 44e88a9cb989..65c0c7251843 100644
--- a/contrib/minizip/zip.c
+++ b/contrib/minizip/zip.c
@@ -26,7 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "zlib.h"
+#include "third_party/zlib/zlib.h"
#include "zip.h"

#ifdef STDC
diff --git a/contrib/minizip/zip.h b/contrib/minizip/zip.h
index 8aaebb623430..8c06c0aa7bb0 100644
--- a/contrib/minizip/zip.h
+++ b/contrib/minizip/zip.h
@@ -47,7 +47,7 @@ extern "C" {
//#define HAVE_BZIP2

#ifndef _ZLIB_H
-#include "zlib.h"
+#include "third_party/zlib/zlib.h"
#endif

#ifndef _ZLIBIOAPI_H
diff --git a/gzread.c b/gzread.c
index 956b91ea7d9e..832d3ef98c59 100644
--- a/gzread.c
Expand Down
30 changes: 30 additions & 0 deletions deps/zlib/patches/0013-cpu-feature-detection-for-arm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From c43ba7a55f091c0dcbfd8d89f7a5121269ce1b81 Mon Sep 17 00:00:00 2001
From: Ho Cheung <uioptt24@gmail.com>
Date: Thu, 27 Jul 2023 09:47:52 +0800
Subject: [PATCH] [zlib] Perform CPU feature detection for ARM inside adler32()

Perform CPU feature detection for ARM within adler32() to have the same
behavior as x86.

---
third_party/zlib/adler32.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/third_party/zlib/adler32.c b/third_party/zlib/adler32.c
index 81c584f68e233..99a294496f7eb 100644
--- a/third_party/zlib/adler32.c
+++ b/third_party/zlib/adler32.c
@@ -90,9 +90,9 @@ uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
return adler | (sum2 << 16);
}

-#if defined(ADLER32_SIMD_SSSE3)
+#if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON)
/*
- * Use SSSE3 to compute the adler32. Since this routine can be
+ * Use SIMD to compute the adler32. Since this function can be
* freely used, check CPU features here. zlib convention is to
* call adler32(0, NULL, 0), before making calls to adler32().
* So this is a good early (and infrequent) place to cache CPU
--
2.41.0.windows.3
6 changes: 3 additions & 3 deletions doc/contributing/maintaining/maintaining-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This a list of all the dependencies:
* [undici 5.22.1][]
* [uvwasi 0.0.16][]
* [V8 11.3.244.8][]
* [zlib 1.2.13.1-motley-61dc0bd][]
* [zlib 1.2.13.1-motley-526382e][]

Any code which meets one or more of these conditions should
be managed as a dependency:
Expand Down Expand Up @@ -311,7 +311,7 @@ See [maintaining-web-assembly][] for more informations.
high-performance JavaScript and WebAssembly engine, written in C++.
See [maintaining-V8][] for more informations.

### zlib 1.2.13.1-motley-61dc0bd
### zlib 1.2.13.1-motley-526382e

The [zlib](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/zlib)
dependency lossless data-compression library,
Expand Down Expand Up @@ -349,4 +349,4 @@ performance improvements not currently available in standard zlib.
[update-openssl-action]: ../../../.github/workflows/update-openssl.yml
[uvwasi 0.0.16]: #uvwasi-0016
[v8 11.3.244.8]: #v8-1132448
[zlib 1.2.13.1-motley-61dc0bd]: #zlib-12131-motley-61dc0bd
[zlib 1.2.13.1-motley-526382e]: #zlib-12131-motley-526382e
Loading