[PATCH] D59163: [TSan] Linux: link in BlocksRuntime and libdispatch if necessary

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 16:16:29 PST 2019


yln created this revision.
Herald added subscribers: llvm-commits, Sanitizers, mgorny, kubamracek.
Herald added projects: Sanitizers, LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D59163

Files:
  compiler-rt/lib/tsan/CMakeLists.txt


Index: compiler-rt/lib/tsan/CMakeLists.txt
===================================================================
--- compiler-rt/lib/tsan/CMakeLists.txt
+++ compiler-rt/lib/tsan/CMakeLists.txt
@@ -18,6 +18,8 @@
                           -DTSAN_DEBUG_OUTPUT=2)
 endif()
 
+set(TSAN_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS})
+
 set(TSAN_RTL_CFLAGS ${TSAN_CFLAGS})
 append_list_if(COMPILER_RT_HAS_MSSE3_FLAG -msse3 TSAN_RTL_CFLAGS)
 append_list_if(SANITIZER_LIMIT_FRAME_SIZE -Wframe-larger-than=530
@@ -75,6 +77,7 @@
   # Libdispatch support for non-Apple platforms requires '-fblocks'.
   if (NOT APPLE)
     list(APPEND TSAN_RTL_CFLAGS "-fblocks")
+    list(APPEND TSAN_LINK_LIBS BlocksRuntime dispatch)
   endif()
 endif()
 
@@ -112,8 +115,6 @@
 if(APPLE)
   add_asm_sources(TSAN_ASM_SOURCES rtl/tsan_rtl_amd64.S rtl/tsan_rtl_aarch64.S)
 
-  set(TSAN_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS})
-
   add_weak_symbols("ubsan" WEAK_SYMBOL_LINK_FLAGS)
   add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS)
 
@@ -202,6 +203,7 @@
               $<TARGET_OBJECTS:RTUbsan.${arch}>
       ADDITIONAL_HEADERS ${TSAN_HEADERS}
       CFLAGS ${TSAN_RTL_CFLAGS}
+      LINK_LIBS ${TSAN_LINK_LIBS}
       PARENT_TARGET tsan)
     add_compiler_rt_runtime(clang_rt.tsan_cxx
       STATIC


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59163.189960.patch
Type: text/x-patch
Size: 1276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190309/b2a1cd37/attachment.bin>


More information about the llvm-commits mailing list