veracrypt / VeraCrypt

Disk encryption with strong security based on TrueCrypt
https://www.veracrypt.fr
Other
6.88k stars 946 forks source link

Commit 86f0fde/cpu.h:38 intrin.h include breaks compiling on GCC #427

Closed danieldjewell closed 5 years ago

danieldjewell commented 5 years ago

Hello!

Commit 86f0fde to src/Crypto/cpu.h:38 (https://github.com/veracrypt/VeraCrypt/commit/86f0fde6e7914f055c5872bf7f2f565cc09977fc#diff-4825cf5eff78b4064fb3411defe4abb4R38) appears to break compilation with GCC on Linux because there is no "intrin.h" file... (presumably other platforms as well?)

GCC's standard libraries/includes (I happened to have 4.8.5, 4.9.3, 5.5.0, 6.5.0, 7.3.0, and 8.2 I think, installed - so I checked against those) don't have an "intrin.h" header. (llvm/clang, however, does have an "intrin.h" file.)

The current documentation reads "build with GCC" but I'm guessing that someone started using clang/llvm in their workflow... (I'm guessing that it will build just fine with clang - I haven't tried).

I attempted a build by changing cpu.h:38 to read "x86intrin.h" or "immintrin.h" - that does seem to at least build - however, I am entirely uncertain as to how this may or may not interact with other changes/CPU feature requirements/etc.

I'm not entirely sure what the best resolution is for this - I'm of the opinion that supporting multiple compilers is great (and even sometimes necessary, depending on the architecture/OS). I wanted to bring this to everyone's attention as I'm really unsure of what impacts these changes have and whether or not using "x86intrin.h" is even a solution....

Thank you all for everything!

DanielRamosAcosta commented 5 years ago

I'm unable to compile VeraCrypt under linux since commit 08a8a0c. The compiler complains about not finding intrin.h. It might be realted to this?

idrassi commented 5 years ago

Thank you for this report. Actually this has been fixed on March 21st 2019 after the issue was opened but I didn’t update the issue. The commit that fixes it is https://github.com/veracrypt/VeraCrypt/commit/08a8a0ce302078d4937afbb77e0a09e602ad24c6

Just to check, I have just performed a build of latest VeraCrypt source code from master brunch under Ubuntu Linux 18.04 with gcc 7.4.0 and it succeeded without errors.

So, I’m closing this issue. Feel free to reopen if you still have any issue with master.