maidsafe-archive / MaidSafe

This is the super-project in which each MaidSafe library resides. Some information is common to all libraries, and is detailed here. Library-specific information can be found in each library's wiki.
Other
583 stars 101 forks source link

Compile error in cryptopp while compiling MaidSafe with gcc 4.9 #119

Closed pierrechevalier83 closed 10 years ago

pierrechevalier83 commented 10 years ago

Hi,

I was building Maidsafe on an Arch linux box with gcc 4.9 (following the instructions from the wiki) I got a bunch of compilation errors (redefinition of _mm_shuffle_epi8 in cpu.h and related see here: http://dash.maidsafe.net/buildSummary.php?buildid=28201) I ended up working around them by doing dirty hacks in src/third_party_libs/cryptopp/cpu.h, src/third_party_libs/cryptopp/gcm.cpp, src/third_party_libs/cryptopp/rijndael.cpp and src/third_party_libs/cryptopp/salsa.cpp.

I´m aware that the problem comes from cryptopp, so you can just blame upstream. It could also just have been me doing something silly, but I still decided to raise the issue just to see if people are aware of it.

Contact me if you need more details or help trying to fix the problem. (If I wasn´t just doing something obviously wrong, it should be pretty straightforward to reproduce: try to build MaidSafe with gcc 4.9 and see what happens)

Note that it seems to be related to the problem mentionned in this thread: https://gcc.gnu.org/ml/gcc/2014-04/msg00151.html

Fraser999 commented 10 years ago

Thanks for the report. It seems that it already has a ticket in the Crypto++ bug tracker too (http://sourceforge.net/apps/trac/cryptopp/ticket/33). Our experience is that it takes a while for these to get merged - our last ticket from 2 years ago is still pending http://sourceforge.net/apps/trac/cryptopp/ticket/17 :-)

We'll get a copy of GCC 4.9 installed onto one of the CI machines and have a look at patching our copy of Crypto++ pending this getting resolved by Wei Dai (the author of Crypto++).

Thanks again, Fraser.

pierrechevalier83 commented 10 years ago

Hi Fraser,

Thanks for the fast answer.

We'll get a copy of GCC 4.9 installed onto one of the CI machines and have a look at patching our >copy of Crypto++ pending this getting resolved by Wei Dai (the author of Crypto++). Thanks for that.

I spent a bit more time tonight trying to figure out a clean way to fix it, but this low level stuff is total chineese for me. Here is a patch (2 commits) of the workaround I used, which applies on master: http://pastebin.com/UBinR47W It is really ugly, but maybe it can give you a starting point.

Regards, Pierre.

dirvine commented 10 years ago

Thanks for the patch, we will take a look over it and perhaps speak with the cryptopp guys. They are pretty good, but patches do take a while. Jeff Walton on the crypto list is a very smart chap and will likely have some comments. Superb work though, the 'hack' seems to be pretty much in line with the gcc lists recommendations as a work around, so we will see. Thanks again.

Fraser999 commented 10 years ago

This has been applied to 'next' branch in https://github.com/maidsafe/MaidSafe/commit/36ce36a8470486e6f5fca0ae6bf0a0dfdd9fca01 Many thanks again for the patch.