1.3 Source code compilation
We are compiling our source code in debug mode to make it suitable for future investigations with a debugger. We are using LLDB as the debugger. We will start with an overview of the build process and finish building the LLDB as a concrete example.
1.3.1 Configuration with CMake
Create a build folder where the compiler and related tools will be built:
$ mkdir build $ cd build
The minimal configuration command looks like this:
$ cmake -DCMAKE_BUILD_TYPE=Debug ../llvm
The command requires the build type to be specified (e.g. Debug
in our case) as well as the primary argument that points to a folder with the build configuration file. The configuration file is stored as CMakeLists.txt
and is located in the llvm
folder, which explains the ../llvm
argument usage. The command generates Makefile
located in the build folder, thus you can use the simple make
command to start the build process.