[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
This commit is contained in:
Sagar Thakur 2016-06-29 12:30:18 +00:00
parent 56fac57b57
commit 067b6edc1f
1 changed files with 5 additions and 0 deletions

View File

@ -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)