google / gasket-driver

GNU General Public License v2.0
47 stars 29 forks source link

Unable to build with 6.5.3-1-pve #18

Closed idontcare99999 closed 8 months ago

idontcare99999 commented 9 months ago
DKMS make.log for gasket-1.0 for kernel 6.5.3-1-pve (x86_64) Fri Nov 3 06:21:01 PM PDT 2023 make: Entering directory '/usr/src/linux-headers-6.5.3-1-pve' CC [M] /var/lib/dkms/gasket/1.0/build/gasket_core.o CC [M] /var/lib/dkms/gasket/1.0/build/gasket_ioctl.o CC [M] /var/lib/dkms/gasket/1.0/build/gasket_interrupt.o CC [M] /var/lib/dkms/gasket/1.0/build/gasket_page_table.o CC [M] /var/lib/dkms/gasket/1.0/build/gasket_sysfs.o CC [M] /var/lib/dkms/gasket/1.0/build/apex_driver.o /var/lib/dkms/gasket/1.0/build/gasket_core.c: In function ‘gasket_register_device’: /var/lib/dkms/gasket/1.0/build/gasket_core.c:1841:41: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types] 1841 class_create(driver_desc->module, driver_desc->name); ~~~^~~~
struct module *

In file included from ./include/linux/device.h:31, from ./include/linux/cdev.h:8, from /var/lib/dkms/gasket/1.0/build/gasket_core.h:11, from /var/lib/dkms/gasket/1.0/build/gasket_core.c:12: ./include/linux/device/class.h:230:54: note: expected ‘const char ’ but argument is of type ‘struct module ’ 230 | struct class __must_check class_create(const char name); | ~~^~ /var/lib/dkms/gasket/1.0/build/gasket_core.c:1841:17: error: too many arguments to function ‘class_create’ 1841 | class_create(driver_desc->module, driver_desc->name); | ^~~~ ./include/linux/device/class.h:230:29: note: declared here 230 | struct class __must_check class_create(const char name); | ^~~~ cc1: some warnings being treated as errors make[2]: [scripts/Makefile.build:251: /var/lib/dkms/gasket/1.0/build/gasket_core.o] Error 1 make[2]: Waiting for unfinished jobs.... make[1]: [/usr/src/linux-headers-6.5.3-1-pve/Makefile:2037: /var/lib/dkms/gasket/1.0/build] Error 2 make: [Makefile:234: __sub-make] Error 2 make: Leaving directory '/usr/src/linux-headers-6.5.3-1-pve'

robertzaage commented 8 months ago

The root cause was fixed by commit https://github.com/google/gasket-driver/commit/8aca235839fb5ba4d5ef6cfbe783837667e381f1. In my opinion a methodology to find out if one or two arguments are passed to class_create shouldn't rely on a kernel version number. Backports and custom kernels are frequently breaking these things.

robertzaage commented 8 months ago

If you're lucky the issue is fixed by updating your kernel and try compiling again. Looks like the kernel version string is a bit unusual in this case (KREL=1~1): https://git.proxmox.com/?p=pve-kernel.git;a=commitdiff;h=62d5fcabede83363de91a69a3c8091c3da5cedd1;hp=fc8577c9fa41978d395c8ffe1588f2616f11d2e5

Otherwise we need to work out a more stable solution.

robertzaage commented 8 months ago

@idontcare99999 maybe patching the code and building the package yourself, like in #21 will solve your issue as well.

idontcare99999 commented 8 months ago

@idontcare99999 maybe patching the code and building the package yourself, like in #21 will solve your issue as well.

All good now.