summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/cmake/LLDBDependencies.cmake1
-rw-r--r--lldb/cmake/modules/AddLLDB.cmake9
-rw-r--r--lldb/cmake/modules/LLDBConfig.cmake8
-rw-r--r--lldb/scripts/Python/finishSwigPythonLLDB.py9
-rw-r--r--lldb/tools/lldb-server/CMakeLists.txt3
5 files changed, 26 insertions, 4 deletions
diff --git a/lldb/cmake/LLDBDependencies.cmake b/lldb/cmake/LLDBDependencies.cmake
index f1bcde40a3f..5b5898b3618 100644
--- a/lldb/cmake/LLDBDependencies.cmake
+++ b/lldb/cmake/LLDBDependencies.cmake
@@ -169,6 +169,7 @@ set( LLVM_LINK_COMPONENTS
core
mcdisassembler
executionengine
+ runtimedyld
option
support
)
diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake
index 3bf26884fc7..db7b1f62c7a 100644
--- a/lldb/cmake/modules/AddLLDB.cmake
+++ b/lldb/cmake/modules/AddLLDB.cmake
@@ -44,13 +44,14 @@ macro(add_lldb_library name)
set(libkind MODULE)
elseif (PARAM_SHARED)
set(libkind SHARED)
- elseif (PARAM_STATIC)
- set(libkind STATIC)
elseif (PARAM_OBJECT)
set(libkind OBJECT)
else ()
- # library type unspecified - controlled by BUILD_SHARED_LIBS
- unset(libkind)
+ # PARAM_STATIC or library type unspecified. BUILD_SHARED_LIBS
+ # does not control the kind of libraries created for LLDB,
+ # only whether or not they link to shared/static LLVM/Clang
+ # libraries.
+ set(libkind STATIC)
endif()
#PIC not needed on Win
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index de8db0c79d6..cea2f9af489 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -219,6 +219,14 @@ else()
endif()
+if (HAVE_LIBPTHREAD)
+ list(APPEND system_libs pthread)
+endif(HAVE_LIBPTHREAD)
+
+if (HAVE_LIBDL)
+ list(APPEND system_libs ${CMAKE_DL_LIBS})
+endif()
+
if(LLDB_REQUIRES_EH)
set(LLDB_REQUIRES_RTTI ON)
else()
diff --git a/lldb/scripts/Python/finishSwigPythonLLDB.py b/lldb/scripts/Python/finishSwigPythonLLDB.py
index 30759b55883..cf05cc9ca97 100644
--- a/lldb/scripts/Python/finishSwigPythonLLDB.py
+++ b/lldb/scripts/Python/finishSwigPythonLLDB.py
@@ -304,6 +304,8 @@ def make_symlink( vDictArgs, vstrFrameworkPythonDir, vstrSrcFile, vstrTargetFile
# llvm/build/lib/python2.7/site-packages/lldb
strBuildDir = os.path.join("..", "..", "..", "..");
strSrc = os.path.normcase(os.path.join(strBuildDir, vstrSrcFile));
+ strTargetDir = os.path.dirname(strTarget);
+ strSrc = os.path.relpath(os.path.abspath(strSrc), strTargetDir);
if eOSType == utilsOsType.EnumOsType.Unknown:
bOk = False;
@@ -371,6 +373,13 @@ def make_symlink_liblldb( vDictArgs, vstrFrameworkPythonDir, vstrLiblldbFileName
strLibFileExtn = ".so";
strSrc = os.path.join("lib", "liblldb" + strLibFileExtn);
+ if eOSType != utilsOsType.EnumOsType.Windows:
+ # Create a symlink to the "lib" directory, to ensure liblldb's RPATH is
+ # effective.
+ bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") );
+ if not bOk:
+ return (bOk, strErrMsg)
+
bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget );
return (bOk, strErrMsg);
diff --git a/lldb/tools/lldb-server/CMakeLists.txt b/lldb/tools/lldb-server/CMakeLists.txt
index 4fed20562e9..22acdd8bb10 100644
--- a/lldb/tools/lldb-server/CMakeLists.txt
+++ b/lldb/tools/lldb-server/CMakeLists.txt
@@ -29,6 +29,9 @@ if (BUILD_SHARED_LIBS )
)
target_link_libraries(lldb-server liblldb)
+ if (HAVE_LIBPTHREAD)
+ target_link_libraries(lldb-server pthread)
+ endif ()
else()
add_lldb_executable(lldb-server
lldb-gdbserver.cpp
OpenPOWER on IntegriCloud