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

RE: Dependencies of linux-headers-<arch> packages

Hi Ben,

> -----Original Message-----
> From: Ben Hutchings <ben@decadent.org.uk>
> Sent: Tuesday, March 8, 2022 1:45 AM
> To: Moessbauer, Felix (T CED SES-DE) <felix.moessbauer@siemens.com>;
> debian-cross@lists.debian.org
> Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>; Hombourger, Cedric (DI SW
> CAS ES EPT OSS) <cedric.hombourger@siemens.com>; debian-
> kernel@lists.debian.org
> Subject: Re: Dependencies of linux-headers-<arch> packages
> On Thu, 2022-03-03 at 11:13 +0000, Moessbauer, Felix wrote:
> > Hi,
> >
> > the kernel header packages have a dependency to c/c++ compilers.
> > E.g. the "linux-headers-5.10.0-10-arm64" package depends on gcc-
> > 10:arm64 -> cpp-10:arm64 (on bullseye).
> >
> > This becomes an issue when cross-compiling kernel modules for other
> > target architectures:
> > The linux-headers packages cannot be co-installed due to the not co-
> > installable cpp-<x> packages.
> >
> > By that, cross-compilation of kernel modules for other Debian targets
> > is currently not possible (at least without removing the hosts cpp
> > infrastructure).
> >
> > What is the reason to depend on compilers here?
> We want installation of OOT modules to be as simple as possible for those users
> that need it.  A dependency makes this more robust.
> > Wouldn't be a "recommends" relation be sufficient here?
> > An alternative might also be to depend via `:native`, but I did not
> > check that yet.
> [...]
> Using :native would defeat the purpose.  But the attached patch
> (untested) might fix the dependencies to allow for cross-compilation.

Many thanks for the patch.
I just (manually) backported that to Debian bullseye, tested it for arm64 and it worked like a charm.
Note: In case no compiler is installed yet, the "build" arch (amd64) compiler is preferred which is good.

Having this would be a huge step forward for image builders like ISAR (putting list in CC) targeting embedded devices.
Also regular Debian users that want to compile OOT modules for other architectures (e.g. for the raspberry pi) do not have to fiddle around with a buildchroot anymore.
BTW: It is also a good workaround until #666743 is resolved (multiarch:foreign compiler interface).

Is there a chance we can get this into bullseye? IMHO, the lessened dependency is not a breaking change.

Cheers, Felix

> linux-kbuild does have some support for use in cross-compilation but I don't
> know how well it works now.
> Ben.
> --
> Ben Hutchings
> Q.  Which is the greater problem in the world today,
>     ignorance or apathy?
> A.  I don't know and I couldn't care less.

Reply to: