Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into revise_logicalAnd
Browse files Browse the repository at this point in the history
  • Loading branch information
pszmel committed Jul 27, 2021
2 parents 16eb55a + 2e26dfd commit ee057ef
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmake/developer_package/compile_flags/sanitizer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ if (ENABLE_UB_SANITIZER)
# TODO: Remove -fno-sanitize=null as thirdparty/ocl/clhpp_headers UBSAN compatibility resolved:
# https://github.com/KhronosGroup/OpenCL-CLHPP/issues/17
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize=undefined -fno-sanitize=null")
# TODO: Remove -Wno-maybe-uninitialized after CVS-61143 fix
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -Wno-maybe-uninitialized")
check_cxx_compiler_flag("-fsanitize-recover=undefined" SANITIZE_RECOVER_UNDEFINED_SUPPORTED)
if (SANITIZE_RECOVER_UNDEFINED_SUPPORTED)
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fsanitize-recover=undefined")
Expand All @@ -33,17 +35,15 @@ endif()

# common sanitizer options
if (DEFINED SANITIZER_COMPILER_FLAGS)
# ensure sumbols are present
# ensure symbols are present
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -g -fno-omit-frame-pointer")
# GPU plugin tests compilation is slow with -fvar-tracking-assignments.
set(SANITIZER_COMPILER_FLAGS "${SANITIZER_COMPILER_FLAGS} -fno-var-tracking-assignments")
# prevent unloading libraries at runtime, so sanitizer can resolve their symbols
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -Wl,-z,nodelete")

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fuse-ld=gold")
elseif(OV_COMPILER_IS_CLANG AND NOT WIN32)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fuse-ld=lld")
endif()
if(OV_COMPILER_IS_CLANG AND NOT WIN32 AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
set(SANITIZER_LINKER_FLAGS "${SANITIZER_LINKER_FLAGS} -fuse-ld=lld")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_COMPILER_FLAGS}")
Expand Down

0 comments on commit ee057ef

Please sign in to comment.