From 3c6aa277b91e825bed8510f8060fcd643782678d Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Mon, 15 Oct 2012 20:39:39 +0000 Subject: [PATCH] Patch from Daniel Malea -- Updated build instructions for Linux. llvm-svn: 165964 --- lldb/www/build.html | 59 ++++++++++++++++++++++------------------------------- 1 file changed, 24 insertions(+), 35 deletions(-) diff --git a/lldb/www/build.html b/lldb/www/build.html index 4cd0e72..aaba083 100755 --- a/lldb/www/build.html +++ b/lldb/www/build.html @@ -61,9 +61,11 @@
  • libedit
  • Python
  • -

    So for example, on a Fedora system one might say:

    +

    So for example, on a Fedora system one might run:

    > yum install swig python-devel libedit-devel -

    If building using GCC instead of Clang, GCC 4.6.2 or newer is recommended.

    +

    On an Ubuntu system one might run:

    + > sudo apt-get install swig python-dev libedit-dev +

    If building using GCC instead of Clang, GCC 4.6.2 or newer is required.

    @@ -94,48 +96,35 @@
    > svn co http://llvm.org/svn/llvm-project/lldb/trunk lldb -

    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:

    - > 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
    - +

    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:

    + outlined in LLVM’s Getting Started Guide. A typical build procedure + might be:

    > cd $llvm/..
    > mkdir build
    > cd build -
    > $llvm/configure --enable-targets=x86 --enable-jit --enable-libcpp -
    > make CXXFLAGS+=c++11
    - +
    > $llvm/configure --enable-libcpp +
    > make CXXFLAGS=-std=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.

    Additional Notes

    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:

    -
      -
    1. -

      Keep a copy of lldb.py in the current working directory when starting lldb.

      -
    2. -
    3. -

      Set PYTHONPATH to point to the directory holding lldb.py.

      -
    4. -
    + lldb, built alongside the lldb binary. Python needs to know where to + look for this module when LLDB starts up. To tell python the location of LLDB, set + PYTHONPATH environment variable. +

    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 @@ - + -- 2.7.4