5

Right now, while working on my laptop (amd64), I can already compile code through SSH on a BeagleBone (armhf).

What I'm trying to do now, is being able to use any IDE to debug that code (Code::Blocks, KDevelop, or Qt Creator).

So, I thought of running gdbserver on the BeagleBone, and connecting to it, but it gives me an error of unexpected value on reply. I read about it, and it seems I need to locally build an armhf executable, for gdb to process. But I guess it also needs an armhf-oriented gdb built for amd64, so I tried installing crossbuild-essential-armhf. For that, I added the armhf architecture with dpkg --add-architecture armhf, but then I'm unable to do an apt-get update. I get a whole lot of these:

Err http://security.ubuntu.com trusty-security/main armhf Packages             
  404  Not Found [IP: 2001:67c:1562::13 80]

If I check the repos, they indeed do not have armhf anywhere.

So, what am I doing wrong? Also, is this the correct way to remote debug with a different architecture, or is there any better way to do it?

9

Ubuntu uses separate repos for armh (i.e. http://ports.ubuntu.com/). To be able to install crossbuild-essential-armhf successfully you have to follow these steps:

  1. run dpkg --add-architecture armhf
  2. specify the correct architecture for ALL your apt deb lines in /etc/apt/sources.list and /etc/apt/sources.list.d, for example:

    deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu trusty main universe
    deb [arch=armhf] http://ports.ubuntu.com/ trusty main universe
    

    Note that it does not make sense to specify the arch for deb-src lines.

  3. run apt-get update
  4. run apt-get install crossbuild-essential-armhf

Have a look at https://wiki.debian.org/Multiarch/HOWTO

You may also want to execute these commands in a chroot (or docker container maybe) as mentioned by this guide: http://www.cnx-software.com/2012/05/02/getting-started-with-multiarch-armel-armhf-in-ubuntu/

1

There is a rich choice of Docker based cross compilers here :

https://github.com/dockcross/dockcross

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.