[cmake-developers] [CMake 0016010]: cmake with clang sanitizers fails

Mantis Bug Tracker mantis at public.kitware.com
Thu Mar 10 10:33:56 EST 2016


The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=16010 
====================================================================== 
Reported By:                Klaus R
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   16010
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-03-10 10:33 EST
Last Modified:              2016-03-10 10:33 EST
====================================================================== 
Summary:                    cmake with clang sanitizers fails
Description: 
I tried to rebuild XCode projects with cmake 3.5.0. Failed to work if clang
sanitizers were enabled, most likely because the optiones necessary for linking
sanitized binaries were not passed to the linker.

Steps to Reproduce: 
if( WITH_SANITIZER )
    ## http://clang.llvm.org/docs/AddressSanitizer.html
    set(SANITIZERS "-fsanitize=address -fno-omit-frame-pointer")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZERS}")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZERS}")
    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${SANITIZERS}" )
    set(CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT}
${SANITIZERS}" )
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZERS}" )
endif()


Additional Information: 
Workaround was to revert to previous 3.4 version
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-03-10 10:33 Klaus R        New Issue                                    
======================================================================



More information about the cmake-developers mailing list