From 8d984173064b360af57f60932bd7b4d3c3312eb4 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 13 Sep 2017 17:16:57 -0400 Subject: Add Aarch64 specific defines to Android cross-compile Move logic into "sonfig.h". Detecting when we can/should include is proving to be troublesome --- config.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'config.h') 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 when using Apple Clang. Early Apple compilers +// fail to compile with included. Later Apple compilers compile +// intrinsics without 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 -- cgit v1.2.1