From: Alexey Samsonov Date: Mon, 27 Apr 2015 22:08:09 +0000 (+0000) Subject: Introduce tsan_cxx and msan_cxx libraries (compiler-rt part). X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56d6fc81a50d2ce5fcd44a6f6b5bf082757d406b;p=platform%2Fupstream%2Fllvm.git Introduce tsan_cxx and msan_cxx libraries (compiler-rt part). For now tsan_cxx and msan_cxx contain only operator new/delete replacements. In the future, when we add support for running UBSan+TSan and UBSan+MSan, they will also contain bits ubsan_cxx runtime. llvm-svn: 235928 --- diff --git a/compiler-rt/lib/msan/CMakeLists.txt b/compiler-rt/lib/msan/CMakeLists.txt index ccf47fc..596d040 100644 --- a/compiler-rt/lib/msan/CMakeLists.txt +++ b/compiler-rt/lib/msan/CMakeLists.txt @@ -7,12 +7,15 @@ set(MSAN_RTL_SOURCES msan_chained_origin_depot.cc msan_interceptors.cc msan_linux.cc - msan_new_delete.cc msan_report.cc msan_thread.cc msan_poisoning.cc ) +set(MSAN_RTL_CXX_SOURCES + msan_new_delete.cc) + + set(MSAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_no_rtti_flag(MSAN_RTL_CFLAGS) append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE MSAN_RTL_CFLAGS) @@ -30,11 +33,18 @@ foreach(arch ${MSAN_SUPPORTED_ARCH}) $ $ CFLAGS ${MSAN_RTL_CFLAGS}) - add_dependencies(msan clang_rt.msan-${arch}) - list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-${arch}) + add_compiler_rt_runtime(clang_rt.msan_cxx-${arch} ${arch} STATIC + SOURCES ${MSAN_RTL_CXX_SOURCES} + CFLAGS ${MSAN_RTL_CFLAGS}) + add_dependencies(msan clang_rt.msan-${arch} + clang_rt.msan_cxx-${arch}) + list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-${arch} + clang_rt.msan_cxx-${arch}) if(UNIX) add_sanitizer_rt_symbols(clang_rt.msan-${arch} msan.syms.extra) - add_dependencies(msan clang_rt.msan-${arch}-symbols) + add_sanitizer_rt_symbols(clang_rt.msan_cxx-${arch} msan.syms.extra) + add_dependencies(msan clang_rt.msan-${arch}-symbols + clang_rt.msan_cxx-${arch}-symbols) endif() endforeach() diff --git a/compiler-rt/lib/tsan/CMakeLists.txt b/compiler-rt/lib/tsan/CMakeLists.txt index af54924..68a7bcf 100644 --- a/compiler-rt/lib/tsan/CMakeLists.txt +++ b/compiler-rt/lib/tsan/CMakeLists.txt @@ -30,7 +30,6 @@ set(TSAN_SOURCES rtl/tsan_mman.cc rtl/tsan_mutex.cc rtl/tsan_mutexset.cc - rtl/tsan_new_delete.cc rtl/tsan_report.cc rtl/tsan_rtl.cc rtl/tsan_rtl_mutex.cc @@ -42,6 +41,9 @@ set(TSAN_SOURCES rtl/tsan_symbolize.cc rtl/tsan_sync.cc) +set(TSAN_CXX_SOURCES + rtl/tsan_new_delete.cc) + if(APPLE) list(APPEND TSAN_SOURCES rtl/tsan_platform_mac.cc) elseif(UNIX) @@ -105,12 +107,18 @@ if(UNIX AND NOT APPLE) $ $ $ - CFLAGS ${TSAN_RTL_CFLAGS} - DEFS ${TSAN_COMMON_DEFINITIONS}) - list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch}) + CFLAGS ${TSAN_RTL_CFLAGS}) + add_compiler_rt_runtime(clang_rt.tsan_cxx-${arch} ${arch} STATIC + SOURCES ${TSAN_CXX_SOURCES} + CFLAGS ${TSAN_RTL_CFLAGS}) + list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch} + clang_rt.tsan_cxx-${arch}) add_sanitizer_rt_symbols(clang_rt.tsan-${arch} rtl/tsan.syms.extra) + add_sanitizer_rt_symbols(clang_rt.tsan_cxx-${arch} rtl/tsan.syms.extra) add_dependencies(tsan clang_rt.tsan-${arch} - clang_rt.tsan-${arch}-symbols) + clang_rt.tsan_cxx-${arch} + clang_rt.tsan-${arch}-symbols + clang_rt.tsan_cxx-${arch}-symbols) endforeach() endif()