Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: crypto/openssl_util.cc

Issue 899463002: Move the call to CRYPTO_set_NEON_capable up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/openssl_util.cc
diff --git a/crypto/openssl_util.cc b/crypto/openssl_util.cc
index f41b55a8fff71e45a44d3bf9210979a849178419..8ea12323a92726fa9c6a421bf203c6d653920b83 100644
--- a/crypto/openssl_util.cc
+++ b/crypto/openssl_util.cc
@@ -48,6 +48,18 @@ class OpenSSLInitSingleton {
private:
friend struct DefaultSingletonTraits<OpenSSLInitSingleton>;
OpenSSLInitSingleton() {
+#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
+ const bool has_neon =
+ (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
+ // CRYPTO_set_NEON_capable is called before |SSL_library_init| because this
+ // stops BoringSSL from probing for NEON support via SIGILL in the case
+ // that getauxval isn't present.
davidben 2015/02/02 19:47:16 Fun fact: this also avoids a deadlock were CRYPTO_
+ CRYPTO_set_NEON_capable(has_neon);
+ // See https://code.google.com/p/chromium/issues/detail?id=341598
+ base::CPU cpu;
+ CRYPTO_set_NEON_functional(!cpu.has_broken_neon());
+#endif
+
SSL_load_error_strings();
SSL_library_init();
int num_locks = CRYPTO_num_locks();
@@ -56,16 +68,6 @@ class OpenSSLInitSingleton {
locks_.push_back(new base::Lock());
CRYPTO_set_locking_callback(LockingCallback);
CRYPTO_THREADID_set_callback(CurrentThreadId);
-
-#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
- const bool has_neon =
- (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
- if (has_neon)
- CRYPTO_set_NEON_capable(1);
- // See https://code.google.com/p/chromium/issues/detail?id=341598
- base::CPU cpu;
- CRYPTO_set_NEON_functional(!cpu.has_broken_neon());
-#endif
}
~OpenSSLInitSingleton() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698