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/main.cpp b/main.cpp index dbdf52dc..dde856b2 100644 --- a/main.cpp +++ b/main.cpp @@ -689,7 +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 +#if defined _MSC_VER || defined HAVE_ASAN #define GX_VFY 0x9189E456 #else #define GX_VFY 0x87FA3129 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