diff --git a/cpu.h b/cpu.h index 2949fa6f..3fe5d4f2 100644 --- a/cpu.h +++ b/cpu.h @@ -39,6 +39,12 @@ # include # endif +// #if defined(CRYPTOPP_GCC_VERSION) && (CRYPTOPP_GCC_VERSION < 50000) +// typedef int __v4si __attribute__ ((__vector_size__ (16))); +// typedef long long __v2di __attribute__ ((__vector_size__ (16))); +// typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +// #endif + #if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE // GCC 5.3/i686 fails to declare __m128 in the headers we use when compiling with -std=c++11 or -std=c++14. diff --git a/cryptest.sh b/cryptest.sh index 3517d86d..6a53ce4e 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -177,6 +177,7 @@ fi GCC_60_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (6\.[0-9]|[7-9])') GCC_51_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (5\.[1-9]|[6-9])') GCC_48_COMPILER=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version 4\.8') +GCC_49_COMPILER=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version 4\.9') GCC_49_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (4\.9|[5-9]\.[0-9])') SUNCC_121_OR_ABOVE=$("$CXX" -V 2>&1 | "$EGREP" -c "CC: (Sun|Studio) .* (5\.1[0-9]|5\.[2-9]|[6-9]\.)") @@ -587,6 +588,13 @@ if [[ ( ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0") && "$GCC_48_COMPILER" -ne " HAVE_ASAN=0 fi +# Fixup... GCC 4.8 and 4.9 fail Debug builds with c++11 on x86/x32/x64 +# Also see http://stackoverflow.com/q/38051959/608639 +if [[ ( ("$IS_X86" -ne "0" || "$IS_X32" -ne "0" || "$IS_X64" -ne "0") && ("$GCC_48_COMPILER" -ne "0" || "$GCC_49_COMPILER" -ne "0") ) ]]; then + HAVE_CXX11=0 + HAVE_GNU11=0 +fi + # Benchmarks take a long time... if [[ (-z "$WANT_BENCHMARKS") ]]; then WANT_BENCHMARKS=1