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

Re: Cross-building Debian `linux` package (Was: Re: Unmet dependencies problem in CrossToolchains)



+++ John Morris [2015-04-06 23:33 -0500]:

> Does anyone know if the upstream Debian kernel package can be
> cross-built? 

I think this works fine. I cross-built the debian kernel packages
recently. I think this should do the trick:
first get a cross-toolchain installed:
 dpkg --add-architecture armhf
 apt-get update
 apt-get install crossbuild-essential-armhf
(this will need an external repo on jessie, and right now is broken in
unstable. See: https://wiki.debian.org/CrossToolchains#Installation)

Then get kernel source and build it:
 apt-get source linux-3.16
 apt-get build-dep linux
 dpkg-buildpackage -aarmhf -B -d


> I suspect the answer is 'no', because of it
> `Build-Depends: gcc-4.9` and I don't see anywhere the Emdebian
> toolchain `Provides:` that.

Right - there is currently a problem that build-dependencies on
particular gcc versions do not 'translate' to the relevant cross
dependency.

This was discussed at the bootstrap sprint last year where 6 possible
solutions were considered, and a 7th one eventually chosen :-)
See section 4.1 of
https://wiki.debian.org/Sprints/2014/BootstrapSprint/Results
A demonstration of that solution has been demonstrated but it is not
yet in the archive.
(http://anonscm.debian.org/cgit/crosstoolchain/gcc-cross-support.git/)

In practice this currently means that you have to build such packages
by ensuring 'manually' that the right cross-gcc packages are installed
(normally using crossbuild-essential-<arch>).

> In the case of 'no', does anyone know how this is typically dealt
> with when converting packages to Multiarch?  If it's atypical for
> packages to configure a specific gcc version, I can hack something,
> but if there's a standard approach, maybe I can try something that
> can be contributed back.

It is best if packages don't build-dep on a particular version of gcc
(indeed they almost always only do due to bugs with newer versions).

The proper way to work on this is to get the above mechanism into the
archive. That gcc-cross-support package should be combined with
cross-gcc-defaults, and that should probably be combined with
gcc-defaults. Patches for those mergings would be helpful. There are
current questions about the cross gcc roadmap which mean it may take a
while to get this stuff in, but I hope we can do it in stretch, as it
allows package maintainers to build-dep on gcc-<ver>-for-host and
gcc-<ver>-for build and the right compailers will magically be installed. 

Wookey
-- 
Principal hats:  Linaro, Debian, Wookware, ARM
http://wookware.org/


Reply to: