<div dir="ltr">Resending to the correct mailing list.<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 2, 2015 at 2:17 PM Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Andrew,<div><br></div><div>This CL has been in for quite a while, but apparently it was broken all this time. I reverted the changes to finishSwigPythonLLDB.py as they were creating a dangling symlink. Please see r251840 (<a href="http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20151102/024878.html" target="_blank">http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20151102/024878.html</a>) for more information in case you're interested in resubmitting after you figure out the correct fix.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 3, 2015 at 8:56 PM Andrew Wilkins <<a href="mailto:axwalk@gmail.com" target="_blank">axwalk@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: axw<br>
Date: Wed Jun 3 22:12:37 2015<br>
New Revision: 239007<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=239007&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=239007&view=rev</a><br>
Log:<br>
[lldb] Enable building with Cmake/BUILD_SHARED_LIBS<br>
<br>
Summary:<br>
Several changes to fix CMake builds of LLDB with the<br>
BUILD_SHARED_LIBS setting on.<br>
<br>
- Force all internal libraries to be built STATIC.<br>
- Add additional library dependencies (pthread, dl,<br>
runtimedyld).<br>
- modify finalisation of SWIG wrapper to symlink the<br>
"lib" dir into python/site-packages, so _lldb.so's<br>
RPATH resolves.<br>
<br>
Test Plan: Verified one test case with "dotest.py".<br>
<br>
Reviewers: sylvestre.ledru, zturner<br>
<br>
Reviewed By: zturner<br>
<br>
Subscribers: zturner, ted, tberghammer, emaste, lldb-commits<br>
<br>
Differential Revision: <a href="http://reviews.llvm.org/D10157" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10157</a><br>
<br>
Modified:<br>
lldb/trunk/cmake/LLDBDependencies.cmake<br>
lldb/trunk/cmake/modules/AddLLDB.cmake<br>
lldb/trunk/cmake/modules/LLDBConfig.cmake<br>
lldb/trunk/scripts/Python/finishSwigPythonLLDB.py<br>
lldb/trunk/tools/lldb-server/CMakeLists.txt<br>
<br>
Modified: lldb/trunk/cmake/LLDBDependencies.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=239007&r1=239006&r2=239007&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=239007&r1=239006&r2=239007&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)<br>
+++ lldb/trunk/cmake/LLDBDependencies.cmake Wed Jun 3 22:12:37 2015<br>
@@ -169,6 +169,7 @@ set( LLVM_LINK_COMPONENTS<br>
core<br>
mcdisassembler<br>
executionengine<br>
+ runtimedyld<br>
option<br>
support<br>
)<br>
<br>
Modified: lldb/trunk/cmake/modules/AddLLDB.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=239007&r1=239006&r2=239007&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=239007&r1=239006&r2=239007&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)<br>
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Wed Jun 3 22:12:37 2015<br>
@@ -44,13 +44,14 @@ macro(add_lldb_library name)<br>
set(libkind MODULE)<br>
elseif (PARAM_SHARED)<br>
set(libkind SHARED)<br>
- elseif (PARAM_STATIC)<br>
- set(libkind STATIC)<br>
elseif (PARAM_OBJECT)<br>
set(libkind OBJECT)<br>
else ()<br>
- # library type unspecified - controlled by BUILD_SHARED_LIBS<br>
- unset(libkind)<br>
+ # PARAM_STATIC or library type unspecified. BUILD_SHARED_LIBS<br>
+ # does not control the kind of libraries created for LLDB,<br>
+ # only whether or not they link to shared/static LLVM/Clang<br>
+ # libraries.<br>
+ set(libkind STATIC)<br>
endif()<br>
<br>
#PIC not needed on Win<br>
<br>
Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=239007&r1=239006&r2=239007&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=239007&r1=239006&r2=239007&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)<br>
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Wed Jun 3 22:12:37 2015<br>
@@ -219,6 +219,14 @@ else()<br>
<br>
endif()<br>
<br>
+if (HAVE_LIBPTHREAD)<br>
+ list(APPEND system_libs pthread)<br>
+endif(HAVE_LIBPTHREAD)<br>
+<br>
+if (HAVE_LIBDL)<br>
+ list(APPEND system_libs ${CMAKE_DL_LIBS})<br>
+endif()<br>
+<br>
if(LLDB_REQUIRES_EH)<br>
set(LLDB_REQUIRES_RTTI ON)<br>
else()<br>
<br>
Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=239007&r1=239006&r2=239007&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=239007&r1=239006&r2=239007&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original)<br>
+++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Wed Jun 3 22:12:37 2015<br>
@@ -304,6 +304,8 @@ def make_symlink( vDictArgs, vstrFramewo<br>
# llvm/build/lib/python2.7/site-packages/lldb<br>
strBuildDir = os.path.join("..", "..", "..", "..");<br>
strSrc = os.path.normcase(os.path.join(strBuildDir, vstrSrcFile));<br>
+ strTargetDir = os.path.dirname(strTarget);<br>
+ strSrc = os.path.relpath(os.path.abspath(strSrc), strTargetDir);<br>
<br>
if eOSType == utilsOsType.EnumOsType.Unknown:<br>
bOk = False;<br>
@@ -371,6 +373,13 @@ def make_symlink_liblldb( vDictArgs, vst<br>
strLibFileExtn = ".so";<br>
strSrc = os.path.join("lib", "liblldb" + strLibFileExtn);<br>
<br>
+ if eOSType != utilsOsType.EnumOsType.Windows:<br>
+ # Create a symlink to the "lib" directory, to ensure liblldb's RPATH is<br>
+ # effective.<br>
+ bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") );<br>
+ if not bOk:<br>
+ return (bOk, strErrMsg)<br>
+<br>
bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget );<br>
<br>
return (bOk, strErrMsg);<br>
<br>
Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=239007&r1=239006&r2=239007&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=239007&r1=239006&r2=239007&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)<br>
+++ lldb/trunk/tools/lldb-server/CMakeLists.txt Wed Jun 3 22:12:37 2015<br>
@@ -29,6 +29,9 @@ if (BUILD_SHARED_LIBS )<br>
)<br>
<br>
target_link_libraries(lldb-server liblldb)<br>
+ if (HAVE_LIBPTHREAD)<br>
+ target_link_libraries(lldb-server pthread)<br>
+ endif ()<br>
else()<br>
add_lldb_executable(lldb-server<br>
lldb-gdbserver.cpp<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
</blockquote></div></blockquote></div></div>