From 067b6edc1f1fbec73c8fb389bbdf77b4548cd806 Mon Sep 17 00:00:00 2001 From: Sagar Thakur Date: Wed, 29 Jun 2016 12:30:18 +0000 Subject: [PATCH] [LLDB][MIPS] Check if libatomic needs to be specified explicitly Patch by Nitesh Jain. Summary : The problem appears while linking liblldb.so. The class Address contain atomic variable m_offset. The loading and storing of variable is access via atomic_load_8 and atomic_store_8 functions. Some target fail to implicitly link libatomic, which cause undefine reference to atomic_store_8/atomic_load_8. This patch uses http://reviews.llvm.org/D20896 to check if libatomic need to be explicitly link. Reviewed by labath. Differential: D20464 llvm-svn: 274121 --- lldb/cmake/LLDBDependencies.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lldb/cmake/LLDBDependencies.cmake b/lldb/cmake/LLDBDependencies.cmake index 370bdca3f325..67d110e0a544 100644 --- a/lldb/cmake/LLDBDependencies.cmake +++ b/lldb/cmake/LLDBDependencies.cmake @@ -157,6 +157,11 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" AND NOT __ANDROID_NDK__) endif() endif() endif() + +if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) + list(APPEND LLDB_SYSTEM_LIBS atomic) +endif() + # On FreeBSD/NetBSD backtrace() is provided by libexecinfo, not libc. if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD") list(APPEND LLDB_SYSTEM_LIBS execinfo)