Home | History | Annotate | Download | only in tsan
      1 # Build for the ThreadSanitizer runtime support library.
      2 
      3 include_directories(..)
      4 
      5 # SANITIZER_COMMON_CFLAGS contains -fPIC, but it's performance-critical for
      6 # TSan runtime to be built with -fPIE to reduce the number of register spills.
      7 set(TSAN_CFLAGS
      8   ${SANITIZER_COMMON_CFLAGS}
      9   -fPIE
     10   -fno-rtti)
     11 # FIXME: Add support for compile flags:
     12 #   -Wframe-larger-than=512,
     13 #   -Wglobal-constructors,
     14 #   --sysroot=.
     15 
     16 if("${CMAKE_BUILD_TYPE}" EQUAL "Release")
     17   set(TSAN_COMMON_DEFINITIONS DEBUG=0)
     18 else()
     19   set(TSAN_COMMON_DEFINITIONS DEBUG=1)
     20 endif()
     21 
     22 add_subdirectory(rtl)
     23 
     24 if(LLVM_INCLUDE_TESTS)
     25   add_subdirectory(tests)
     26 endif()
     27 add_subdirectory(lit_tests)
     28