arsenm / sanitizers-cmake

CMake modules to help use sanitizers
Other
373 stars 63 forks source link

Restructuring and new features #5

Closed alehaa closed 8 years ago

alehaa commented 8 years ago

I rewrote most of the code, due I had multiple issues with the modules.

The major problem was, that the old modules didn't cover targets which are build by two compilers which will crash in an unresolved symbols error by the linker. So I wrote helper function to detect the used compilers per target and add specific flags per target or abort sanitizing a target, if the compilers are not compatible (e.g. clang and gcc).

The second problem was, that I liked to use AddressSanitizer for a preloaded library which resulted in an abort by AddressSanitizer, because AddressSanitizer want's to be the first library to be loaded. So I've added a wrapper script to preload the used AddressSanitizer library first. This script should be compatible if you check your build with different compilers / linkage systems, e.g. gcc has a shared library for AddressSanitizer, clang has not, ...

Last I've added a new README file for documentation.