summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Wennborg <hans@chromium.org>2020-01-24 22:31:29 +0000
committerCommit Bot <commit-bot@chromium.org>2020-01-24 22:31:29 +0000
commit2a6432e74981917d2e8a3da8aa294979077f38c0 (patch)
treebfd6b23f2a234829aaca2493a1c188df434c8a7b
parent51dd31ce9b0d852be0dbebc99c8e5724c7f267a9 (diff)
downloadzlib-2a6432e74981917d2e8a3da8aa294979077f38c0.tar.gz
Revert "Roll clang n333938-3a6da112-1 : n340158-efb130fc-2."
This reverts commit 0aa05cca9db25a9fa8d18f77bf6b2452bc608ead. Reason for revert: This broke arm64-builder-rel and some other builders, see bug. Original change's description: > Roll clang n333938-3a6da112-1 : n340158-efb130fc-2. > > Ran `tools/clang/scripts/upload_revision.py efb130fc93059bdf02d3a83950ddabc5d119f9de`. > > This increases the clang version from 10 to 11. > > It also disables the use of vector instructions in zlib to work around > new false positives in msan (see crbug.com/1045291). > > Bug: 1030664 > Change-Id: I5417d3063f0d67a61cdf31141b05a51a56e84482 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2014904 > Reviewed-by: Nico Weber <thakis@chromium.org> > Commit-Queue: Hans Wennborg <hans@chromium.org> > Cr-Commit-Position: refs/heads/master@{#735080} TBR=thakis@chromium.org,hans@chromium.org Change-Id: I48754484c26ebf6b1f0b4a47c82fe3c74ee39837 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 1030664,1045592 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2020785 Reviewed-by: Hans Wennborg <hans@chromium.org> Commit-Queue: Hans Wennborg <hans@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#735124} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: ec2aab7d123590cfb332ba56d7faee2e1ff4a779
-rw-r--r--BUILD.gn21
-rw-r--r--cpu_features.c12
2 files changed, 12 insertions, 21 deletions
diff --git a/BUILD.gn b/BUILD.gn
index e57cbfb..9d0f021 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -23,14 +23,17 @@ if (current_cpu == "arm" || current_cpu == "arm64") {
}
}
-# TODO(https://crbug.com/1045291): Re-enable once msan bug is fixed, should
-# be set to:
-# (current_cpu == "x86" || current_cpu == "x64") && !is_ios
-use_x86_x64_optimizations = false
+use_x86_x64_optimizations =
+ (current_cpu == "x86" || current_cpu == "x64") && !is_ios
config("zlib_adler32_simd_config") {
if (use_x86_x64_optimizations) {
defines = [ "ADLER32_SIMD_SSSE3" ]
+ if (is_win) {
+ defines += [ "X86_WINDOWS" ]
+ } else {
+ defines += [ "X86_NOT_WINDOWS" ]
+ }
} else if (use_arm_neon_optimizations) {
defines = [ "ADLER32_SIMD_NEON" ]
}
@@ -268,16 +271,6 @@ component("zlib") {
defines += [ "CPU_NO_SIMD" ]
}
- # For cpu_features.c
- # TODO(https://crbug.com/1045291): Check use_x86_x64_optimizations instead.
- if ((current_cpu == "x86" || current_cpu == "x64") && !is_ios) {
- if (is_win) {
- defines += [ "X86_WINDOWS" ]
- } else {
- defines += [ "X86_NOT_WINDOWS" ]
- }
- }
-
if (is_ios) {
# iOS@ARM is a special case where we always have NEON but don't check
# for crypto extensions.
diff --git a/cpu_features.c b/cpu_features.c
index 88f46bc..8a25dd2 100644
--- a/cpu_features.c
+++ b/cpu_features.c
@@ -35,10 +35,12 @@ int ZLIB_INTERNAL x86_cpu_enable_simd = 0;
#include <zircon/features.h>
#include <zircon/syscalls.h>
#include <zircon/types.h>
-#elif defined(_MSC_VER)
+#elif defined(ARMV8_OS_WINDOWS) || defined(X86_WINDOWS)
#include <windows.h>
-#else
+#elif !defined(_MSC_VER)
#include <pthread.h>
+#else
+#error cpu_features.c CPU feature detection in not defined for your platform
#endif
#if !defined(CPU_NO_SIMD) && !defined(ARM_OS_IOS)
@@ -49,17 +51,13 @@ static void _cpu_check_features(void);
static pthread_once_t cpu_check_inited_once = PTHREAD_ONCE_INIT;
void ZLIB_INTERNAL cpu_check_features(void)
{
-#if !defined(CPU_NO_SIMD) && !defined(ARM_OS_IOS)
pthread_once(&cpu_check_inited_once, _cpu_check_features);
-#endif
}
-#elif defined(_MSC_VER)
+#elif defined(ARMV8_OS_WINDOWS) || defined(X86_WINDOWS)
static INIT_ONCE cpu_check_inited_once = INIT_ONCE_STATIC_INIT;
static BOOL CALLBACK _cpu_check_features_forwarder(PINIT_ONCE once, PVOID param, PVOID* context)
{
-#if !defined(CPU_NO_SIMD) && !defined(ARM_OS_IOS)
_cpu_check_features();
-#endif
return TRUE;
}
void ZLIB_INTERNAL cpu_check_features(void)