[lldb-dev] How to compile lldb?

Siva Chandra sivachandra at google.com
Fri Nov 21 07:44:15 PST 2014


On Fri, Nov 21, 2014 at 7:43 AM, Siva Chandra <sivachandra at google.com> wrote:
> On Fri, Nov 21, 2014 at 1:01 AM, Arne Schmitz <arne.schmitz at aixigo.de> wrote:
>> Hi everybody,
>>
>> I am still trying to build lldb on Debian Stable. I configured cmake like
>> this:
>>
>> cmake -DCMAKE_BUILD_TYPE="Release"
>> -DCMAKE_C_COMPILER=/export/source/clang/bin/clang
>> -DCMAKE_CXX_COMPILER=/export/source/clang/bin/clang++
>> -DCMAKE_INSTALL_PREFIX=/export/source/clang ..
>>
>> However, I think that the build tries to use my c++ stdlib provided by the
>> system gcc 4.7, and that this is the cause of the error:
>>
>> [ 91%] Building CXX object
>> tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/ThreadStateCoordinator.cpp.o
>> In file included from
>> /export/source/git/llvm/tools/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp:17:
>> In file included from
>> /export/source/git/llvm/tools/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.h:13:
>> In file included from
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/condition_variable:38:
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:540:6:
>> error: no matching constructor for initialization of 'duration' (aka
>>       'std::chrono::duration<long, std::ratio<1, 1000000> >')
>>           : __d(__t.time_since_epoch())
>>             ^   ~~~~~~~~~~~~~~~~~~~~~~
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/condition_variable:111:42:
>> note: in instantiation of function template specialization
>>       'std::chrono::time_point<std::chrono::system_clock,
>> std::chrono::duration<long, std::ratio<1, 1000000> >
>>       >::time_point<std::chrono::duration<long, std::ratio<1, 1000000000> >
>>>' requested here
>>         const __clock_t::time_point __s_atime = __s_entry + __delta;
>>                                                 ^
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:234:12:
>> note: candidate constructor not viable: no known conversion from
>>       'duration<[...], ratio<[...], 1000000000>>' to 'const duration<[...],
>> ratio<[...], 1000000>>' for 1st argument
>>         constexpr duration(const duration&) = default;
>>                   ^
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:237:19:
>> note: candidate template ignored: disabled by 'enable_if' [with _Rep2 =
>>       std::chrono::duration<long, std::ratio<1, 1000000000> >]
>>                enable_if<is_convertible<_Rep2, rep>::value
>>                          ^
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:244:19:
>> note: candidate template ignored: disabled by 'enable_if' [with _Rep2 =
>>       long, _Period2 = std::ratio<1, 1000000000>]
>> enable_if<treat_as_floating_point<rep>::value
>>                          ^
>> /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/chrono:232:12:
>> note: candidate constructor not viable: requires 0 arguments, but 1 was
>>       provided
>>         constexpr duration() : __r() { }
>>                   ^
>> 1 error generated.
>> make[2]: ***
>> [tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/ThreadStateCoordinator.cpp.o]
>> Error 1
>> make[1]: ***
>> [tools/lldb/source/Plugins/Process/Linux/CMakeFiles/lldbPluginProcessLinux.dir/all]
>> Error 2
>> make: *** [all] Error 2
>>
>> I also compiled and installed libcxx, so maybe I should switch to that? How
>> do I do that?
>
> I have never tried this, but may be add -DCMAKE_CXX_FLAGS=-stdlib=libstdc++?

Oops, it should be s/libstdc++/libc++.



More information about the lldb-dev mailing list