lldb on BeagleBone Black
Dr. Rolf Jansen
rj at obsigna.com
Sun May 28 14:35:04 UTC 2017
This is only a follow-up notice.
I reliably managed to build (lldb + clang/lld) from the svn trunk of LLVM 5.0.0 on my Beaglebone Black running the latest snapshot (May 20th) of FreeBSD 12.0-CURRENT, and the lldb is working very well, and this includes single stepping and ncurses-GUI mode, while single stepping with the latest lldb 4.0.1 from the ports does not work.
In order to reliably build LLVM 5.0.0 (svn), I set up a 1 GB swap partition for the BBB on a NFSv4 share on a FreeBSD fileserver in my network - I put a howto of the procedure on my BLog:
https://obsigna.net/?p=659
Eventually this prevents, that building LLVM fails because of job running out of memory was killed.
The build directory resides on a NFSv4 share on that fileserver as well – note, NFSv3 gives errors with subversion.
The prerequesites on the Beaglebone are:
# pkg install tmux
# pkg install cmake
# pkg install python
# pkg install libxml2
# pkg install swig30
# pkg install ninja
# pkg install subversion
On the FreeBSD fileserver:
# /path_to_the/bbb_share
# 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/lld/trunk lld
# svn co http://llvm.org/svn/llvm-project/lldb/trunk lldb
On the Beaglebone Black:
# mount_nfs -o noatime,readahead=4,intr,soft,nfsv4 server:/path_to_the/bbb_share /mnt
# cd /mnt
# mkdir build
# cmake -DLLVM_TARGETS_TO_BUILD="ARM" -DCMAKE_BUILD_TYPE="MinSizeRel" \
-DLLVM_PARALLEL_COMPILE_JOBS="1" -DLLVM_PARALLEL_LINK_JOBS="1" -G Ninja ..
I execute the actual build command from within a tmux session, so I may disconnect during the quite long (40 h) build:
# tmux new "ninja lldb install"
When debugging in GUI mode using the newly build lldb 5.0.0-svn, I see only a minor issue, namely UTF8 strings are not displayed correctly. This happens in the ncurses-GUI only, and this is an ARM issue, since it does not occur on x86 machines. Perhaps this might be related to the signed/unsigned char mismatch between ARM and x86.
Best regards
Rolf
> Am 11.01.2017 um 11:20 schrieb Dr. Rolf Jansen <rj at obsigna.com>:
>
>> Am 09.01.2017 um 00:59 schrieb Dr. Rolf Jansen <rj at obsigna.com>:
>>
>> I am running FreeBSD 12.0-CURRENT (BEAGLEBONE) #0 r311461: Fri Jan 6 03:13:01 UTC 2017
>>
>> Does any of the llvm ports build on the BBB? I am looking for a working lldb, and pre-build packages are not available, and I fear there is a certain reason why not -- perhaps build failures?
>>
>> Therefore, is it actually possible to obtain a working lldb (with gui option) for armv6 by building e.g. devel/llvm-devel on my BeagleBone Black?
>>
>> Which of the llvm-ports would be most promising?
>
> I tried building devel/llvm-devel having the ports tree attached on a fast USB disk. After 36 h of building it bailed out because of some obscure error in the AArch64 code generator.
>
> Finally, I don't think that building any LLVM port is viable on the BBB, first because building takes forever. The BBB needs 1 minute for compiling a C++ file which got only 20 lines of code. Of course this comes because the C++ experts tend for some ingenious reasons to hide all the implementations into the headers which need then to be compiled again and again. Second, it doesn't make sense at all to build LLVM for all the possible targets on a machine which I will never ever use for cross-development.
More information about the freebsd-arm
mailing list