2012-09-13 20:18:41 +08:00
|
|
|
# Build for the ThreadSanitizer runtime support library.
|
2012-05-15 23:17:35 +08:00
|
|
|
|
2012-09-13 20:18:41 +08:00
|
|
|
include_directories(..)
|
2012-05-15 23:17:35 +08:00
|
|
|
|
2013-03-29 17:44:11 +08:00
|
|
|
# SANITIZER_COMMON_CFLAGS contains -fPIC, but it's performance-critical for
|
|
|
|
# TSan runtime to be built with -fPIE to reduce the number of register spills.
|
2013-03-13 17:18:30 +08:00
|
|
|
set(TSAN_CFLAGS
|
|
|
|
${SANITIZER_COMMON_CFLAGS}
|
2013-03-29 17:44:11 +08:00
|
|
|
-fPIE
|
2013-03-13 17:18:30 +08:00
|
|
|
-fno-rtti)
|
2012-09-13 20:18:41 +08:00
|
|
|
# FIXME: Add support for compile flags:
|
|
|
|
# -Wframe-larger-than=512,
|
|
|
|
# -Wglobal-constructors,
|
|
|
|
# --sysroot=.
|
|
|
|
|
|
|
|
if("${CMAKE_BUILD_TYPE}" EQUAL "Release")
|
|
|
|
set(TSAN_COMMON_DEFINITIONS DEBUG=0)
|
|
|
|
else()
|
|
|
|
set(TSAN_COMMON_DEFINITIONS DEBUG=1)
|
2012-05-15 23:17:35 +08:00
|
|
|
endif()
|
2012-09-13 20:18:41 +08:00
|
|
|
|
|
|
|
add_subdirectory(rtl)
|
2012-09-13 22:04:57 +08:00
|
|
|
|
|
|
|
if(LLVM_INCLUDE_TESTS)
|
2012-09-17 18:02:17 +08:00
|
|
|
add_subdirectory(tests)
|
2012-09-13 22:04:57 +08:00
|
|
|
endif()
|
2012-09-17 18:02:17 +08:00
|
|
|
add_subdirectory(lit_tests)
|