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?
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.
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?
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.
You cannot add :native to runtime dependencies. The :native qualifier only makes sense for build dependencies. See https://wiki.ubuntu.com/MultiarchCross
You can find the answer to your question in this thread:
Essentially, linux-headers-* should depend on gcc-10-for-host:arm64
but that is blocked by us not having enough time to work on https://bugs.debian.org/666743
Ok, got it. But what about the workaround proposed by Ben Hutchings.
Looks like this fixes the cross compiling, until #666743 is resolved.
IMHO it is also a better workaround than just removing the dependencies as suggested in the mail thread.
Many thanks for the patch.
I just (manually) backported that to Debian bullseye, tested it for arm64 and it worked like a charm.
In general I agree, but here the situation is a bit different:
The dependency to the host compiler (e.g. arm64) is too narrow.
In general, any gcc compiler in the correct version should do.
As discussed earlier the linux-headers -> compiler dependency is just a convenience dep.
I proposed to remove it or move it to the "recommends" section.
But the proposed solution might be better as it maintains backwards compatibility.
For users that just want to cross-compile a module, there is simply no reason why the have to install the compiler for the host architecture (e.g. arm64).
And this use-case is perfectly solved in the patch from Ben.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 88:15:09 |
Calls: | 6,697 |
Calls today: | 2 |
Files: | 12,232 |
Messages: | 5,348,236 |