summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiulio Benetti <giulio.benetti@benettiengineering.com>2019-10-30 08:23:07 -0700
committerGiulio Benetti <giulio.benetti@benettiengineering.com>2019-10-30 08:23:07 -0700
commitea541a79dd10a11fbcd861101ebe3d49aa5c8814 (patch)
tree6913b8255d67d417e4b1c86ef7568be757271a5b
parentd8b4a0bf0e4051c18ccfdb732eae6a8b81dd11e2 (diff)
downloadnss-hg-ea541a79dd10a11fbcd861101ebe3d49aa5c8814.tar.gz
Bug 1590676 - Fix build if arm doesn't support NEON r=kjacobs
At the moment NSS assumes that ARM supports NEON extension but this is not true and leads to build failure on ARM without NEON extension. Add check to assure USE_HW_AES is not defined if ARM without NEON extension is used.
-rw-r--r--lib/freebl/aes-armv8.c7
-rw-r--r--lib/freebl/rijndael.c3
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/freebl/aes-armv8.c b/lib/freebl/aes-armv8.c
index 40d5e2d34..10cb33d49 100644
--- a/lib/freebl/aes-armv8.c
+++ b/lib/freebl/aes-armv8.c
@@ -5,9 +5,10 @@
#include "secerr.h"
#include "rijndael.h"
-#if (defined(__clang__) || \
- (defined(__GNUC__) && defined(__GNUC_MINOR__) && \
- (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8))))
+#if ((defined(__clang__) || \
+ (defined(__GNUC__) && defined(__GNUC_MINOR__) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)))) && \
+ (defined(__ARM_NEON) || defined(__ARM_NEON__)))
#ifndef __ARM_FEATURE_CRYPTO
#error "Compiler option is invalid"
diff --git a/lib/freebl/rijndael.c b/lib/freebl/rijndael.c
index 26bd58ee0..6d77d942d 100644
--- a/lib/freebl/rijndael.c
+++ b/lib/freebl/rijndael.c
@@ -20,7 +20,8 @@
#include "gcm.h"
#include "mpi.h"
-#if !defined(IS_LITTLE_ENDIAN) && !defined(NSS_X86_OR_X64)
+#if (!defined(IS_LITTLE_ENDIAN) && !defined(NSS_X86_OR_X64)) || \
+ (defined(__arm__) && !defined(__ARM_NEON) && !defined(__ARM_NEON__))
// not test yet on big endian platform of arm
#undef USE_HW_AES
#endif