summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-09-13 17:16:57 -0400
committerJeffrey Walton <noloader@gmail.com>2017-09-13 17:16:57 -0400
commit8d984173064b360af57f60932bd7b4d3c3312eb4 (patch)
tree0351d07579e21f946412cde7f44613b5950ca8f9 /config.h
parent40859a80da32ed0974580871e2053c37c7817a3a (diff)
downloadcryptopp-git-8d984173064b360af57f60932bd7b4d3c3312eb4.tar.gz
Add Aarch64 specific defines to Android cross-compile
Move <arm_acle.h> logic into "sonfig.h". Detecting when we can/should include <arm_acle.h> is proving to be troublesome
Diffstat (limited to 'config.h')
-rw-r--r--config.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/config.h b/config.h
index 14641ccc..17dd6d21 100644
--- a/config.h
+++ b/config.h
@@ -548,13 +548,23 @@ NAMESPACE_END
# endif
#endif
+// Don't include <arm_acle.h> when using Apple Clang. Early Apple compilers
+// fail to compile with <arm_acle.h> included. Later Apple compilers compile
+// intrinsics without <arm_acle.h> included. Also avoid it with GCC 4.8,
+// and avoid it on Android, too.
+#if defined(__ARM_ACLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION) && \
+ (!defined(CRYPTOPP_GCC_VERSION) || (CRYPTOPP_GCC_VERSION >= 40900)) && \
+ !defined(__ANDROID__)
+# define CRYPTOPP_ARM_ACLE_AVAILABLE 1
+#endif
+
// Requires ARMv8 and ACLE 2.0. GCC requires 4.8 and above.
// LLVM Clang requires 3.5. Apple Clang is unknown at the moment.
// Microsoft plans to support ARM-64, but its not clear how to detect it.
// TODO: Add MSC_VER and ARM-64 platform define when available
#if !defined(CRYPTOPP_ARM_CRC32_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(__apple_build_version__)
-# if defined(__ARM_FEATURE_CRC32) || (CRYPTOPP_MSC_VERSION >= 1910) || \
- defined(__aarch32__) || defined(__aarch64__)
+# if (defined(__ARM_FEATURE_CRC32) || (CRYPTOPP_MSC_VERSION >= 1910) || \
+ defined(__aarch32__) || defined(__aarch64__)) && !defined(__ANDROID__)
# define CRYPTOPP_ARM_CRC32_AVAILABLE 1
# endif
#endif