| 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.
|
| + 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() {
|
|
|