VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2022-02-13 18:41:18 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2022-02-13 18:42:27 +0100
commitd417b2806c88cf06f4f3baa0064d6b1f9f22037d (patch)
tree1b9371586cde72dfebf8d1ad2552552c33e93b91 /src/Makefile
parentbe5bcbf42f4b2bdcc8307ee80fe1e954a4c481f2 (diff)
downloadVeraCrypt-d417b2806c88cf06f4f3baa0064d6b1f9f22037d.tar.gz
VeraCrypt-d417b2806c88cf06f4f3baa0064d6b1f9f22037d.zip
Linux/FreeBSD: Enable building without AESNI support by setting environment variable DISABLE_AESNI to 1 during build or passing NOAESNI=1 to make command
This comes following Github issue #892 and which should be solved thanks to this.
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/Makefile b/src/Makefile
index eb87e6ea..05ea3f61 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -143,6 +143,7 @@ export PLATFORM_UNSUPPORTED := 0
export CPU_ARCH ?= unknown
export SIMD_SUPPORTED := 0
+export DISABLE_AESNI ?= 0
ARCH ?= $(shell uname -m)
@@ -176,6 +177,9 @@ ifeq "$(origin NOSSE2)" "command line"
SIMD_SUPPORTED := 0
endif
+ifeq "$(origin NOAESNI)" "command line"
+ DISABLE_AESNI := 1
+endif
#------ Linux configuration ------
@@ -197,11 +201,16 @@ ifeq "$(shell uname -s)" "Linux"
CFLAGS += -msse2
CXXFLAGS += -msse2
- GCC_GTEQ_440 := $(shell expr `$(CC) -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 `$(CC) -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
+ ifeq "$(DISABLE_AESNI)" "1"
+ CFLAGS += -mno-aes -DCRYPTOPP_DISABLE_AESNI
+ CXXFLAGS += -mno-aes -DCRYPTOPP_DISABLE_AESNI
+ else
+ GCC_GTEQ_440 := $(shell expr `$(CC) -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 `$(CC) -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
+ endif
endif
ifeq "$(GCC_GTEQ_430)" "1"
@@ -365,8 +374,16 @@ ifeq "$(shell uname -s)" "FreeBSD"
endif
ifeq "$(SIMD_SUPPORTED)" "1"
- CFLAGS += -msse2 -maes
- CXXFLAGS += -msse2 -maes
+ CFLAGS += -msse2
+ CXXFLAGS += -msse2
+
+ ifeq "$(DISABLE_AESNI)" "1"
+ CFLAGS += -mno-aes -DCRYPTOPP_DISABLE_AESNI
+ CXXFLAGS += -mno-aes -DCRYPTOPP_DISABLE_AESNI
+ else
+ CFLAGS += -maes
+ CXXFLAGS += -maes
+ endif
ifeq "$(origin SSSE3)" "command line"
CFLAGS += -mssse3