From 29bd2bc95cf4f632392b8e5fde29789542a59b29 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 21 Jul 2016 18:00:49 -0400 Subject: [PATCH 1/2] Add additional FILTERED_CXXFLAGS --- cryptest.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/cryptest.sh b/cryptest.sh index 58407573..88118bf3 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -751,13 +751,14 @@ fi ############################################ # Respect user's preferred flags, but filter the stuff we expliclty test -FILTERED_CXXFLAGS=("-DDEBUG" "-DNDEBUG" "-g" "-g0" "-g1" "-g2" "-g3" "-O0" "-O1" "-O2" "-O3" "-O4" "-O5" "-Os" "-Og" - "-Ofast" "-xO0" "-xO1" "-xO2" "-xO3" "-xO4" "-xO5" "-std=c++03" "-std=c++11" "-std=c++14" "-std=c++17" - "-m32" "-m64" "-mx32" "-maes" "-mrdrand" "-mrdrnd" "-mrdseed" "-mpclmul" "-Wa,-q" "-mfpu=neon" - "-march=armv7-a" "-Wall" "-Wextra" "-Wconversion" "-Wcast-align" "-Wformat-security" "-Wtrampolines" - "-DCRYPTOPP_DISABLE_ASM" "-DCRYPTOPP_DISABLE_SSSE3" "-DCRYPTOPP_DISABLE_AESNI" "-fsanitize=address" - "-fsanitize=undefined" "-march=armv8-a+crypto" "-march=armv8-a+crc" "-march=armv8-a+crc+crypto" - "-DDCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562" "-DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS") +FILTERED_CXXFLAGS=("-DDEBUG" "-DNDEBUG" "-g" "-g0" "-g1" "-g2" "-g3" "-O0" "-O1" "-O2" "-O3" "-O4" "-O5" "-Os" "-Og" "-Ofast" "-xO0" "-xO1" "-xO2" + "-xO3" "-xO4" "-xO5" "-std=c++03" "-std=c++11" "-std=c++14" "-std=c++17" "-std=gnu03" "-std=gnu11" "-std=gnu14" "-std=gnu17" + "-m32" "-m64" "-mx32" "-maes" "-mrdrand" "-mrdrnd" "-mrdseed" "-mpclmul" "-mavx" "-mavx2" "-mbmi" "-mbmi2" "-Wa,-q" + "-march=armv6" "-march=armv7" "-march=armv7-a" "-mfpu=neon-vfpv4" "-mfpu=neon-vfpv3" "-mfpu=neon-vfpv4-d16" + "-mfpu=neon-vfpv3-d16" "-mfpu=neon-fp16" "-mfpu=neon" "-march=armv8-a+crypto" "-march=armv8-a+crc" "-march=armv8-a+crc+crypto" + "-fsanitize=address" "-fsanitize=undefined" "-Wall" "-Wextra" "-Wconversion" "-Wcast-align" "-Wformat-security" "-Wtrampolines" + "-DCRYPTOPP_DISABLE_ASM" "-DCRYPTOPP_DISABLE_SSSE3" "-DCRYPTOPP_DISABLE_AESNI" "-DDCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562" + "-DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS") # Additional CXXFLAGS we did not filter RETAINED_CXXFLAGS=("") @@ -781,12 +782,6 @@ if [[ !(-z "CXXFLAGS") ]]; then done fi -if [[ !(-z "$CXXFLAGS") || !(-z "$RETAINED_CXXFLAGS") ]]; then - echo | tee -a "$TEST_RESULTS" - echo "User CXXFLAGS: $CXXFLAGS" | tee -a "$TEST_RESULTS" - echo "Retained CXXFLAGS: ${RETAINED_CXXFLAGS[@]}" | tee -a "$TEST_RESULTS" -fi - ############################################ GIT_REPO=$(git branch 2>&1 | "$GREP" -v "fatal" | wc -l | "$AWK" '{print $1; exit;}') @@ -918,6 +913,12 @@ if [[ ("${#PLATFORM_CXXFLAGS[@]}" -ne "0") ]]; then echo "PLATFORM_CXXFLAGS: ${PLATFORM_CXXFLAGS[@]}" | tee -a "$TEST_RESULTS" fi +if [[ !(-z "$CXXFLAGS") || !(-z "$RETAINED_CXXFLAGS") ]]; then + echo | tee -a "$TEST_RESULTS" + echo "User CXXFLAGS: $CXXFLAGS" | tee -a "$TEST_RESULTS" + echo "Retained CXXFLAGS: ${RETAINED_CXXFLAGS[@]}" | tee -a "$TEST_RESULTS" +fi + ############################################# ############################################# ############### BEGIN TESTING ############### From a327717618207b1a7dd4b3753d2518e4c3203ded Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 21 Jul 2016 18:04:05 -0400 Subject: [PATCH 2/2] Guard _blsr_u64 and _tzcnt_u64 on __x86_64__ --- misc.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/misc.h b/misc.h index e86f9ac3..689b5ed3 100644 --- a/misc.h +++ b/misc.h @@ -63,20 +63,22 @@ #if defined(__GNUC__) && defined(__BMI__) # include # if defined(__clang__) -#ifndef _tzcnt_u32 -# define _tzcnt_u32(x) __tzcnt_u32(x) -#endif -#ifndef _tzcnt_u64 -# define _tzcnt_u64(x) __tzcnt_u64(x) -#endif -#ifndef _blsr_u32 -# define _blsr_u32(x) __blsr_u32(x) -#endif -#ifndef _blsr_u64 -# define _blsr_u64(x) __blsr_u64(x) -#endif -# endif -#endif +# ifndef _tzcnt_u32 +# define _tzcnt_u32(x) __tzcnt_u32(x) +# endif +# ifndef _blsr_u32 +# define _blsr_u32(x) __blsr_u32(x) +# endif +# ifdef __x86_64__ +# ifndef _tzcnt_u64 +# define _tzcnt_u64(x) __tzcnt_u64(x) +# endif +# ifndef _blsr_u64 +# define _blsr_u64(x) __blsr_u64(x) +# endif +# endif // x86_64 +# endif // Clang +#endif // GNUC and BMI #endif // CRYPTOPP_DOXYGEN_PROCESSING