Fail to compile LLDB 3.4

hi,

i am trying to compile lldb 3.4 with clang 3.4, but got some errors as below.

any idea how to fix this??

many thanks,

Jun

$ clang -v
clang version 3.4 (tags/RELEASE_34/final)
Target: i386-pc-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/…/lib/gcc/i686-linux-gnu/4.6
Found candidate GCC installation: /usr/bin/…/lib/gcc/i686-linux-gnu/4.6.3
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6.3
Selected GCC installation: /usr/bin/…/lib/gcc/i686-linux-gnu/4.6

$ configure --prefix=/usr --enable-cxx11
$ make ENABLE_OPTIMIZED=1 DEBUG_SYMBOLS=0


In file included from Driver.cpp:20:
In file included from /usr/bin/…/lib/gcc/i686-linux-gnu/4.6/…/…/…/…/include/c++/4.6/thread:38:
/usr/bin/…/lib/gcc/i686-linux-gnu/4.6/…/…/…/…/include/c++/4.6/chrono|535 col 6| error: no matching constructor for initialization of ‘duration’ (aka ‘std::chrono::duration<long long, std::ratio<1, 1000000> >’)
: __d(__t.time_since_epoch())
^ ~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/…/lib/gcc/i686-linux-gnu/4.6/…/…/…/…/include/c++/4.6/condition_variable|106 col 42| note: in instantiation of function template specialization ‘std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long long, std::ratio<1, 1000000> > >::time_point<std::chrono::duration<long long, std::ratio<1, 1000000000> > >’ requested here
const __clock_t::time_point __s_atime = __s_entry + __delta;
^
/usr/bin/…/lib/gcc/i686-linux-gnu/4.6/…/…/…/…/include/c++/4.6/chrono|234 col 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/bin/…/lib/gcc/i686-linux-gnu/4.6/…/…/…/…/include/c++/4.6/chrono|237 col 19| note: candidate template ignored: disabled by ‘enable_if’ [with _Rep2 = std::chrono::duration<long long, std::ratio<1, 1000000000> >]
enable_if<is_convertible<_Rep2, rep>::value
^
/usr/bin/…/lib/gcc/i686-linux-gnu/4.6/…/…/…/…/include/c++/4.6/chrono|244 col 19| note: candidate template ignored: disabled by ‘enable_if’ [with _Rep2 = long long, _Period2 = std::ratio<1, 1000000000>]
enable_if<treat_as_floating_point::value
^
/usr/bin/…/lib/gcc/i686-linux-gnu/4.6/…/…/…/…/include/c++/4.6/chrono|232 col 12| note: candidate constructor not viable: requires 0 arguments, but 1 was provided
constexpr duration() : __r() { }
^
1 error generated.
make[4]: *** [/home/jun/Downloads/llvm-3.4/tools/lldb/tools/driver/Release+Debug+Asserts/Driver.o] Error 1
make[4]: Leaving directory `/home/jun/Downloads/llvm-3.4/tools/lldb/tools/driver’

Any help, please??

Thanks.

It looks like a C++11 issue with the compiler you are compiling with. LLDB requires C++11 in order to build. You can try a newer GCC (4.8) or top of tree clang.

Greg

Hi Jun,

We’ve been using the following setup:

Ubuntu 12.04
gcc 4.8.2
latest libedit from here

We make sure we modify our LD_LIBRARY_PATH to include the gcc 4.8.2’s libstdc++ (needed to solve the issue of having an old libstdc++ in Ubuntu 12.04) and the newer libedit. Technically I don’t think you’ll need the new libedit until the iohandler branch gets merged into trunk, but you’ll likely need it at some point if you’re on a similar setup to us and if you build from top of tree.

I had played around with several options to get lldb built with clang on Ubuntu 12.04 x86_64 a couple months ago but gave up due to errors on each of several different approaches (using a clang bootstrapped with gcc 4.8.x, using a clang from the official llvm.org precise build, using a clang with a built libc++, etc.) At some point I’ll get back to looking at those combinations, but for now the gcc 4.8.2 path works well for us.

Hope that helps!

-Todd