[lldb-dev] How to compile lldb?

Vince Harron vharron at google.com
Sat Nov 22 02:24:31 PST 2014


Hi Arne,

Sorry for not reading your message closer the first time.

These are roughly the steps we follow to build

Host setup (for Ubuntu 14.04, obviously debian steps may differ)

sudo apt-get update
sudo apt-get install build-essential cmake ninja-build git libedit-dev
ncurses-dev python-dev swig clang-3.5 ccache binutils-gold

Download & Build

(lldb_configure.py really just invokes cmake)


ROOT_DIR=$HOME/ll/svn
mkdir -p $ROOT_DIR/build
cd $ROOT_DIR
svn co https://llvm.org/svn/llvm-project/lldb/trunk lldb
svn co https://llvm.org/svn/llvm-project/llvm/trunk llvm
svn co https://llvm.org/svn/llvm-project/cfe/trunk clang
git clone http://github.com/tfiala/lldb-tools
cd llvm/tools
ln -s ../../clang clang
ln -s ../../lldb lldb
cd $ROOT_DIR/build
CC='ccache clang -Qunused-arguments -fcolor-diagnostics' CXX='ccache
clang++ -Qunused-arguments -fcolor-diagnostics' cmake -GNinja
-DCMAKE_LINKER=ld.gold -DCMAKE_CXX_FLAGS= -DCMAKE_SHARED_LINKER_FLAGS=
-DCMAKE_EXE_LINKER_FLAGS= -DCMAKE_INSTALL_PREFIX:PATH=$ROOT_DIR/install
-DCMAKE_BUILD_TYPE=Release -Wno-dev ../llvm
ninja
ninja check-lldb

You can probably drop ccache and the compiler flags from CC and CXX

Vince



On Fri, Nov 21, 2014 at 7:44 AM, Siva Chandra <sivachandra at google.com>
wrote:

> 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++.
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>



-- 

Vince Harron | Technical Lead Manager | vharron at google.com | 858-442-0868
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20141122/a06e9c87/attachment.html>


More information about the lldb-dev mailing list