[lldb-dev] lldb-server link failure with shared library configuration

Pavel Labath via lldb-dev lldb-dev at lists.llvm.org
Thu Aug 31 10:02:08 PDT 2017


On 30 August 2017 at 13:12, Tamas Berghammer via lldb-dev
<lldb-dev at lists.llvm.org> wrote:
> I tried to build using the following command what should be a reasonably
> close approximation to the one you used (I don't have ICU installed at the
> moment) and it still links fine for me:
> CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -G Ninja ../../llvm
> -DBUILD_SHARED_LIBS=true -DLLVM_TARGETS_TO_BUILD='X86'
> -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=TRUE
> -DLLVM_OPTIMIZED_TABLEGEN=ON
>
> It would be great to understand what exactly causes the difference between
> the 2 cases by some sort of bisecting as I see nothing in the source code
> what would explain this. If changing from -DCMAKE_BUILD_TYPE=Debug to
> -DCMAKE_BUILD_TYPE=Release fixes the issue then it would be nice to diff the
> ninja build graph and the different cmake caches to try to figure out where
> the different starts.

Debug info tends to alter the order in which the linker pulls in
object files from archives (which matters a lot when you have a large
number of cyclical inter-archive dependencies like we do). In the past
I have needed to increase the LINK_INTERFACE_MULTIPLICITY property to
make lldb build in debug mode (although the release mode was fine). It
is possible increasing that number will fix things
(source/Core/CMakeLists.txt).

>
> Tamas
>
> On Wed, Aug 30, 2017 at 12:17 PM Peeter Joot <peeterjoot at protonmail.com>
> wrote:
>>
>> Hi Tamas,
>>
>> It looks like lldb-server only fails if I build with a Debug
>> configuration, which I didn't realize until now.  In Release configuration,
>> I don't need any changes to CMakefiles and lldb-server links without error.
>> My full build configuration in debug mode was:
>>
>> mkdir lldb50.1708110153
>>
>> cd lldb50.1708110153
>>
>> PATH=$PATH:/opt/lzlabs/bin
>>
>> CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake \
>>
>> -G \
>>
>> Ninja \
>>
>> ../llvm \
>>
>> -DBUILD_SHARED_LIBS=true \
>>
>> -DLLVM_TARGETS_TO_BUILD='X86' \
>>
>> -DCMAKE_BUILD_TYPE=Debug \
>>
>> -DLLVM_ENABLE_ASSERTIONS=TRUE \
>>
>> -DCMAKE_INSTALL_PREFIX=/home/pjoot/clang/lldb50.1708110153 \
>>
>> -DLLVM_OPTIMIZED_TABLEGEN=ON \
>>
>> -DICU_LIBRARY=/opt/lzlabs/lib64 \
>>
>> -DICU_INCLUDE_DIR=/opt/lzlabs/include
>>
>> Without any changes LLVMRuntimeDyld is not in the lldb-server link list,
>> so this is not an ordering issue.  I'm not sure why this ends up as an issue
>> only with Debug.
>>
>> --
>> Peeter
>>
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>


More information about the lldb-dev mailing list