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

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 8 01:14:35 PDT 2019


labath 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?


Well.. you definitely shouldn't link against the fresh libc++, but still use the headers from the system one (which I suspect is the cause of the undefined symbols Alex is seeing).

FWIW, I don't think cross-compilation should be a factor here. I can see somebody may want to build a fresh libc++ and then link llvm (all of it) against that, but that is true regardless of whether you're cross-compiling or not. However, I wouldn't expect this to be the default because then the built binaries wouldn't play well with anything else on this system, if the system happens to use a different C++ library (or just an incompatible version of libc++).


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60180





More information about the lldb-commits mailing list