veracrypt / VeraCrypt

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

Veracrypt does compile on Linux (Fedora 26) #198

Closed mtdew365 closed 6 years ago

mtdew365 commented 7 years ago

Compiled up to the last few releases. Latest release give the following errors...

Compiling cpu.c In file included from ../Crypto/cpu.h:175:0, from ../Crypto/cpu.c:3: ../Crypto/cpu.c: In function ‘TryAESNI’: /usr/lib/gcc/x86_64-redhat-linux/7/include/wmmintrin.h:61:1: error: inlining failed in call to always_inline ‘_mm_aesenc_si128’: target specific option mismatch _mm_aesenc_si128 (m128i X, m128i Y) ^~~~ ../Crypto/cpu.c:245:14: note: called from here ciphered = _mm_aesenc_si128(block, subkey); ^~~~~~~ In file included from ../Crypto/cpu.h:175:0, from ../Crypto/cpu.c:3: /usr/lib/gcc/x86_64-redhat-linux/7/include/wmmintrin.h:61:1: error: inlining failed in call to always_inline ‘_mm_aesenc_si128’: target specific option mismatch _mm_aesenc_si128 (m128i X, m128i Y) ^~~~ ../Crypto/cpu.c:245:14: note: called from here ciphered = _mm_aesenc_si128(block, subkey); ^~~~~~~ make[1]: [/home/jbergmann/veracrypt/src/Build/Include/Makefile.inc:21: ../Crypto/cpu.o] Error 1 make: [Makefile:372: all] Error 2

Any help would be appreciated.... gcc (GCC) 7.1.1 20170622 (Red Hat 7.1.1-3)

mtdew365 commented 7 years ago

Modified Makefile in /src directory.

Makefile.zip

Changed gcc -dumpversion to gcc -dumpfullversion Attached patch file for reference.

Unit193 commented 6 years ago

A backwards compatible version of this patch was written by Krytarik Raido,

diff --git a/src/Makefile b/src/Makefile
index 7d7f69d..4f8bb42 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -170,8 +170,8 @@ ifeq "$(shell uname -s)" "Linux"
        CFLAGS += -msse2
        CXXFLAGS += -msse2

-       GCC_GTEQ_440 := $(shell expr `gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40400)
-       GCC_GTEQ_430 := $(shell expr `gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40300)
+       GCC_GTEQ_440 := $(shell expr `gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/' -e 's/^[0-9]\{1,2\}$$/&0000/'` \>= 40400)
+       GCC_GTEQ_430 := $(shell expr `gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/' -e 's/^[0-9]\{1,2\}$$/&0000/'` \>= 40300)
        ifeq "$(GCC_GTEQ_440)" "1"
            CFLAGS += -maes
            CXXFLAGS += -maes