Removed useless flag #3926

This commit is contained in:
Alexey Milovidov 2018-12-27 04:22:17 +03:00
parent da5b62ab67
commit 8b3371835a

View File

@ -31,18 +31,6 @@ if (SANITIZE)
if (MAKE_STATIC_LIBRARIES AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (MAKE_STATIC_LIBRARIES AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libubsan") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libubsan")
endif () endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Devirtualization with multiple virtual inheritance confuses UBSan.
# Example:
#
# ZooKeeperImpl.cpp:529:8: runtime error: member call on address 0x7f548d7ea490 which does not point to an object of type 'Request'
# 0x7f548d7ea490: note: object has invalid vptr
# 00 00 00 00 00 00 00 00 00 00 00 00 a8 a4 7e 8d 54 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00
#
# http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20161017/174163.html
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-devirtualize")
endif ()
else () else ()
message (FATAL_ERROR "Unknown sanitizer type: ${SANITIZE}") message (FATAL_ERROR "Unknown sanitizer type: ${SANITIZE}")
endif () endif ()