From: Michael Wallner Date: Wed, 30 Sep 2020 12:19:36 +0000 (+0200) Subject: travis: try to fix ubsan for clang-old X-Git-Tag: 1.1.0-beta1~236^2~26 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=94025939f5d2c3ec2c8545d31945db560a45097e;p=awesomized%2Flibmemcached travis: try to fix ubsan for clang-old --- diff --git a/CMake/CheckDebug.cmake b/CMake/CheckDebug.cmake index 2c873d86..43368299 100644 --- a/CMake/CheckDebug.cmake +++ b/CMake/CheckDebug.cmake @@ -49,6 +49,9 @@ function(check_debug) if(HAVE_ASAN) add_compile_definitions(HAVE_ASAN) add_compile_options(-fsanitize=address) + if(CMAKE_CXX_COMPILER_ID STREQUAL Clang) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") + endif() link_libraries(asan) check_flag(-fsanitize-recover=address IGNORE) endif() @@ -62,6 +65,9 @@ function(check_debug) if(HAVE_UBSAN) add_compile_definitions(HAVE_UBSAN) add_compile_options(-fsanitize=undefined) + if(CMAKE_CXX_COMPILER_ID STREQUAL Clang) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined") + endif() link_libraries(ubsan) check_flag(-fsanitize-recover=undefined IGNORE) endif()