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

RE: RE: Cross building an out of tree kernel module?



Thank you, Helmut!

Following your suggestion, I rebuilt the 'linux' package with the gcc-8 dependency removed from the linux-headers-<version>-<arch> binary package.  To do this I added a new "headers%gcc-8" statement to the *debian/defines* [relations] section, like so:

```
[relations]
# compilers
gcc-8: gcc-8 <!stage1 !cross !pkg.linux.nokernel>, gcc-8-@gnu-type-package@ <!stage1 cross !pkg.linux.nokernel>
headers%gcc-8: gcc-8-@gnu-type-package@ <!stage1 cross !pkg.linux.nokernel>
```

... and then refreshed the control files, and finally rebuilt the linux package.

To my surprise, this actually worked!   I'm now able to cross-build my out of tree kernel module within sbuild.

I appreciate all the hard work you guys do make cross-compilation in Debian a reality.  I also know that kind words are nice, but contributing is even better .  I'll try to help.

Thanks again!

-----Original Message-----
From: Helmut Grohne <helmut@subdivi.de> 
Sent: Thursday, August 26, 2021 12:01 AM
To: Nathan Miller <Nathan.Miller@wdc.com>
Cc: debian-cross@lists.debian.org
Subject: Re: Cross building an out of tree kernel module?

Hi,

On Thu, Aug 26, 2021 at 03:20:45AM +0000, Nathan Miller wrote:
> Is there a "right way" to cross build an out of tree kernel module for Debian buster?

Right place to ask here.

> Ultimately, I'd like to create a package for this driver using sbuild, but the forced installation of the arm64 headers is going to be a problem (I think).
>
> Simply attempting to install the arm64 linux headers causes the following error:
>
> ```
> The following packages have unmet dependencies:
>  linux-headers-4.19.0-17-arm64:arm64 : Depends: gcc-8:arm64 but it is 
> not going to be installed
> E: Unable to correct problems, you have held broken packages.
> ```
>
> Am I going about this wrong?  Is there a better way?

I fear you nailed it. You'll be unable to install the header package until it gets updated. It should be depending on gcc-8-for-host:arm64 instead and it cannot do that, because the package does not exist yet.
This is a long-standing issue known as #666743. It needs more testing and review to proceed.

The linux source package already employs a workaround for the lack of gcc-for-host in Build-Depends. That workaround can be copied to the runtime depends in principle. You can even do so yourself and rebuild linux.

This is of course a very unsatisfying answer. It does highlight though that the Debian cross movement needs help. We cannot make all the things just work with the current level of participation. The present rate of regressions already exceeds our capacity.

Helmut


Reply to: