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

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.

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.
From ed870df3c0ab3d60aa60cf509ee6c3d10ab41276 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <benh@debian.org>
Date: Tue, 8 Mar 2022 00:44:38 +0100
Subject: [PATCH linux] linux-headers: Fix compiler dependencies to allow for
 cross-builds
To: debian-kernel@lists.debian.org

---
 debian/changelog            | 6 ++++++
 debian/config/amd64/defines | 2 +-
 debian/config/arm64/defines | 2 +-
 debian/config/armel/defines | 2 +-
 debian/config/armhf/defines | 2 +-
 debian/config/defines       | 1 +
 debian/config/i386/defines  | 2 +-
 debian/config/s390x/defines | 2 +-
 8 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index a551e235a8b3..89210e4352c7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+linux (5.17~rc6-1~exp2) UNRELEASED; urgency=medium
+
+  * linux-headers: Fix compiler dependencies to allow for cross-builds
+
+ -- Ben Hutchings <benh@debian.org>  Tue, 08 Mar 2022 00:44:34 +0100
+
 linux (5.17~rc6-1~exp1) experimental; urgency=medium
 
   * New upstream release candidate
diff --git a/debian/config/amd64/defines b/debian/config/amd64/defines
index 975efaa90b9c..7b9eb9fbe75e 100644
--- a/debian/config/amd64/defines
+++ b/debian/config/amd64/defines
@@ -15,7 +15,7 @@ install-stem: vmlinuz
 breaks: xserver-xorg-input-vmmouse (<< 1:13.0.99)
 
 [relations]
-headers%gcc-11: linux-compiler-gcc-11-x86
+headers%gcc-11: linux-compiler-gcc-11-x86 | gcc-11-x86-64-linux-gnu
 
 [amd64_description]
 hardware: 64-bit PCs
diff --git a/debian/config/arm64/defines b/debian/config/arm64/defines
index dec69491a59c..f937ed24bb69 100644
--- a/debian/config/arm64/defines
+++ b/debian/config/arm64/defines
@@ -25,4 +25,4 @@ hardware-long: cloud platforms supporting arm64 virtual machines
 
 [relations]
 gcc-11: gcc-11 <!stage1 !cross !pkg.linux.nokernel>, gcc-11-aarch64-linux-gnu <!stage1 cross !pkg.linux.nokernel>, gcc-arm-linux-gnueabihf <!stage1 !pkg.linux.nokernel>
-headers%gcc-11: gcc-11
+headers%gcc-11: gcc-11 | gcc-11-aarch64-linux-gnu
diff --git a/debian/config/armel/defines b/debian/config/armel/defines
index 031067afd01b..09440221cb66 100644
--- a/debian/config/armel/defines
+++ b/debian/config/armel/defines
@@ -13,7 +13,7 @@ uncompressed-image-file: arch/arm/boot/Image
 install-stem: vmlinuz
 
 [relations]
-headers%gcc-11: linux-compiler-gcc-11-arm
+headers%gcc-11: linux-compiler-gcc-11-arm | gcc-11-arm-linux-gnueabi
 
 [marvell_description]
 hardware: Marvell Kirkwood/Orion
diff --git a/debian/config/armhf/defines b/debian/config/armhf/defines
index 7607ea2d9f59..8c7d0c96ae9f 100644
--- a/debian/config/armhf/defines
+++ b/debian/config/armhf/defines
@@ -12,7 +12,7 @@ vdso: true
 install-stem: vmlinuz
 
 [relations]
-headers%gcc-11: linux-compiler-gcc-11-arm
+headers%gcc-11: linux-compiler-gcc-11-arm | gcc-11-arm-linux-gnueabihf
 
 [armmp_description]
 hardware: ARMv7 multiplatform compatible SoCs
diff --git a/debian/config/defines b/debian/config/defines
index 82e7c09bb89a..f3e1f0fc50d3 100644
--- a/debian/config/defines
+++ b/debian/config/defines
@@ -168,6 +168,7 @@ recommends: apparmor
 [relations]
 # compilers
 gcc-11: gcc-11 <!stage1 !cross !pkg.linux.nokernel>, gcc-11-@gnu-type-package@ <!stage1 cross !pkg.linux.nokernel>
+headers%gcc-11: gcc-11 | gcc-11-@gnu-type-package@
 
 # initramfs-generators
 initramfs-fallback: linux-initramfs-tool
diff --git a/debian/config/i386/defines b/debian/config/i386/defines
index d471d747d780..da729c4d2434 100644
--- a/debian/config/i386/defines
+++ b/debian/config/i386/defines
@@ -21,7 +21,7 @@ install-stem: vmlinuz
 breaks: xserver-xorg-input-vmmouse (<< 1:13.0.99)
 
 [relations]
-headers%gcc-11: linux-compiler-gcc-11-x86
+headers%gcc-11: linux-compiler-gcc-11-x86 | gcc-11-i686-linux-gnu
 
 [686_description]
 hardware: older PCs
diff --git a/debian/config/s390x/defines b/debian/config/s390x/defines
index 922bd1acaab5..f3232842d346 100644
--- a/debian/config/s390x/defines
+++ b/debian/config/s390x/defines
@@ -13,7 +13,7 @@ bootloaders: s390-tools
 install-stem: vmlinuz
 
 [relations]
-headers%gcc-11: linux-compiler-gcc-11-s390
+headers%gcc-11: linux-compiler-gcc-11-s390 | gcc-11-s390x-linux-gnu
 
 [s390x_description]
 hardware: IBM zSeries

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: