From 9d954efcdeeeaf1f2c5a7fd7661bbb7ae11902a1 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 16 Jul 2018 09:39:01 -0400 Subject: [PATCH] Disable CLMUL again on SunStudio (GH# 188, GH #224) We got reports that x86_64 was producing incorrect results. Also, the problem persisted in i386 builds. I don't think we can work around this issue. Oracle must fix it. --- config.h | 6 ++++++ gcm-simd.cpp | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config.h b/config.h index e4bcf946..0af378a8 100644 --- a/config.h +++ b/config.h @@ -585,6 +585,12 @@ NAMESPACE_END # endif #endif +// Fixup for SunCC 12.2-12.6. Compiler crash on GCM_Reduce_CLMUL and friends. +// http://github.com/weidai11/cryptopp/issues/226 +#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x5150) +# undef CRYPTOPP_CLMUL_AVAILABLE +#endif + #endif // X86, X32, X64 // ***************** ARM CPU features ******************** diff --git a/gcm-simd.cpp b/gcm-simd.cpp index f7fd4701..f8e39a53 100644 --- a/gcm-simd.cpp +++ b/gcm-simd.cpp @@ -10,9 +10,10 @@ #include "config.h" #include "misc.h" -// Clang 3.3 integrated assembler crash on Linux. Other versions produce incorrect results. -// Clang has never handled Intel ASM very well. I wish LLVM would fix it. -#if defined(__clang__) +// Clang 3.3 integrated assembler crash on Linux. Other versions +// produce incorrect results. Clang has never handled Intel ASM +// very well. I wish LLVM would fix it. +#if defined(CRYPTOPP_DISABLE_INTEL_ASM) # undef CRYPTOPP_X86_ASM_AVAILABLE # undef CRYPTOPP_X32_ASM_AVAILABLE # undef CRYPTOPP_X64_ASM_AVAILABLE