lldb on BeagleBone Black

Dr. Rolf Jansen rj at obsigna.com
Fri Jan 13 23:48:28 UTC 2017


> Am 11.01.2017 um 14:43 schrieb Michal Meloun <melounmichal at gmail.com>:
> On 11.01.2017 14:20, Dr. Rolf Jansen wrote:
>>> 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.
>> 
>> I will now try a non-ports build of LLVM 3.91 for the armv6 target only.
>> 
>> Best regards
>> 
>> Rolf
> 
> Latest buildable llvm is 37. Any newer fails with overflow for
> R_ARM_CALL relocation.
> Michal

Michal, thank you very much for your hint.

I started with the non-ports build of LLVM 3.91 for the ARM target already once I received your message, and for the sake of satisfying my curiosity I let it go. As a matter of fact, building and installing completed successfully, only it took apprx. 48 h.

   cmake .. -DLLVM_TARGETS_TO_BUILD="ARM" -DCMAKE_BUILD_TYPE=Release -G Ninja
   ninja lldb install

However, the resulting lldb fails to run any target, even the simplest hello-world one crashes.

    # lldb -- hello
   (lldb) target create "hello"
   Current executable set to 'hello' (arm).
   (lldb) run
   Process 592 launching
   Process 592 launched: '/root/install/hello' (arm)
   Process 592 stopped
   * thread #1: tid = 100089, 0x000083a8 hello, stop reason = signal SIGILL: illegal instruction
       frame #0: 0x000083a8 hello
   hello`:
   ->  0x83a8 <+0>:  mov    r5, r2
       0x83ac <+4>:  mov    r4, r1
       0x83b0 <+8>:  mov    r3, r0
       0x83b4 <+12>: ldr    r0, [sp]


I am now building LLVM 37 from the ports on the BeagleBone Black running FreeBSD 12.0-CURRENT. I will let you now the results.

Best regards

Rolf



More information about the freebsd-arm mailing list