Index: third_party/zlib/BUILD.gn |
diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn |
index 9ac85a574fe53f7ef0e754d159909cdeb235b7f9..0755618c0301463f8b1e0d942d4d577659ae6d7e 100644 |
--- a/third_party/zlib/BUILD.gn |
+++ b/third_party/zlib/BUILD.gn |
@@ -6,6 +6,16 @@ config("zlib_config") { |
include_dirs = [ "." ] |
} |
+static_library("zlib_x86_simd") { |
+ if (is_linux && (cpu_arch == "x86" || cpu_arch == "x64")) { |
+ sources = [ "crc_folding.c", |
+ "fill_window_sse.c" ] |
+ cflags = ["-msse2", "-msse4.2", "-mpclmul"] |
+ } else { |
+ sources = [ "simd_stub.c"] |
+ } |
+} |
+ |
static_library("zlib") { |
if (!is_win) { |
# Don't stomp on "libzlib" on other platforms. |
@@ -36,12 +46,18 @@ static_library("zlib") { |
"trees.c", |
"trees.h", |
"uncompr.c", |
+ "x86.c", |
+ "x86.h", |
"zconf.h", |
"zlib.h", |
"zutil.c", |
"zutil.h", |
] |
+ if (is_linux && (cpu_arch == "x86" || cpu_arch == "x64")) { |
+ defines = [ "HAVE_ARCH_INTEL" ] |
+ } |
+ |
configs -= [ "//build/config/compiler:chromium_code" ] |
configs += [ "//build/config/compiler:no_chromium_code" ] |