[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cross-compiling debian packages for arm - an automated way?

Hello Vladimir,

On Tue, Aug 13, 2013 at 10:36:02AM +0300, Vladimir Vitkov wrote:
> Currently i am trying to setup a box as a crosscompiler/repository for
> debian packages. The packages are probably going to be most useful for
> me/small set of people but nevertheless i want to do it.
> The box targeted (for built packages) is Raspberry Pi (armv6 hardfloat),
> but unfortunately it is not beefy enough to do the compile on it, in a
> sensible time and repeatable manner.
> Therefore i am looking for a way to crosscompile on x86_64 the packages.
> I tried to follow the Linaro multiarch cross compile guide
> (https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/CrossbuildingQuickStart) but didn't have any measurable success.

I'm using SLIND with bitbake. SLIND is an implementation towards the
vision of Crush (but predates it), hacky at places, but it works.
Bitbake is the build system of OpenEmbedded.

> I will be glad for any pointers how to setup a crosscompile system that
> can do the following:
>  * Run on x86_64

Tried on x86 and x86_64. In theory, any system where you can deploy a
chroot (if needed) and get the necessary cross-compiler for the chroot.

>  * be able to compile for armhf

I dpkg-buildpackage -aarm -uc -us -rfakeroot for XScale. If you have the
right cross-compiler, just use -aarmhf.

>  * Be able to create deb packages out of dsc / apt-get source

Yes. That said, we had to touch (even if minimally) (almost?) all
packages. But it depends on how much you want to bootstrap. If you can
live with Debian libc, etc., the task might be much easier.

>  * Be able to compile packages in an isolated environment (chroot/kVM)

We use chroot for cleanroom building.

>  * Be able to maintain a repository (not mandatory as reprepro is nice
> and easy)

We do.

>  * supports some kind of buildd functionality (also not mandatory as
> package builds can be automated in other ways and are not expected to be
> so frequent)


> Please note:
>  * I am not shooting for recompiling the whole archive, just some stuff
> we find useful/want to modify or not packaged

We built the base system from scratch (including bootstrapping the
compiler and libc) and usually rebuild only our kernel / drivers / libs
/ apps. Perhaps it's possible to use Debian binary packages.

>  * Probably will recompile some packages which are not to our
> satisfaction in terms of layout, features or similar.

We do.

>  * Kernel is not completely out of the question, but quite some way down
> the road

We do.

>  * I am just appalled by the most projects/tutorials for the RPI that
> say ... wget ; tar ; configure ; make ... this is just not right.

I completely agree. OpenEmbedded is somewhat better, it repeatably
automates wget; tar; configure; make :) . SLIND uses Debian as upstream,
patches chosen source packages for cross-buildability, and uses bitbake
to build them on demand in a true Debian way (target headers and libs
are installed as a Debian package on the host system, just like the
native -dev packages).

With kind regards,

Reply to: