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

Vince Harron vharron at google.com
Fri Jan 9 23:17:25 PST 2015


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150109/a55b5f69/attachment.html>


More information about the lldb-commits mailing list