[Lldb-commits] [PATCH] D60180: [CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone builds

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 5 11:49:07 PDT 2019


xiaobai added a comment.

In D60180#1456263 <https://reviews.llvm.org/D60180#1456263>, @sgraenitz wrote:

> > No, everything is being built for android. Cross-compiling lldb-server involves cross-compiling llvm libraries, clang libraries, and if you've got swift in the picture, swift host libraries. LLVM and clang libraries are built against the libc++ from the android NDK, but in standalone builds, LLDB will try to link against the freshly built libc++ from LLVM. You get loads of undefined references to symbols from the NDK's libc++.
>
> For the `link_directories` line: if you cross-compile the entire tree and this tree contains libc++, wouldn't it be natural that LLDB will try to link against the freshly built libc++?
>  If this is not your intention, then maybe we need a `LLDB_EXTERNAL_LIBCXX` option instead?


I don't agree that this is the natural thing to do. From my perspective, you should be using the same sysroot to build LLVM and LLDB. In my specific problem, when you build any of the lldb tools (e.g. lldb-server) it fails to link because you are building the tool against the freshly built libc++ but the llvm libraries you had previously built were linked against the NDK's libc++.

In D60180#1456239 <https://reviews.llvm.org/D60180#1456239>, @sgraenitz wrote:

> > If there's a situation where any of these variables don't get propagated from the LLVMConfig, I'd like to know about it so I can add comments above these variables explaining why these variables are set since it's non-obvious just from grepping the lldb tree.
>
> It's usually a good idea to check both, the LLVMConfig.cmake from a build-tree and from an install-tree. They are quite different and LLDB standalone should work with both.
>
> You can check the green dragon bot that we added recently: http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-standalone/
>  It builds against both versions (and BTW it also dumps CMake cache entries).


Ooh, I like this bot. Thanks for pointing it out!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60180/new/

https://reviews.llvm.org/D60180





More information about the lldb-commits mailing list