From 3c6aa277b91e825bed8510f8060fcd643782678d Mon Sep 17 00:00:00 2001
From: Greg Clayton So for example, on a Fedora system one might say: So for example, on a Fedora system one might run: If building using GCC instead of Clang, GCC 4.6.2 or newer is recommended. On an Ubuntu system one might run: If building using GCC instead of Clang, GCC 4.6.2 or newer is required. In general, LLDB requires specific revisions of both LLVM and Clang in order to
- build. This requirement insulates LLDB a bit from the constant development
- happening in both of these projects. The required revision can be discovered by
- consulting the Perl script $lldb/scripts/build-llvm.pl and locating the
- $llvm_revision variable. At the time of this writing, the required revision
- is r127682, so we might check and revert our LLVM and Clang trees to the
- required state as follows: In general, building the LLDB trunk revision requires trunk revisions of both
+ LLVM and Clang.
It is highly recommended that you build the system out of tree. Create a second
build directory and configure the LLVM project tree to your specifications as
- outlined in LLVM’s Getting Started Guide. For Linux development the x86
- backend and JIT compiler should be enabled. A typical build procedure might be:> yum install swig python-devel libedit-devel
- > sudo apt-get install swig python-dev libedit-dev
+
> svn co http://llvm.org/svn/llvm-project/lldb/trunk lldb
- > grep -m 1 llvm_revision $lldb/scripts/build-llvm.pl
-
-
+
our $llvm_revision = "127682";
-
> cd $clang
-
> svn update -r 127682
-
> cd $llvm
-
> svn update -r 127682
> cd $llvm/..
> mkdir build
> cd build
-
> $llvm/configure --enable-targets=x86 --enable-jit --enable-libcpp
-
> make CXXFLAGS+=c++11
-
+ Note that once both LLVM and Clang have been configured and built it is not necessary to perform a top-level make to rebuild changes made only to LLDB. - You can build from the build/tools/lldb subdirectory as well. If your - compiler doesn't support c++11 or libc++, you may need to tweak or remove the last - parameter to the configure script and make command.
+ You can run make from the build/tools/lldb subdirectory as well. If your + compiler doesn't support libc++, you may need to tweak or remove the last + parameter to the configure script.LLDB has a Python scripting capability and supplies it’s own Python module, - lldb.py, built alongside the lldb binary. Python needs to know where to - look for this module when LLDB starts up. There are two options available:
-Keep a copy of lldb.py in the current working directory when starting lldb.
-Set PYTHONPATH to point to the directory holding lldb.py.
-In bash with a Debug+Asserts build (the default if configure is invoked + like in the example on this page) one might run:
+> export PYTHONPATH=$llvm/build/Debug+Asserts/lib/python2.7/site-packages
+ If you used different configure flags, or have a different version of python, + you may need to adjust the above to suit your needs. To test that the lldb python module + is built correctly and is available to Python, run:
+> python -c 'import lldb'
@@ -143,4 +132,4 @@