[Q][PATCH 0/5] RFC: UBUNTU: [Packaging] Preliminary Cross-compile support
Zixing Liu
zixing.liu at canonical.com
Fri Jun 27 05:59:43 UTC 2025
On Fri, 27 Jun 2025 at 13:44, Juerg Haefliger
<juerg.haefliger at canonical.com> wrote:
>
> On Fri, 27 Jun 2025 08:43:58 +0800
> Zixing Liu <zixing.liu at canonical.com> wrote:
>
> > This is a RFC patch-set aiming to get convenient cross-compilation for kernel
> > packages.
> >
> > This set of patches enable the entire kernel package (including linux-tools-*)
> > to be easily cross-buildable using existing build system.
>
> Very nice! But can you explain in more detail what the current state/behavior
> is (specifically what doesn't work) and the benefits and outcome of your
> proposed changes?
>
The current build scripts can only cross-compile the main kernel
packages (the kernel itself and its modules), but not the tools
(because these require system libraries).
The proposed changes can make sure `apt build-dep
--host-architecture=<target> .` selects the correct packages to
install for both the host operating system and the cross-compile
sysroot.
Additionally, we previously had cross-compile logic for linux-tools-*
packages, but they were broken and subsequently disabled. This patch
set revives the broken scripts by fixing them.
After this patch set is applied, you can perform the following steps
to build the entire set of packages for a different architecture (in
this example, riscv64):
dpkg --add-architecture riscv64
echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports plucky
main universe" >> /etc/apt/sources.list
apt-get update
apt-get build-dep --host-architecture=riscv64 .
dpkg-buildpackage -ariscv64 -d -b
> ...Juerg
>
>
> >
> > Zixing Liu (5):
> > UBUNTU: [Packaging] debian.master/control.stub.in: prepare for
> > cross-compiling
> > UBUNTU: [Packaging] debian/rules.d/0-common-vars.mk: avoid infinite
> > loop
> > UBUNTU: [Packaging] debian/rules.d/0-common-vars.mk: use native GCC
> > UBUNTU: [Packaging] debian/rules.d/0-common-vars.mk: enable
> > linux-tools cross-compilation
> > UBUNTU: [Packaging] debian/rules.d/0-common-vars.mk: fix linux-tools
> > cross-build
> >
> > debian.master/control.stub.in | 57 +++++++++++++++++----------------
> > debian/rules.d/0-common-vars.mk | 17 ++++------
> > debian/rules.d/2-binary-arch.mk | 4 +--
> > 3 files changed, 37 insertions(+), 41 deletions(-)
> >
>
Thanks,
Zixing
More information about the kernel-team
mailing list