Trying to build the latest lldb.
A good introduction about lldb is this presentation at the Apple developper conference [1]. For something more focused on ARM, see [2], and for something more focused on FreeBSD, see [3] and [4].
Building from svn
The official build guide is [5]. There are git mirrors of each svn repository.
Get the sources:
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm cd llvm/tools svn co http://llvm.org/svn/llvm-project/cfe/trunk clang svn co http://llvm.org/svn/llvm-project/lldb/trunk lldb
Packages:
apt install cmake g++ swig python2.7-dev libedit-dev libncurses5-dev
Build:
mkdir build cd build cmake ../llvm make lldb
Test:
./bin/lldb (lldb) version lldb version 7.0.0 ( revision )
Cannot do anything with 8GB nowadays!
Linking liblldb.so is very pretty memory-consuming. 8GB is not enough:
[ 98%] Linking CXX shared library ../../../../lib/liblldb.so collect2: fatal error: ld terminated with signal 9 [Killed] compilation terminated. tools/lldb/source/API/CMakeFiles/liblldb.dir/build.make:2165: recipe for target 'lib/liblldb.so.7.0.0' failed
The linker was killed because both RAM and swap were full!
Create a additional temporary swap from file:
fallocate -l 512M /swapfile2 chmod 600 /swapfile2 mkswap /swapfile2 swapon /swapfile2
Building on scaleway ARM64
The version of swig provided by Ubuntu 16.04 and Debian Stretch is too old. Use Ubuntu 18.04 via docker. For installing docker on Ubuntu for ARM64, see [6].
docker run --rm -ti -v /home/vjp/lldb/:/root arm64v8/ubuntu:18.04
References
[1] | Apple WWDC2012. Session 415 - Debugging with LLDB, https://www.youtube.com/watch?v=R1SsByHiMWQ |
[2] | http://s3.amazonaws.com/connect.linaro.org/bud17/Presentations/BUD17-310%20-%20Introducing%20LLDB%20for%20Linux%20on%20Arm%20and%20AArch64.pdf |
[3] | https://wiki.freebsd.org/lldb |
[4] | https://www.youtube.com/watch?v=gT_YyMlIrdA |
[5] | https://lldb.llvm.org/build.html#cross-compilation |
[6] | https://wiki.archlinux.org/index.php/swap |
[7] | https://help.packet.net/armv8/docker-on-armv8 |
[8] | https://llvm.org/devmtg/2016-03/Tutorials/LLDB-tutorial.pdf |