[lldb-dev] lldb-server link failure with shared library configuration
Tamas Berghammer via lldb-dev
lldb-dev at lists.llvm.org
Wed Aug 30 03:55:34 PDT 2017
Hi Peeter,
Why do you have to make the dependency conditional on
BUILD_SHARED_LIBS? If lldbExpression
depends on LLVMRuntimeDyld it should depend on it independently of the
build config.
Also I gave it a try to build lldb using shared libraries locally and I
haven't hit any issue when I used the following command (on Ubuntu
14.04): cmake ../../llvm -G Ninja -DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=true
Are you using some other cmake flags as well? Also can you check the link
command used for the final linking step if it contains LLVMRuntimeDyld
without your change? Can it be just a library ordering issue where some
symbols are dropped before they are used?
Cheers,
Tamas
On Wed, Aug 30, 2017 at 12:50 AM Peeter Joot <peeterjoot at protonmail.com>
wrote:
> Hi Tamas,
>
> I was able to use your suggestion as follows:
>
> diff --git a/source/Expression/CMakeLists.txt
> b/source/Expression/CMakeLists.txt
>
> index 7d9643a..b53b095 100644
>
> --- a/source/Expression/CMakeLists.txt
>
> +++ b/source/Expression/CMakeLists.txt
>
> @@ -2,6 +2,12 @@ if(NOT LLDB_BUILT_STANDALONE)
>
> set(tablegen_deps intrinsics_gen)
>
> endif()
>
>
> +set(LLDB_EXP_DEPS)
>
> +
>
> +if(BUILD_SHARED_LIBS)
>
> + list(APPEND LLDB_EXP_DEPS LLVMRuntimeDyld)
>
> +endif()
>
> +
>
> add_lldb_library(lldbExpression
>
> DiagnosticManager.cpp
>
> DWARFExpression.cpp
>
> @@ -30,6 +36,7 @@ add_lldb_library(lldbExpression
>
> lldbTarget
>
> lldbUtility
>
> lldbPluginExpressionParserClang
>
> + ${LLDB_EXP_DEPS}
>
>
> LINK_COMPONENTS
>
> Core
>
> and was able to successfully build the lldb-server.
>
> --
> Peeter
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20170830/dd611c93/attachment.html>
More information about the lldb-dev
mailing list