From 68b3e87263243a32f677e2bf56ed5060a0e9da3a Mon Sep 17 00:00:00 2001 From: Viktor Kutuzov Date: Wed, 17 Sep 2014 07:54:46 +0000 Subject: [PATCH] Do not link the dyndd runtime library against libdl on FreeBSD Differential Revision: http://reviews.llvm.org/D5207 llvm-svn: 217944 --- compiler-rt/lib/tsan/dd/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/tsan/dd/CMakeLists.txt b/compiler-rt/lib/tsan/dd/CMakeLists.txt index 932872155f1b..0c9f601dcdf2 100644 --- a/compiler-rt/lib/tsan/dd/CMakeLists.txt +++ b/compiler-rt/lib/tsan/dd/CMakeLists.txt @@ -22,6 +22,10 @@ set(DD_HEADERS dd_rtl.h ) +set(DD_LINKLIBS) +append_if(COMPILER_RT_HAS_LIBDL dl DD_LINKLIBS) +append_if(COMPILER_RT_HAS_LIBPTHREAD pthread DD_LINKLIBS) + add_custom_target(dd) # Deadlock detector is currently supported on 64-bit Linux only. if(CAN_TARGET_x86_64 AND UNIX AND NOT APPLE AND NOT ANDROID) @@ -43,7 +47,7 @@ if(CAN_TARGET_x86_64 AND UNIX AND NOT APPLE AND NOT ANDROID) $ $ $) - target_link_libraries(clang_rt.dyndd-${arch} pthread dl) + target_link_libraries(clang_rt.dyndd-${arch} ${DD_LINKLIBS}) endif() add_dependencies(compiler-rt dd)