Index: cmake/LLDBDependencies.cmake =================================================================== --- cmake/LLDBDependencies.cmake +++ cmake/LLDBDependencies.cmake @@ -169,6 +169,7 @@ core mcdisassembler executionengine + runtimedyld option support ) Index: cmake/modules/AddLLDB.cmake =================================================================== --- cmake/modules/AddLLDB.cmake +++ cmake/modules/AddLLDB.cmake @@ -44,13 +44,14 @@ 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 Index: cmake/modules/LLDBConfig.cmake =================================================================== --- cmake/modules/LLDBConfig.cmake +++ cmake/modules/LLDBConfig.cmake @@ -219,6 +219,14 @@ 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() Index: scripts/Python/finishSwigPythonLLDB.py =================================================================== --- scripts/Python/finishSwigPythonLLDB.py +++ scripts/Python/finishSwigPythonLLDB.py @@ -304,6 +304,8 @@ # 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 @@ 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); Index: tools/lldb-server/CMakeLists.txt =================================================================== --- tools/lldb-server/CMakeLists.txt +++ tools/lldb-server/CMakeLists.txt @@ -29,6 +29,9 @@ ) 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