On Monday, July 6, 2015 at 9:35:06 AM UTC-4, Mouse wrote:
>
> FWIW, I've had problems with GCC above 4.8.* on Mac OS X - everything 
> builds fine, but the cryptest.exe dies with SEGV. Same with 4.9.*, same 
> with 5.1. So I'm building with clang, which doesn't seem to exhibit such 
> problems. 
>

Here's the proposed fix (for now). I'm investigating it further.

Any suggestions (besides wrapping it in a guard for GCC 4.8 and 4.9)?

$ cat misc.diff 
diff --git a/misc.cpp b/misc.cpp
index 3c2c2a5..a32ab41 100644
--- a/misc.cpp
+++ b/misc.cpp
@@ -14,6 +14,11 @@
 
 NAMESPACE_BEGIN(CryptoPP)
 
+// GCC 4.9 generates code using vmovdqa instructions under -O3, which 
cause a segfault due to 128-bit word alignment requirements.
+// Refer http://stackoverflow.com/q/31373765 for more details.
+#pragma GCC push_options
+#pragma GCC optimize ("-O2")
+
 void xorbuf(byte *buf, const byte *mask, size_t count)
 {
     size_t i;
@@ -44,6 +49,8 @@ void xorbuf(byte *buf, const byte *mask, size_t count)
         buf[i] ^= mask[i];
 }
 
+#pragma GCC pop_options
+
 void xorbuf(byte *output, const byte *input, const byte *mask, size_t 
count)
 {
     size_t i;
 

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to