Home | History | Annotate | Download | only in docs
      1 This document describes how to build a debug version of LLVM for use with
      2 LLDB, and how to make LLDB use it.  
      3 
      4 It assumes that you are using the Xcode 3 series (I used 3.2.4) to build 
      5 LLDB.  It also assumes that your shell is /bin/bash, and that you are
      6 currently at a shell prompt in a checked-out LLDB repository.
      7 
      8 1.	Check out LLVM and Clang from their repositories.  To determine
      9 	the revision to use, consult scripts/build-llvm.pl (this is done
     10 	in the first command line below).  !!! WARNING Do not use the
     11 	name "llvm" for your checkout, for reasons described in part 3
     12 	below.
     13 
     14 	$ export CLANG_REVISION=`cat scripts/build-llvm.pl | grep ^our.*llvm_revision | cut -d \' -f 2,2`
     15 	$ svn co -r $CLANG_REVISION http://llvm.org/svn/llvm-project/llvm/trunk llvm.checkout
     16 	$ svn co -r $CLANG_REVISION http://llvm.org/svn/llvm-project/cfe/trunk llvm.checkout/tools/clang
     17 
     18 2.	Configure LLVM/Clang with the proper options and compilers.  I use:
     19 
     20 	$ cd llvm.checkout
     21 	$ CC="cc -g -O0" CXX="c++ -g -O0" ./configure --disable-optimized --enable-assertions --enable-targets=x86_64,arm
     22 	$ CC="cc -g -O0" CXX="c++ -g -O0" make -j 2
     23 	$ cd ..
     24 
     25 3.	Create a link to the built LLVM.  !!! WARNING: Do not rename the
     26 	directory!  The LLVM builder script that runs as part of the Xcode
     27 	build keys off the fact that llvm/ is a symlink to recognize that
     28 	we are building with a custom debug build.
     29 
     30 	$ ln -sf llvm.checkout llvm
     31 
     32 4.	Make sure that your Xcode project is set up correctly.  Open
     33 	lldb.xcodeproj and do the following:
     34 
     35 	Under "Targets" in the Groups & Files navigator, double-click
     36 	lldb-tool.  In the resulting window, select "Debug" from the
     37 	"Configuration:" drop-down.  Then, make sure that the setting
     38 	"Build Active Architecture Only" is enabled.  Close the window.
     39 
     40 	Under "Targets" in the Groups & Files navigator, double-click
     41 	LLDB.  In the resulting window, select "Debug" from the
     42 	"Configuration:" drop-down.  Then, make sure that the setting
     43 	"Build Active Architecture Only" is enabled.  Close the window.
     44 
     45 5.	Ensure that Xcode is building the lldb-tool target in Debug 
     46 	configuration for your architecture (typically x86_64).  You
     47 	can usually pick these options from the Overview drop-down at
     48 	the top left of the Xcode window.
     49 
     50 6.	Build lldb.xcodeproj.