Building lldb with llvm BUILD_SHARED_LIBS

Hi all,

I've just trying to build the latest lldb/llvm with
BUILD_SHARED_LIBS/DEBUG On linux:
- llvm: 1f22900
- lldb: 942b4a2
- ld: 2.24.51 (binutils for debian)

And got some errors about undefined references, for most of additional
libraries, that exist in lldbCore mostly.
And then I came with the patch [ADD_LLDB_LIBRARY.PATCH], but even after
this patch lldb didn't built successfully for me, and the reason was in
inter-libs dependencies, and here is the cmake error message after I add
tried to resolve them:
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
  "lldbTarget" of type SHARED_LIBRARY
    depends on "lldbCore" (weak)
  "lldbCore" of type SHARED_LIBRARY
    depends on "lldbTarget" (weak)
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.

Indeed:
- lldbCore depends from lldbTarget
- lldbTarget depends from lldbCore

So after this I came with another patch, that just allows undefined
references in object files [CMAKE_SHARED_LINKER_FLAGS.PATCH].
But it is a bit hackish, and so if somebody have ideas/existing solution
for this problem please post here.

Cheers,
Azat.

CMAKE_SHARED_LINKER_FLAGS.PATCH (749 Bytes)

ADD_LLDB_LIBRARY.PATCH (3.58 KB)

I think the correct fix is to make lldbCore not depend on lldbTarget. The next best fix would be to make core and target not build as shared libs