diff --git a/GNUmakefile b/GNUmakefile index c45dc8ad..7b86009b 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -141,17 +141,21 @@ else endif # X86/X32/X64 endif -# Aligned access required at -O3 for GCC due to vectorization (circa 08/2008). Expect other compilers to do the same. +# Aligned access required for -O3 and above due to vectorization UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h) -ifeq ($(findstring -O3,$(CXXFLAGS)),-O3) ifneq ($(UNALIGNED_ACCESS),0) -ifeq ($(GCC46_OR_LATER),1) ifeq ($(findstring -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS,$(CXXFLAGS)),) +ifeq ($(findstring -O3,$(CXXFLAGS)),-O3) CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS +endif # -O3 +ifeq ($(findstring -O5,$(CXXFLAGS)),-O5) +CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS +endif # -O5 +ifeq ($(findstring -Ofast,$(CXXFLAGS)),-Ofast) +CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS +endif # -Ofast endif # CRYPTOPP_NO_UNALIGNED_DATA_ACCESS -endif # GCC 4.6 endif # UNALIGNED_ACCESS -endif # Vectorization ifneq ($(INTEL_COMPILER),0) CXXFLAGS += -wd68 -wd186 -wd279 -wd327 -wd161 -wd3180 diff --git a/cryptest.sh b/cryptest.sh index 750ee890..58407573 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -572,14 +572,6 @@ if [[ (-z "$HAVE_DISASS") ]]; then fi fi -# Fixup... SunCC appears to generate bad code for BLAKE2 -if [[ ("$SUN_COMPILER" -ne "0") ]]; then - HAVE_O5=0 - OPT_O5= - HAVE_OFAST=0 - OPT_OFAST= -fi - # Fixup... GCC 4.8 ASAN produces false positives under ARM if [[ ( ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0") && "$GCC_48_COMPILER" -ne "0") ]]; then HAVE_ASAN=0