Roll zlib to 24c07df5033183efad8607cba62e746bea7180bf.
Note that Chromium's copy of zlib now has a dependency on the cpu_features library.
Change-Id: I0f2c306aa7eb0e1deb8fa4c45e4a04f1fee8bb83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359600
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
diff --git a/DEPS b/DEPS
index eca3b4f..80530bd 100644
--- a/DEPS
+++ b/DEPS
@@ -101,6 +101,7 @@
"boringssl_gen_rev": "9c7294fd58261a79794f5afaa26598cf1442ad20",
"boringssl_rev": "d24a38200fef19150eef00cad35b138936c08767",
"browser-compat-data_tag": "ac8cae697014da1ff7124fba33b0b4245cc6cd1b", # v1.0.22
+ "cpu_features_rev": "936b9ab5515dead115606559502e3864958f7f6e",
"devtools_rev": "5a2f92117eb2257fa38bbc4f4ccb18bb5dbd6ebe",
"icu_rev": "81d656878ec611cb0b42d52c82e9dae93920d9ba",
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
@@ -112,7 +113,7 @@
"ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
"protobuf_gn_rev": "ca669f79945418f6229e4fef89b666b2a88cbb10",
"WebCore_rev": "bcb10901266c884e7b3740abc597ab95373ab55c",
- "zlib_rev": "14dd4c4455602c9b71a1a89b5cafd1f4030d2e3f",
+ "zlib_rev": "24c07df5033183efad8607cba62e746bea7180bf",
### /third_party/pkg dependencies
# 'tools/rev_sdk_deps.dart' can rev pkg dependencies to their latest; put an
@@ -317,6 +318,9 @@
Var("dart_root") + "/third_party/zlib":
Var("chromium_git") + "/chromium/src/third_party/zlib.git" +
"@" + Var("zlib_rev"),
+ Var("dart_root") + "/third_party/cpu_features/src":
+ Var("chromium_git") + "/external/github.com/google/cpu_features.git" +
+ "@" + Var("cpu_features_rev"),
Var("dart_root") + "/third_party/libcxx":
Var("llvm_git") + "/llvm-project/libcxx" + "@" + Var("libcxx_rev"),
diff --git a/build/config/dcheck_always_on.gni b/build/config/dcheck_always_on.gni
new file mode 100644
index 0000000..805c015
--- /dev/null
+++ b/build/config/dcheck_always_on.gni
@@ -0,0 +1,8 @@
+# Copyright 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Compatiblity with Chromium's build for zlib.
+dcheck_is_configurable = false
+dcheck_always_on = false
+enable_expensive_dchecks = false
diff --git a/third_party/cpu_features/BUILD.gn b/third_party/cpu_features/BUILD.gn
new file mode 100644
index 0000000..e082db7
--- /dev/null
+++ b/third_party/cpu_features/BUILD.gn
@@ -0,0 +1,61 @@
+# Copyright 2023 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+config("cpu_features_config") {
+ cflags = [ "-Wno-unused-function" ]
+ defines = [
+ "STACK_LINE_READER_BUFFER_SIZE=1024",
+ "HAVE_STRONG_GETAUXVAL",
+ ]
+ include_dirs = [ "src/include" ]
+}
+
+config("ndk_compat_headers") {
+ include_dirs = [ "src/ndk_compat" ]
+}
+
+source_set("cpuinfo") {
+ sources = [
+ "src/src/copy.inl",
+ "src/src/define_introspection.inl",
+ "src/src/define_introspection_and_hwcaps.inl",
+ "src/src/equals.inl",
+ "src/src/filesystem.c",
+ "src/src/hwcaps.c",
+ "src/src/stack_line_reader.c",
+ "src/src/string_view.c",
+ ]
+ if (current_cpu == "x86" || current_cpu == "x64") {
+ sources += [
+ "src/src/impl_x86__base_implementation.inl",
+ "src/src/impl_x86_freebsd.c",
+ "src/src/impl_x86_linux_or_android.c",
+ "src/src/impl_x86_macos.c",
+ "src/src/impl_x86_windows.c",
+ ]
+ } else if (current_cpu == "arm") {
+ sources += [ "src/src/impl_arm_linux_or_android.c" ]
+ } else if (current_cpu == "arm64") {
+ sources += [ "src/src/impl_aarch64_linux_or_android.c" ]
+ } else if (current_cpu == "mips") {
+ sources += [ "src/src/impl_mips_linux_or_android.c" ]
+ } else if (current_cpu == "ppc") {
+ sources += [ "src/src/impl_ppc_linux.c" ]
+ } else if (current_cpu == "riscv64") {
+ sources += [ "src/src/impl_riscv_linux.c" ]
+ } else {
+ error("Missing definition for architecture: $current_cpu")
+ }
+ configs += [ ":cpu_features_config" ]
+}
+
+source_set("ndk_compat") {
+ sources = [
+ "src/ndk_compat/cpu-features.c",
+ "src/ndk_compat/cpu-features.h",
+ ]
+ configs += [ ":cpu_features_config" ]
+ public_configs = [ ":ndk_compat_headers" ]
+ deps = [ ":cpuinfo" ]
+}
diff --git a/third_party/cpu_features/OWNERS b/third_party/cpu_features/OWNERS
new file mode 100644
index 0000000..dc3a1d0
--- /dev/null
+++ b/third_party/cpu_features/OWNERS
@@ -0,0 +1 @@
+file:/tools/OWNERS_VM
diff --git a/third_party/cpu_features/README.chromium b/third_party/cpu_features/README.chromium
new file mode 100644
index 0000000..a04b5a6
--- /dev/null
+++ b/third_party/cpu_features/README.chromium
@@ -0,0 +1,15 @@
+Name: cpu_features
+Short Name: cpu_features
+URL: https://github.com/google/cpu_features
+Version: v0.8.0
+Date: 2023/05/17
+License: Apache 2.0
+License File: src/LICENSE
+Security Critical: Yes
+Shipped: yes
+
+Description:
+cpu_features is a library to retrieve CPU features at runtime. It is used to
+make decisions about performance optimization and features a drop-in replacement
+for Android's cpu-features.h. It is Android's recommended replacement for libraries
+that utilize cpu-features.h.
\ No newline at end of file