blob: ba49bbac365a69fcd3a095db22099a1702651c89 [file] [log] [blame]
Sean Callanan10691752010-11-18 03:56:17 +00001This document describes how to build a debug version of LLVM for use with
2LLDB, and how to make LLDB use it.
3
4It assumes that you are using the Xcode 3 series (I used 3.2.4) to build
5LLDB. It also assumes that your shell is /bin/bash, and that you are
6currently at a shell prompt in a checked-out LLDB repository.
7
81. 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
182. 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
253. 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
324. 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
455. 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
506. Build lldb.xcodeproj.