[Lldb-commits] OSX cmake+ninja build broken by [lldb] r225398 - lldb-platform - static link all llvm dependencies

Vince Harron vharron at google.com
Sun Jan 11 10:45:07 PST 2015


Thanks for the fix!  It LGTM.  I tested it on OSX and Linux and it seems to
be working.  I've put it up for review and submitted it because it's
blocking.

http://reviews.llvm.org/rL225611


On Sat, Jan 10, 2015 at 9:41 PM, Ilia K <ki.stfu at gmail.com> wrote:

> Hello,
>
> I just realized that it is blocking me too. Can we revert these changes?
>
> Thanks,
> Ilia
>
>
> On Sat, Jan 10, 2015 at 10:17 AM, Vince Harron <vharron at google.com> wrote:
>
>> Sorry, just seeing this now.  I'll take a look tomorrow morning.
>> On Jan 9, 2015 10:48 PM, "Bob Campbell" <bobcampbell_llvm at icloud.com>
>> wrote:
>>
>>> > On Jan 9, 2015, at 10:47 AM, Dawn Perchik <dperchik at embarcadero.com>
>>> wrote:
>>> >
>>> > Vince Harron <vharron <at> google.com> writes:
>>> >>
>>> >> Author: vharron
>>> >> Date: Wed Jan  7 15:35:07 2015
>>> >> New Revision: 225398
>>> >>
>>> >> URL: http://llvm.org/viewvc/llvm-project?rev=225398&view=rev
>>> >> Log:
>>> >> lldb-platform - static link all llvm dependencies
>>> >>
>>> >> Differential Revision: http://reviews.llvm.org/D6797
>>> >>
>>> >> lldb-gdbserver statically links all llvm dependencies. This allows
>>> >> dead stripping code and reduces total binary size.
>>> >>
>>> >> This change modifies lldb-plaform to static link llvm dependencies
>>> >> like lldb-gdbserver.
>>> >
>>> > Our upstream build has been broken since this commit and is preventing
>>> us from
>>> > merging.   Vince, can you please have a look?  Build errors are:
>>> >
>>> > [...]
>>> > Undefined symbols for architecture x86_64:
>>> >  "_liblldb_coreVersionString", referenced from:
>>> >      lldb_private::GetVersion() in lldb.cpp.o
>>> > ld: symbol(s) not found for architecture x86_64
>>> > clang: error: linker command failed with exit code 1 (use -v to see
>>> invocation)
>>> > [6/12] Linking CXX shared library lib/liblldb.3.6.0.dylib
>>> > ninja: build stopped: subcommand failed.
>>> >
>>> > Build commands used are:
>>> > cmake -G Ninja .. "-DLLVM_TARGETS_TO_BUILD=ARM;X86;AArch64" \
>>> >   -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++"
>>> -DCMAKE_BUILD_TYPE=Debug
>>> > ninja
>>>
>>> The change from:
>>>
>>> target_link_libraries(lldb-platform liblldb)
>>>
>>> to directly referencing the sources does not include some sources for
>>> Mac OS
>>> (and perhaps other hosts?) which are defined by the variables
>>> LLDB_WRAP_PYTHON
>>> and LLDB_VERS_GENERATED_FILE.
>>>
>>> Adding them back in, and also adding in the dependency to the target
>>> which generates these files seems to work.
>>>
>>> I have not extensively testing but this patch worked for me to build the
>>> target lldb-platform:
>>>
>>> diff --git a/tools/lldb-platform/CMakeLists.txt
>>> b/tools/lldb-platform/CMakeLists.txt
>>> index 1577765..d4a1e0a 100644
>>> --- a/tools/lldb-platform/CMakeLists.txt
>>> +++ b/tools/lldb-platform/CMakeLists.txt
>>> @@ -22,8 +22,14 @@ add_lldb_executable(lldb-platform
>>>    lldb-platform.cpp
>>>    ../../source/lldb-log.cpp
>>>    ../../source/lldb.cpp
>>> +  ${LLDB_WRAP_PYTHON}
>>> +  ${LLDB_VERS_GENERATED_FILE}
>>>    )
>>>
>>> +if (LLDB_WRAP_PYTHON OR LLDB_VERS_GENERATED_FILE)
>>> +  add_dependencies(lldb-platform swig_wrapper)
>>> +endif()
>>> +
>>>  # The Darwin linker doesn't understand --start-group/--end-group.
>>>  if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}"
>>> MATCHES "Darwin")
>>>    target_link_libraries(lldb-platform
>>>
>>>
>>> >
>>>
>>> > Thanks,
>>> > -Dawn
>>> >
>>> > PS: I'm using my work e-mail since burble.org is down - when it
>>> recovers you
>>> > might get another e-mail about this - if so, please ignore :) .
>>> >
>>> > _______________________________________________
>>> > lldb-commits mailing list
>>> > lldb-commits at cs.uiuc.edu
>>> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>>>
>>>
>>> _______________________________________________
>>> lldb-commits mailing list
>>> lldb-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>>>
>>
>> _______________________________________________
>> lldb-commits mailing list
>> lldb-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>>
>>
>


-- 

Vince Harron | Technical Lead Manager | vharron at google.com | 858-442-0868
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150111/ca0f3a2b/attachment.html>


More information about the lldb-commits mailing list