diff options
| author | Jeffrey Walton <noloader@gmail.com> | 2017-10-17 20:47:14 -0400 |
|---|---|---|
| committer | Jeffrey Walton <noloader@gmail.com> | 2017-10-17 20:47:14 -0400 |
| commit | f8d97b83ed6d65946570a2ec9d6aa1ac5ff7ce94 (patch) | |
| tree | e9541619d06059d71953915a82286e3fc477b9c7 /config.h | |
| parent | 9df87dc7d4618a3c8232884568df58fecd3bdf4b (diff) | |
| download | cryptopp-git-f8d97b83ed6d65946570a2ec9d6aa1ac5ff7ce94.tar.gz | |
Fix compile on old PowerPC
This cleans up the compile on old PwerMac G5's. Our Altivec and Crypto code relies on Power7 and Power8 extensions. There's no need to shoehorn Altivec and Power4 into old platforms, so we disable Altivec and Crypto unless Power7 is available. The GNUmakefile sets CRYPTOPP_DISABLE_ALTIVEC if Power7 is not available.
Diffstat (limited to 'config.h')
| -rw-r--r-- | config.h | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -600,20 +600,21 @@ NAMESPACE_END #if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
-// An old Apple G5 with GCC 4.01 has AltiVec.
-#if !defined(CRYPTOPP_ALTIVEC_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM)
+// An old Apple G5 with GCC 4.01 has AltiVec, but its only Power4 or so.
+// We need Power7 or above, so the makefile defines CRYPTOPP_DISABLE_ALTIVEC.
+#if !defined(CRYPTOPP_ALTIVEC_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ALTIVEC) && !defined(CRYPTOPP_DISABLE_ASM)
# if defined(__ALTIVEC__) || (CRYPTOPP_XLC_VERSION >= 100000) || (CRYPTOPP_GCC_VERSION >= 40000)
# define CRYPTOPP_ALTIVEC_AVAILABLE 1
# endif
#endif
-#if !defined(CRYPTOPP_POWER8_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM)
+#if !defined(CRYPTOPP_POWER8_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && defined(CRYPTOPP_ALTIVEC_AVAILABLE)
# if defined(_ARCH_PWR8) || (CRYPTOPP_XLC_VERSION >= 130000) || (CRYPTOPP_GCC_VERSION >= 40800)
# define CRYPTOPP_POWER8_AVAILABLE 1
# endif
#endif
-#if !defined(CRYPTOPP_POWER8_CRYPTO_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM)
+#if !defined(CRYPTOPP_POWER8_CRYPTO_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && defined(CRYPTOPP_ALTIVEC_AVAILABLE)
# if defined(__CRYPTO__) || defined(_ARCH_PWR8) || (CRYPTOPP_XLC_VERSION >= 130000) || (CRYPTOPP_GCC_VERSION >= 40800)
# define CRYPTOPP_POWER8_AES_AVAILABLE 1
//# define CRYPTOPP_POWER8_SHA_AVAILABLE 1
|
