[Lldb-commits] [lldb] r239007 - [lldb] Enable building with Cmake/BUILD_SHARED_LIBS

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 2 14:18:16 PST 2015


Resending to the correct mailing list.

On Mon, Nov 2, 2015 at 2:17 PM Zachary Turner <zturner at google.com> wrote:

> Hi Andrew,
>
> 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 (
> http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20151102/024878.html) for
> more information in case you're interested in resubmitting after you figure
> out the correct fix.
>
> On Wed, Jun 3, 2015 at 8:56 PM Andrew Wilkins <axwalk at gmail.com> wrote:
>
>> Author: axw
>> Date: Wed Jun  3 22:12:37 2015
>> New Revision: 239007
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=239007&view=rev
>> Log:
>> [lldb] Enable building with Cmake/BUILD_SHARED_LIBS
>>
>> Summary:
>> Several changes to fix CMake builds of LLDB with the
>> BUILD_SHARED_LIBS setting on.
>>
>> - Force all internal libraries to be built STATIC.
>> - Add additional library dependencies (pthread, dl,
>>   runtimedyld).
>> - modify finalisation of SWIG wrapper to symlink the
>>   "lib" dir into python/site-packages, so _lldb.so's
>>   RPATH resolves.
>>
>> Test Plan: Verified one test case with "dotest.py".
>>
>> Reviewers: sylvestre.ledru, zturner
>>
>> Reviewed By: zturner
>>
>> Subscribers: zturner, ted, tberghammer, emaste, lldb-commits
>>
>> Differential Revision: http://reviews.llvm.org/D10157
>>
>> Modified:
>>     lldb/trunk/cmake/LLDBDependencies.cmake
>>     lldb/trunk/cmake/modules/AddLLDB.cmake
>>     lldb/trunk/cmake/modules/LLDBConfig.cmake
>>     lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
>>     lldb/trunk/tools/lldb-server/CMakeLists.txt
>>
>> Modified: lldb/trunk/cmake/LLDBDependencies.cmake
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=239007&r1=239006&r2=239007&view=diff
>>
>> ==============================================================================
>> --- lldb/trunk/cmake/LLDBDependencies.cmake (original)
>> +++ lldb/trunk/cmake/LLDBDependencies.cmake Wed Jun  3 22:12:37 2015
>> @@ -169,6 +169,7 @@ set( LLVM_LINK_COMPONENTS
>>    core
>>    mcdisassembler
>>    executionengine
>> +  runtimedyld
>>    option
>>    support
>>    )
>>
>> Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=239007&r1=239006&r2=239007&view=diff
>>
>> ==============================================================================
>> --- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
>> +++ lldb/trunk/cmake/modules/AddLLDB.cmake Wed Jun  3 22:12:37 2015
>> @@ -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
>>
>> Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=239007&r1=239006&r2=239007&view=diff
>>
>> ==============================================================================
>> --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
>> +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Wed Jun  3 22:12:37 2015
>> @@ -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()
>>
>> Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=239007&r1=239006&r2=239007&view=diff
>>
>> ==============================================================================
>> --- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original)
>> +++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Wed Jun  3 22:12:37
>> 2015
>> @@ -304,6 +304,8 @@ def make_symlink( vDictArgs, vstrFramewo
>>              # 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, vst
>>                  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);
>>
>> Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=239007&r1=239006&r2=239007&view=diff
>>
>> ==============================================================================
>> --- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)
>> +++ lldb/trunk/tools/lldb-server/CMakeLists.txt Wed Jun  3 22:12:37 2015
>> @@ -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
>>
>>
>> _______________________________________________
>> lldb-commits mailing list
>> lldb-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151102/eed2c788/attachment.html>


More information about the lldb-commits mailing list