diff options
author | Alex <viciousvex@users.noreply.github.com> | 2021-08-07 21:42:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-07 21:42:51 +0200 |
commit | 22b0454b811d14ad8960c59dc9f155e302a6e833 (patch) | |
tree | 949a44afc3d46821eecd4a287fd6c04963d7689d | |
parent | 4b98ff0e9810a218f802d08cfd546c2fd67757dc (diff) | |
download | VeraCrypt-22b0454b811d14ad8960c59dc9f155e302a6e833.tar.gz VeraCrypt-22b0454b811d14ad8960c59dc9f155e302a6e833.zip |
Added compatibility with GNU GCC 11 Toolchain (#811)
This fixes compilation issues when using GNU GCC >=11 where parameter -std=gnu++17 is used by default. Resolves #802
-rw-r--r-- | src/Makefile | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile index c49471f7..4f9796b6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -174,6 +174,15 @@ ifeq "$(shell uname -s)" "Linux" PLATFORM := Linux C_CXX_FLAGS += -DTC_UNIX -DTC_LINUX + + # GNU GCC version 11 and higher compile with -std=gnu++17 by default + # which breaks "byte" definitions in Crypto++ library. So set + # -std=gnu++14 instead. + GCC11PLUS := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 11) + ifeq "$(GCC11PLUS)" "1" + CXXFLAGS += -std=gnu++14 + endif + ifeq "$(SIMD_SUPPORTED)" "1" CFLAGS += -msse2 |