From bed14e60c2e0e72306a691571918d930612afa75 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Wed, 20 Jan 2021 23:36:13 +0300 Subject: [PATCH] mdbx-cmake: add `-fsanitize-undefined-trap-on-error` to compile flags and `ENABLE_UBSAN` to `config.h`. Change-Id: Ic18c0d59ccf32f9783a44de456893fbc8a0a7d32 --- cmake/compiler.cmake | 2 +- src/config.h.in | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index 4fc94fe3..22324a64 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -653,7 +653,7 @@ macro(setup_compile_flags) endif() if(ENABLE_UBSAN) - add_compile_flags("C;CXX" "-fsanitize=undefined") + add_compile_flags("C;CXX" "-fsanitize=undefined" "-fsanitize-undefined-trap-on-error") endif() if(ENABLE_GCOV) diff --git a/src/config.h.in b/src/config.h.in index 4fdddfd9..bb3eea07 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -9,6 +9,7 @@ #cmakedefine ENABLE_GPROF #cmakedefine ENABLE_GCOV #cmakedefine ENABLE_ASAN +#cmakedefine ENABLE_UBSAN #cmakedefine MDBX_FORCE_ASSERTIONS /* Common */