← Back to team overview

ubuntu-phone team mailing list archive

Re: Compiling armhf binaries for a phone target - toolchain from where?

 

This is by no means an official answer, but when I work on powerd and the
openclipart scope example I just use a pbuilder. I usually use
pbuilder-scripts (apt-get install pbuilder-scripts), which makes setting up
a pbuilder easier. I don't see any online docs for it from a brief search,
so here's my 10 second overview:

pcreate -a armhf -d saucy saucy-armhf

Add any PPAs that you need when the terminal opens up.  I have the
phablet-team and daily-build-next in mine.

Then enter the pbuilder shell, I think it will bind mount ~/Projects by
default, so I usually put my code there. (You can add extra mounts in
~/.pbuilderrc)

ptest -p saucy-armhf

Once at this shell, install whatever build-deps you need, for example:
apt-get build-dep powerd

And compile away...

When it's time to test, I then install openssh-client in my pbuilder so I
can scp binaries to the phone.  (Note: you can also just add openssh-client
to the EXTRAPACKAGES= line in your ~/.pbuilderrc). Once you're done, just
close the terminal and it will set your pbuilder back to a pristine state.

There's a full howto on pbuilder here, but it does not cover the scripts:
https://wiki.ubuntu.com/PbuilderHowto




On Mon, Jul 15, 2013 at 5:59 AM, Josh Leverette <coder543@xxxxxxxxx> wrote:

> If the size of the program makes compiling the code on the device
> practical, then that would be my personally recommended place to compile
> it. But, cross compilation *should* work.
>
> This is what I found:
> http://askubuntu.com/questions/250696/cross-compile-for-arm
> On Jul 15, 2013 5:20 AM, "John McAleely" <john.mcaleely@xxxxxxxxxxxxx>
> wrote:
>
>> Hi,
>>
>> I have some C/C++ code that (eventually) I want to run on an Ubuntu Touch
>> phone or tablet.
>>
>> This may be some sort of interim step before achieving Qt/QML nirvana, or
>> this may be a subsystem a Qt app will depend on (I'm doing some early
>> experimentation, and may yet be chasing the wrong ideas).
>>
>> I'm not (for the sake of this question) planning to build the Android
>> underpinnings, so one of my start points has been not to assume I have that
>> source tree available (I understand it may have some toolchains in it). Is
>> that wise?
>>
>> I believe I need a toolchain to compile this code, and I have (at least)
>> three options presented in chats/wikis/docs I've googled/assumed might work:
>>
>>  (1) Compile on the device itself
>>  (2) Install the Ubuntu SDK
>>  (3) Install a cross-compilation toolchain on my (amd64) Ubuntu dev
>> machine
>>
>> I can succeed at (1), by installing whatever defaults build-essential
>> requires.
>>
>> I'm not sure if (2) should succeed - it's not clear to me if the Ubuntu
>> SDK does or will recommend/install a c/c++ toolchain. The one I installed
>> today doesn't appear to. Will it at some point? Did I just not see the one
>> it did install?
>>
>> for (3), if I try:
>>
>> # apt-get install crossbuild-essential-armhf
>>
>> I get:
>>
>> Reading package lists... Done
>> Building dependency tree
>> Reading state information... Done
>> Some packages could not be installed. This may mean that you have
>> requested an impossible situation or if you are using the unstable
>> distribution that some required packages have not yet been created
>> or been moved out of Incoming.
>> The following information may help to resolve the situation:
>>
>> The following packages have unmet dependencies.
>>  crossbuild-essential-armhf : Depends: libc6-dev:armhf but it is not
>> installable
>> E: Unable to correct problems, you have held broken packages.
>>
>> My initial troubleshooting (I'm definitely inexperienced in Ubuntu
>> package matters) hasn't turned up a way to proceed past that error yet.
>>
>> So, which is the most pragmatic way to proceed? I'm keen to get a cross
>> compilation toolchain working. Should I be?
>>
>> In the future, what will the options be to compile C/C++ for touch
>> devices?
>>
>> Thanks!
>>
>> J
>>
>> --
>> Mailing list: https://launchpad.net/~ubuntu-**phone<https://launchpad.net/~ubuntu-phone>
>> Post to     : ubuntu-phone@lists.launchpad.**net<ubuntu-phone@xxxxxxxxxxxxxxxxxxx>
>> Unsubscribe : https://launchpad.net/~ubuntu-**phone<https://launchpad.net/~ubuntu-phone>
>> More help   : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>>
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help   : https://help.launchpad.net/ListHelp
>
>

References