[llvm-dev] Building SVN head with CMake - shared libraries?

Dan Liew via llvm-dev llvm-dev at lists.llvm.org
Sat Jan 16 11:33:20 PST 2016


> I am trying to enable this on openSUSE but it seems to break
> standalone lldb (note that we don't ship static libs):
>
> cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
> -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DLLVM_BUILD_LLVM_DYLI
> B=ON -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_INSTALL_PREFIX=/usr
> -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_LIBDIR_SUFFIX=64 -DLLDB_PA
> TH_TO_LLVM_BUILD=/usr -DLLDB_PATH_TO_CLANG_BUILD=/usr
> -DLLVM_RUNTIME_OUTPUT_INTDIR=/home/abuild/rpmbuild/BUILD/lldb-3.8.0/buil
> d/bin -DLLVM_LIBRARY_OUTPUT_INTDIR=/home/abuild/rpmbuild/BUILD/lldb-3.8.0/build/lib64
> -DPYTHON_VERSION_MAJOR=2 -DPYTHON_VERSIO
> N_MINOR=7 -G Ninja ..
>
> [...]
>
> CMake Error at /usr/share/llvm/cmake/LLVMExports.cmake:1011 (message):
>   The imported target "LLVMSupport" references the file
>
>       "/usr/lib64/libLLVMSupport.a"

Could you try appending ``-DLLVM_LINK_LLVM_DYLIB=ON`` to your CMake
invocation? It looks like lldb is using the ``llvm_add_library()``
function in the ``cmake/modules/AddLLVM.cmake`` (LLVM source tree)
which uses ``LLVM_LINK_LLVM_DYLIB`` (and a few other variables) to
decide whether to link against LLVM's static component libraries or
the monolithic shared library. I could be wrong on this though but it
should
be pretty quick to check.

Out of curiosity though if you're building packages on openSUSE why do
you need a standalone build? I thought the normal way to do this was
to build everything and then generate split packages?

Thanks,
Dan.


More information about the llvm-dev mailing list