On Sun, 2025-04-06 at 23:21 +0200, Miguel Ojeda wrote:
> On Thu, Apr 3, 2025 at 11:32 PM NoisyCoil <noisycoil@disroot.org> wrote:
> >
> > I think the key issue here is Debian wants to support cross-compiling
> > out-of-tree kernel modules,
>
> I see, that sentence explains it, thanks!
>
> So you want to build a kernel for architecture X in a host of
> architecture Y, and then build an out-of-tree module for architecture
> X in a host of architecture Z (possibly X)?
>
> As far as I have been told, the kernel generally requires that the
> exact same toolchain is used to build out-of-tree modules as the main
> kernel -- so the same host/target pair should be used for both the
> kernel build as the out-of-tree builds. Of course, things may happen
> to work otherwise.
I don't see why there would be a problem with mixing objects built using
native and cross- C compilers with the same target and version. (Unless
you enable gcc plugins, which we don't.)
> Is the reason that there is a build farm on architecture Y that builds
> all the kernels for all X, and then you want users to be able to use
> their architecture X to build out-of-tree modules for their kernel on
> X? i.e. the X == Z case.
Official Debian binary packages are built natively, but there is also a
standard way to cross-build them and the kernel source package supports
this. The resulting binary packages should be functionally identical.
We also try to give users the option to cross-build or natively build
out-of-tree modules, independently of that. We apply a patch to always
define CROSS_COMPILE according to the target architecture. (This works
even for the native case because e.g. x86_64-linux-gnu-gcc exists as a
native compiler on amd64.)
Ben.
--
Ben Hutchings
The obvious mathematical breakthrough [to break modern encryption]
would be development of an easy way to factor large prime numbers.
- Bill Gates
Attachment:
signature.asc
Description: This is a digitally signed message part