diff --git a/CMakeLists.txt b/CMakeLists.txt index 86e34305..914f0513 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -214,12 +214,11 @@ if(CMAKE_COMPILER_IS_GNUCC set(CRC_PCLMUL_SRC crc32-pclmul_asm.S) endif() set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) - set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG") - set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG") set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -fno-omit-frame-pointer -fsanitize=address,undefined -DHAVE_ASAN -DHAVE_UBSAN") set(CMAKE_CXX_FLAGS_DEBUG - "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address,undefined -DHAVE_ASAN -DHAVE_UBSAN" + "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -fno-omit-frame-pointer -fsanitize=address,undefined -DHAVE_ASAN -DHAVE_UBSAN" ) set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address,undefined" @@ -624,7 +623,7 @@ set_source_files_properties( if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug")) # PMP breaks Debug build - if(NOT (CMAKE_BUILD_TYPE STREQUAL "asan")) + if(NOT (CMAKE_BUILD_TYPE STREQUAL "Asan")) set(PMPML_SRC PMP_Multilinear.cpp PMP_Multilinear_64.cpp PMP_Multilinear_test.cpp) endif() diff --git a/KeysetTest.cpp b/KeysetTest.cpp index 6c2a5bb6..5b814369 100644 --- a/KeysetTest.cpp +++ b/KeysetTest.cpp @@ -60,14 +60,14 @@ bool VerificationTest ( HashInfo* info, bool verbose ) return true; } else { if (verbose) - printf("Verification value 0x%08X ....... FAIL! (Expected 0x%08X)\n", + printf("Verification value 0x%08X ....... \x1b[31mFAIL!\x1b[39m (Expected 0x%08X)\n", verification, expected); return false; } } else { if (!expected) { if (verbose) - printf("Verification value 0x%08X ....... INSECURE (should not be 0)\n", + printf("Verification value 0x%08X ....... \x1b[31mINSECURE\x1b[39m (should not be 0)\n", verification); return true; } else { diff --git a/main.cpp b/main.cpp index dbdf52dc..348a66c5 100644 --- a/main.cpp +++ b/main.cpp @@ -689,12 +689,7 @@ HashInfo g_hashes[] = { farmhash128_c_test, 128, FARM128_VERIF,"farmhash128_c", "farmhash128_with_seed (C99)", GOOD, {} }, #endif #ifdef HAVE_AESNI -#ifdef _MSC_VER -#define GX_VFY 0x9189E456 -#else -#define GX_VFY 0x87FA3129 -#endif -{ gxhash64_test, 64, GX_VFY, "gxhash64", "gxHash, 64-bit, AES-only, unportable", GOOD, {} }, +{ gxhash64_test, 64, 0x9189E456, "gxhash64", "gxHash, 64-bit, AES-only, unportable", GOOD, {} }, #endif { xxHash64_test, 64, 0x024B7CF4, "xxHash64", "xxHash, 64-bit", GOOD, {} }, #if 0 diff --git a/verifyall.sh b/verifyall.sh index d02cf8ab..a4665809 100755 --- a/verifyall.sh +++ b/verifyall.sh @@ -2,5 +2,10 @@ set -e echo build 64bit make -j4 -C build && build/SMHasher --verbose --test=VerifyAll -echo build32 32bit -make -j4 -C build32 && build32/SMHasher --verbose --test=VerifyAll +if test -d build32; then + echo build32 32bit + make -j4 -C build32 && build32/SMHasher --verbose --test=VerifyAll +fi +echo build-debug with asan +test -d build-debug || cmake -S . -B build-debug -DCMAKE_RELEASE_TYPE=Debug +make -j4 -C build-debug && build-debug/SMHasher --verbose --test=VerifyAll