Fix broken compile with GCC 4.9 and 4.9 in Debug configuration with -std=c++11

pull/239/head
Jeffrey Walton 2016-07-22 03:25:25 -04:00
parent e8d3ddffd8
commit 0c801ce822
2 changed files with 14 additions and 0 deletions

6
cpu.h
View File

@ -39,6 +39,12 @@
# include <emmintrin.h> # include <emmintrin.h>
# endif # 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 #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. // GCC 5.3/i686 fails to declare __m128 in the headers we use when compiling with -std=c++11 or -std=c++14.

View File

@ -177,6 +177,7 @@ fi
GCC_60_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (6\.[0-9]|[7-9])') 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_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_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])') 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]\.)") 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 HAVE_ASAN=0
fi 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... # Benchmarks take a long time...
if [[ (-z "$WANT_BENCHMARKS") ]]; then if [[ (-z "$WANT_BENCHMARKS") ]]; then
WANT_BENCHMARKS=1 WANT_BENCHMARKS=1