Skip to content

Commit 8aff504

Browse files
nodejs-github-botlpinca
authored andcommitted
deps: update zlib to 1.2.13.1-motley-526382e
PR-URL: #49033 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
1 parent 6476c99 commit 8aff504

14 files changed

+62
-99
lines changed

deps/zlib/BUILD.gn

+5
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,11 @@ config("minizip_warnings") {
385385
}
386386

387387
static_library("minizip") {
388+
include_dirs = [
389+
".",
390+
"//third_party/zlib",
391+
]
392+
388393
sources = [
389394
"contrib/minizip/ioapi.c",
390395
"contrib/minizip/ioapi.h",

deps/zlib/CMakeLists.txt

+14
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ check_include_file(stddef.h HAVE_STDDEF_H)
2323

2424
option(ENABLE_SIMD_OPTIMIZATIONS "Enable all SIMD optimizations" OFF)
2525
option(ENABLE_SIMD_AVX512 "Enable SIMD AXV512 optimizations" OFF)
26+
option(USE_ZLIB_RABIN_KARP_HASH "Enable bitstream compatibility with canonical zlib" OFF)
27+
28+
if (USE_ZLIB_RABIN_KARP_HASH)
29+
add_definitions(-DUSE_ZLIB_RABIN_KARP_ROLLING_HASH)
30+
endif()
2631

2732
# TODO(cavalcantii): add support for other OSes (e.g. Android, fuchsia, osx)
2833
# and architectures (e.g. Arm).
@@ -238,3 +243,12 @@ enable_language(CXX)
238243
set(CMAKE_CXX_STANDARD 14) # workaround for older compilers (e.g. g++ 5.4).
239244
add_executable(zlib_bench contrib/bench/zlib_bench.cc)
240245
target_link_libraries(zlib_bench zlib)
246+
247+
#============================================================================
248+
# Minigzip tool
249+
#============================================================================
250+
add_executable(minizip_bin contrib/minizip/minizip.c contrib/minizip/ioapi.c
251+
contrib/minizip/ioapi.h contrib/minizip/unzip.c
252+
contrib/minizip/unzip.h contrib/minizip/zip.c contrib/minizip/zip.h
253+
)
254+
target_link_libraries(minizip_bin zlib)

deps/zlib/adler32.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
9090
return adler | (sum2 << 16);
9191
}
9292

93-
#if defined(ADLER32_SIMD_SSSE3)
93+
#if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON)
9494
/*
95-
* Use SSSE3 to compute the adler32. Since this routine can be
95+
* Use SIMD to compute the adler32. Since this function can be
9696
* freely used, check CPU features here. zlib convention is to
9797
* call adler32(0, NULL, 0), before making calls to adler32().
9898
* So this is a good early (and infrequent) place to cache CPU

deps/zlib/contrib/minizip/README.chromium

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Short Name: minizip
33
URL: https://github.com/madler/zlib/tree/master/contrib/minizip
44
Version: 1.2.12
55
License: Zlib
6+
License File: //third_party/zlib/LICENSE
67
Security Critical: yes
78
Shipped: yes
89

deps/zlib/contrib/minizip/ioapi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
#include <stdio.h>
4545
#include <stdlib.h>
46-
#include "third_party/zlib/zlib.h"
46+
#include "zlib.h"
4747

4848
#if defined(USE_FILE32API)
4949
#define fopen64 fopen

deps/zlib/contrib/minizip/mztools.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <stdio.h>
99
#include <stdlib.h>
1010
#include <string.h>
11-
#include "third_party/zlib/zlib.h"
11+
#include "zlib.h"
1212
#include "unzip.h"
1313

1414
#define READ_8(adr) ((unsigned char)*(adr))

deps/zlib/contrib/minizip/mztools.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" {
1212
#endif
1313

1414
#ifndef _ZLIB_H
15-
#include "third_party/zlib/zlib.h"
15+
#include "zlib.h"
1616
#endif
1717

1818
#include "unzip.h"

deps/zlib/contrib/minizip/unzip.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#include <stdlib.h>
6969
#include <string.h>
7070

71-
#include "third_party/zlib/zlib.h"
71+
#include "zlib.h"
7272
#include "unzip.h"
7373

7474
#ifdef STDC

deps/zlib/contrib/minizip/unzip.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extern "C" {
4848
#endif
4949

5050
#ifndef _ZLIB_H
51-
#include "third_party/zlib/zlib.h"
51+
#include "zlib.h"
5252
#endif
5353

5454
#ifndef _ZLIBIOAPI_H

deps/zlib/contrib/minizip/zip.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <stdlib.h>
2727
#include <string.h>
2828
#include <time.h>
29-
#include "third_party/zlib/zlib.h"
29+
#include "zlib.h"
3030
#include "zip.h"
3131

3232
#ifdef STDC

deps/zlib/contrib/minizip/zip.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extern "C" {
4747
//#define HAVE_BZIP2
4848

4949
#ifndef _ZLIB_H
50-
#include "third_party/zlib/zlib.h"
50+
#include "zlib.h"
5151
#endif
5252

5353
#ifndef _ZLIBIOAPI_H

deps/zlib/patches/0000-build.patch

-87
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
diff --git a/contrib/minizip/ioapi.h b/contrib/minizip/ioapi.h
2-
index 8dcbdb06e35a..c1b7a54847f5 100644
3-
--- a/contrib/minizip/ioapi.h
4-
+++ b/contrib/minizip/ioapi.h
5-
@@ -43,7 +43,7 @@
6-
7-
#include <stdio.h>
8-
#include <stdlib.h>
9-
-#include "zlib.h"
10-
+#include "third_party/zlib/zlib.h"
11-
12-
#if defined(USE_FILE32API)
13-
#define fopen64 fopen
141
diff --git a/contrib/minizip/iowin32.c b/contrib/minizip/iowin32.c
152
index 274f39eb1dd2..246ceb91a139 100644
163
--- a/contrib/minizip/iowin32.c
@@ -35,45 +22,10 @@ index 274f39eb1dd2..246ceb91a139 100644
3522

3623
voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode));
3724
uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
38-
diff --git a/contrib/minizip/mztools.c b/contrib/minizip/mztools.c
39-
index 96891c2e0b71..8bf9cca32633 100644
40-
--- a/contrib/minizip/mztools.c
41-
+++ b/contrib/minizip/mztools.c
42-
@@ -8,7 +8,7 @@
43-
#include <stdio.h>
44-
#include <stdlib.h>
45-
#include <string.h>
46-
-#include "zlib.h"
47-
+#include "third_party/zlib/zlib.h"
48-
#include "unzip.h"
49-
50-
#define READ_8(adr) ((unsigned char)*(adr))
51-
diff --git a/contrib/minizip/mztools.h b/contrib/minizip/mztools.h
52-
index a49a426ec2fc..f295ffeda6af 100644
53-
--- a/contrib/minizip/mztools.h
54-
+++ b/contrib/minizip/mztools.h
55-
@@ -12,7 +12,7 @@ extern "C" {
56-
#endif
57-
58-
#ifndef _ZLIB_H
59-
-#include "zlib.h"
60-
+#include "third_party/zlib/zlib.h"
61-
#endif
62-
63-
#include "unzip.h"
6425
diff --git a/contrib/minizip/unzip.c b/contrib/minizip/unzip.c
6526
index bcfb9416ec35..199b4723fcfc 100644
6627
--- a/contrib/minizip/unzip.c
6728
+++ b/contrib/minizip/unzip.c
68-
@@ -72,7 +72,7 @@
69-
#define NOUNCRYPT
70-
#endif
71-
72-
-#include "zlib.h"
73-
+#include "third_party/zlib/zlib.h"
74-
#include "unzip.h"
75-
76-
#ifdef STDC
7729
@@ -1705,11 +1705,6 @@ extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len)
7830

7931
pfile_in_zip_read_info->stream.avail_out = (uInt)len;
@@ -86,45 +38,6 @@ index bcfb9416ec35..199b4723fcfc 100644
8638
if ((len>pfile_in_zip_read_info->rest_read_compressed+
8739
pfile_in_zip_read_info->stream.avail_in) &&
8840
(pfile_in_zip_read_info->raw))
89-
diff --git a/contrib/minizip/unzip.h b/contrib/minizip/unzip.h
90-
index 2104e3915074..3c0143529b91 100644
91-
--- a/contrib/minizip/unzip.h
92-
+++ b/contrib/minizip/unzip.h
93-
@@ -48,7 +48,7 @@ extern "C" {
94-
#endif
95-
96-
#ifndef _ZLIB_H
97-
-#include "zlib.h"
98-
+#include "third_party/zlib/zlib.h"
99-
#endif
100-
101-
#ifndef _ZLIBIOAPI_H
102-
diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c
103-
index 44e88a9cb989..65c0c7251843 100644
104-
--- a/contrib/minizip/zip.c
105-
+++ b/contrib/minizip/zip.c
106-
@@ -26,7 +26,7 @@
107-
#include <stdlib.h>
108-
#include <string.h>
109-
#include <time.h>
110-
-#include "zlib.h"
111-
+#include "third_party/zlib/zlib.h"
112-
#include "zip.h"
113-
114-
#ifdef STDC
115-
diff --git a/contrib/minizip/zip.h b/contrib/minizip/zip.h
116-
index 8aaebb623430..8c06c0aa7bb0 100644
117-
--- a/contrib/minizip/zip.h
118-
+++ b/contrib/minizip/zip.h
119-
@@ -47,7 +47,7 @@ extern "C" {
120-
//#define HAVE_BZIP2
121-
122-
#ifndef _ZLIB_H
123-
-#include "zlib.h"
124-
+#include "third_party/zlib/zlib.h"
125-
#endif
126-
127-
#ifndef _ZLIBIOAPI_H
12841
diff --git a/gzread.c b/gzread.c
12942
index 956b91ea7d9e..832d3ef98c59 100644
13043
--- a/gzread.c
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From c43ba7a55f091c0dcbfd8d89f7a5121269ce1b81 Mon Sep 17 00:00:00 2001
2+
From: Ho Cheung <uioptt24@gmail.com>
3+
Date: Thu, 27 Jul 2023 09:47:52 +0800
4+
Subject: [PATCH] [zlib] Perform CPU feature detection for ARM inside adler32()
5+
6+
Perform CPU feature detection for ARM within adler32() to have the same
7+
behavior as x86.
8+
9+
---
10+
third_party/zlib/adler32.c | 4 ++--
11+
1 file changed, 2 insertions(+), 2 deletions(-)
12+
13+
diff --git a/third_party/zlib/adler32.c b/third_party/zlib/adler32.c
14+
index 81c584f68e233..99a294496f7eb 100644
15+
--- a/third_party/zlib/adler32.c
16+
+++ b/third_party/zlib/adler32.c
17+
@@ -90,9 +90,9 @@ uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
18+
return adler | (sum2 << 16);
19+
}
20+
21+
-#if defined(ADLER32_SIMD_SSSE3)
22+
+#if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON)
23+
/*
24+
- * Use SSSE3 to compute the adler32. Since this routine can be
25+
+ * Use SIMD to compute the adler32. Since this function can be
26+
* freely used, check CPU features here. zlib convention is to
27+
* call adler32(0, NULL, 0), before making calls to adler32().
28+
* So this is a good early (and infrequent) place to cache CPU
29+
--
30+
2.41.0.windows.3

doc/contributing/maintaining/maintaining-dependencies.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This a list of all the dependencies:
3131
* [undici 5.23.0][]
3232
* [uvwasi 0.0.16][]
3333
* [V8 11.3.244.8][]
34-
* [zlib 1.2.13.1-motley-61dc0bd][]
34+
* [zlib 1.2.13.1-motley-526382e][]
3535

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

314-
### zlib 1.2.13.1-motley-61dc0bd
314+
### zlib 1.2.13.1-motley-526382e
315315

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

0 commit comments

Comments
 (0)