From 54fc79ec6a5f2b4453337d2b46a8489fe61097df Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 9 Jul 2016 04:50:58 -0400 Subject: [PATCH 1/3] Fix Solaris 10 script and compiler issues --- cryptest.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/cryptest.sh b/cryptest.sh index fc9a20ac..9dfc8e3e 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -127,6 +127,14 @@ if [[ ((-z "$CXX") || ("$CXX" == "gcc")) ]]; then CXX=/opt/solarisstudio12.3/bin/CC elif [[ (-e "/opt/solstudio12.2/bin/CC") ]]; then CXX=/opt/solstudio12.2/bin/CC + elif [[ (-e "/opt/solstudio12.1/bin/CC") ]]; then + CXX=/opt/solstudio12.1/bin/CC + elif [[ (-e "/opt/solstudio12.0/bin/CC") ]]; then + CXX=/opt/solstudio12.0/bin/CC + elif [[ (! -z $(which CC 2>/dev/null | "$GREP" -v "no CC" | head -1)) ]]; then + CXX=$(which CC | head -1) + elif [[ (! -z $(which g++ 2>/dev/null | "$GREP" -v "no g++" | head -1)) ]]; then + CXX=$(which g++ | head -1) else CXX=CC fi @@ -429,7 +437,11 @@ fi # ld-gold linker testing if [[ (-z "$HAVE_LDGOLD") ]]; then - HAVE_LDGOLD=$(file `which ld.gold 2>&1` 2>/dev/null | "$GREP" -v "no ld.gold" | cut -d":" -f 2 | "$EGREP" -i -c "elf") + HAVE_LDGOLD=0 + LD_GOLD=$(which ld.gold 2>/dev/null | "$GREP" -v "no ld.gold" | head -1) + if [[ (! -z "$LD_GOLD") ]]; then + HAVE_LDGOLD=$(file "$LD_GOLD" | cut -d":" -f 2 | "$EGREP" -i -c "elf") + fi fi # Valgrind testing of C++03, C++11, C++14 and C++17 binaries. Valgrind tests take a long time... @@ -4215,7 +4227,7 @@ echo "************************************************" | tee -a "$TEST_RESULTS" echo "************************************************" | tee -a "$TEST_RESULTS" echo | tee -a "$TEST_RESULTS" -COUNT=$("$GREP" -a 'Testing:' "$TEST_RESULTS" "$WARN_RESULTS" | wc -l | "$AWK" '{print $1}') +COUNT=$("$GREP" 'Testing:' "$TEST_RESULTS" "$WARN_RESULTS" | wc -l | "$AWK" '{print $1}') if (( "$COUNT" == "0" )); then echo "No configurations tested" | tee -a "$TEST_RESULTS" else @@ -4239,7 +4251,7 @@ echo | tee -a "$TEST_RESULTS" # "Error" is from the GNU assembler # "error" is from the sanitizers # "Illegal", "0 errors" and "suppressed errors" are from Valgrind. -ECOUNT=$("$EGREP" -a '(Error|ERROR|error|FAILED|Illegal)' $TEST_RESULTS | "$EGREP" -v '( 0 errors|suppressed errors|error detector)' | wc -l | "$AWK" '{print $1}') +ECOUNT=$("$EGREP" '(Error|ERROR|error|FAILED|Illegal)' $TEST_RESULTS | "$EGREP" -v '( 0 errors|suppressed errors|error detector)' | wc -l | "$AWK" '{print $1}') if (( "$ECOUNT" == "0" )); then echo "No failures detected" | tee -a "$TEST_RESULTS" else @@ -4256,7 +4268,7 @@ echo echo "************************************************" | tee -a "$TEST_RESULTS" "$WARN_RESULTS" echo | tee -a "$TEST_RESULTS" "$WARN_RESULTS" -WCOUNT=$("$EGREP" -a '(warning:)' $WARN_RESULTS | "$GREP" -v 'deprecated-declarations' | wc -l | "$AWK" '{print $1}') +WCOUNT=$("$EGREP" '(warning:)' $WARN_RESULTS | "$GREP" -v 'deprecated-declarations' | wc -l | "$AWK" '{print $1}') if (( "$WCOUNT" == "0" )); then echo "No warnings detected" | tee -a "$TEST_RESULTS" "$WARN_RESULTS" else From 6c78aaa7e327cbff1670b6793015e055656a8c77 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 9 Jul 2016 06:24:11 -0400 Subject: [PATCH 2/3] Cleared "assertion failed in function pr_post_process_node() @ preopt.c" under Sun Studio 12.5 (Issue 220) --- cryptest.sh | 4 ++-- gcm.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cryptest.sh b/cryptest.sh index 9dfc8e3e..3e359db2 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -367,8 +367,8 @@ if [[ (-z "$HAVE_X32") ]]; then fi fi -# ARMv7a/Aarch32 (may run on Aarch64) -if [[ (-z "$HAVE_ARMV7A") ]]; then +# ARMv7a/Aarch32 (may run on Aarch64). SunCC reports Illegal Option and returns +if [[ (-z "$HAVE_ARMV7A") && ("$SUN_COMPILER" -eq "0") ]]; then HAVE_ARMV7A=0 "$CXX" -DCRYPTOPP_ADHOC_MAIN -march=armv7a adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 if [[ "$?" -eq "0" ]]; then diff --git a/gcm.cpp b/gcm.cpp index fd6731f0..fc6f96b9 100644 --- a/gcm.cpp +++ b/gcm.cpp @@ -12,15 +12,19 @@ #ifndef CRYPTOPP_IMPORTS #ifndef CRYPTOPP_GENERATE_X64_MASM -// Clang 3.3 integrated assembler crash on Linux -#if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) +// Clang 3.3 integrated assembler crash on Linux. MacPorts GCC compile error. SunCC crash under Sun Studio 12.5 +#if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400)) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) || (__SUNPRO_CC == 0x5140) # undef CRYPTOPP_X86_ASM_AVAILABLE # undef CRYPTOPP_X32_ASM_AVAILABLE # undef CRYPTOPP_X64_ASM_AVAILABLE # undef CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE # undef CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE +# undef CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE +# undef CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE # define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 # define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 +# define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0 +# define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 0 #endif #include "gcm.h" From dfc82a787ddf33fa4af586ced0a06f69391944a7 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 9 Jul 2016 06:56:28 -0400 Subject: [PATCH 3/3] Tighten ARM feature testing to avoid compiler cross-pollination --- cryptest.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cryptest.sh b/cryptest.sh index 3e359db2..9d1d6f65 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -367,20 +367,22 @@ if [[ (-z "$HAVE_X32") ]]; then fi fi -# ARMv7a/Aarch32 (may run on Aarch64). SunCC reports Illegal Option and returns +# ARMv7a/Aarch32 (may run on Aarch64). SunCC 12.5 reports Illegal Option and returns 0 if [[ (-z "$HAVE_ARMV7A") && ("$SUN_COMPILER" -eq "0") ]]; then HAVE_ARMV7A=0 - "$CXX" -DCRYPTOPP_ADHOC_MAIN -march=armv7a adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 - if [[ "$?" -eq "0" ]]; then - "$TMP/adhoc.exe" > /dev/null 2>&1 + if [[ ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0") ]]; then + "$CXX" -DCRYPTOPP_ADHOC_MAIN -march=armv7a adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 if [[ "$?" -eq "0" ]]; then - HAVE_ARMV7A=1 + "$TMP/adhoc.exe" > /dev/null 2>&1 + if [[ "$?" -eq "0" ]]; then + HAVE_ARMV7A=1 + fi fi fi fi -# ARM NEON (may run on Aarch64) -if [[ (-z "$HAVE_ARM_NEON") ]]; then +# ARM NEON (may run on Aarch64). SunCC 12.5 reports Illegal Option and returns 0 +if [[ (-z "$HAVE_ARM_NEON") && ("$SUN_COMPILER" -eq "0") ]]; then HAVE_ARM_NEON=0 if [[ ("$IS_ARM32" -ne "0") ]]; then if [[ $(cat /proc/cpuinfo 2>/dev/null | "$GREP" -i -c NEON) -ne "0" ]]; then @@ -389,8 +391,8 @@ if [[ (-z "$HAVE_ARM_NEON") ]]; then fi fi -# ARMv8/Aarch64, CRC and Crypto -if [[ (-z "$HAVE_ARM_CRYPTO") ]]; then +# ARMv8/Aarch64, CRC and Crypto. SunCC 12.5 reports Illegal Option and returns 0 +if [[ (-z "$HAVE_ARM_CRYPTO") && ("$SUN_COMPILER" -eq "0") ]]; then HAVE_ARM_CRYPTO=0 if [[ ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0") ]]; then "$CXX" -DCRYPTOPP_ADHOC_MAIN -march=armv8-a+crypto adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 @@ -400,8 +402,8 @@ if [[ (-z "$HAVE_ARM_CRYPTO") ]]; then fi fi -# ARMv8/Aarch64, CRC and Crypto -if [[ (-z "$HAVE_ARM_CRC") ]]; then +# ARMv8/Aarch64, CRC and Crypto. SunCC 12.5 reports Illegal Option and returns 0 +if [[ (-z "$HAVE_ARM_CRC") && ("$SUN_COMPILER" -eq "0") ]]; then HAVE_ARM_CRC=0 if [[ ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0") ]]; then "$CXX" -DCRYPTOPP_ADHOC_MAIN -march=armv8-a+crc adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1