Skip to content

Commit

Permalink
verifyall.sh also Debug
Browse files Browse the repository at this point in the history
this shows all ubsan violations.
fix gxhash verification on Debug.
add Asan for C files.
  • Loading branch information
rurban committed Dec 15, 2024
1 parent da9db5f commit f0487b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions verifyall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f0487b5

Please sign in to comment.