rcraid-dkms icon indicating copy to clipboard operation
rcraid-dkms copied to clipboard

Unable to compile for Linux 6.2.2

Open swishkin opened this issue 1 year ago • 8 comments

I'm receiving this error when trying to compile for Linux 6.2.2. Worked great for 6.1.x by cloning with compatability-updates option. The below is the output when compiling without compatibility updates:

==> Making package: rcraid-dkms 17.2.1-2 (Mon 06 Mar 2023 01:12:24 PM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found dkms.conf
==> Validating source files with md5sums...
    dkms.conf ... Passed
==> Extracting sources...
==> Starting prepare()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
make -C /lib/modules/6.2.2-artix1-1/build M=/home/swishkin/rcraid-dkms/arch/src
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/rc_init.o
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/rc_msg.o
ln -sf `basename /home/swishkin/rcraid-dkms/arch/src/rcblob.x86_64.o .o` /home/swishkin/rcraid-dkms/arch/src/rcblob.x86_64.o
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/rc_mem_ops.o
make[2]: /bin/hostname: No such file or directory
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/rc_event.o
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/rc_config.o
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/vers.o
/home/swishkin/rcraid-dkms/arch/src/rc_config.c:11:10: fatal error: linux/genhd.h: No such file or directory
   11 | #include <linux/genhd.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:252: /home/swishkin/rcraid-dkms/arch/src/rc_config.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/swishkin/rcraid-dkms/arch/src/rc.h:97,
                 from /home/swishkin/rcraid-dkms/arch/src/rc_init.c:38:
/home/swishkin/rcraid-dkms/arch/src/rc_msg_platform.h:30:10: fatal error: stdarg.h: No such file or directory
   30 | #include <stdarg.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from /home/swishkin/rcraid-dkms/arch/src/rc.h:97,
                 from /home/swishkin/rcraid-dkms/arch/src/rc_event.c:25:
/home/swishkin/rcraid-dkms/arch/src/rc_msg_platform.h:30:10: fatal error: stdarg.h: No such file or directory
   30 | #include <stdarg.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from /home/swishkin/rcraid-dkms/arch/src/rc.h:97,
                 from /home/swishkin/rcraid-dkms/arch/src/rc_mem_ops.c:43:
/home/swishkin/rcraid-dkms/arch/src/rc_msg_platform.h:30:10: fatal error: stdarg.h: No such file or directory
   30 | #include <stdarg.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from /home/swishkin/rcraid-dkms/arch/src/rc.h:97,
                 from /home/swishkin/rcraid-dkms/arch/src/rc_msg.c:22:
/home/swishkin/rcraid-dkms/arch/src/rc_msg_platform.h:30:10: fatal error: stdarg.h: No such file or directory
   30 | #include <stdarg.h>
      |          ^~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:252: /home/swishkin/rcraid-dkms/arch/src/rc_init.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /home/swishkin/rcraid-dkms/arch/src/rc_event.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /home/swishkin/rcraid-dkms/arch/src/rc_mem_ops.o] Error 1
make[2]: *** [scripts/Makefile.build:252: /home/swishkin/rcraid-dkms/arch/src/rc_msg.o] Error 1
make[1]: *** [Makefile:2021: /home/swishkin/rcraid-dkms/arch/src] Error 2
make: *** [Makefile:68: module] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

The following output is from compiling with compatibility updates:

==> Making package: rcraid-dkms 17.2.1-2 (Mon 06 Mar 2023 01:17:28 PM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found dkms.conf
==> Validating source files with md5sums...
    dkms.conf ... Passed
==> Extracting sources...
==> Starting prepare()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
make -C /lib/modules/6.2.2-artix1-1/build M=/home/swishkin/rcraid-dkms/arch/src
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/rc_init.o
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/rc_msg.o
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/rc_mem_ops.o
ln -sf `basename /home/swishkin/rcraid-dkms/arch/src/rcblob.x86_64.o .o` /home/swishkin/rcraid-dkms/arch/src/rcblob.x86_64.o
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/rc_event.o
make[2]: /bin/hostname: No such file or directory
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/rc_config.o
  CC [M]  /home/swishkin/rcraid-dkms/arch/src/vers.o
/home/swishkin/rcraid-dkms/arch/src/rc_init.c:344:10: error: ‘Scsi_Host_Template’ {aka ‘struct scsi_host_template’} has no member named ‘proc_dir’
  344 |         .proc_dir =                NULL,
      |          ^~~~~~~~
In file included from ./include/uapi/linux/posix_types.h:5,
                 from ./include/uapi/linux/types.h:14,
                 from ./include/linux/types.h:6,
                 from ./include/linux/kasan-checks.h:5,
                 from ./include/asm-generic/rwonce.h:26,
                 from ./arch/x86/include/generated/asm/rwonce.h:1,
                 from ./include/linux/compiler.h:247,
                 from ./include/linux/build_bug.h:5,
                 from ./include/linux/container_of.h:5,
                 from ./include/linux/list.h:5,
                 from ./include/linux/module.h:12,
                 from /home/swishkin/rcraid-dkms/arch/src/rc.h:27,
                 from /home/swishkin/rcraid-dkms/arch/src/rc_init.c:38:
./include/linux/stddef.h:8:14: warning: initialization of ‘int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
    8 | #define NULL ((void *)0)
      |              ^
/home/swishkin/rcraid-dkms/arch/src/rc_init.c:344:36: note: in expansion of macro ‘NULL’
  344 |         .proc_dir =                NULL,
      |                                    ^~~~
./include/linux/stddef.h:8:14: note: (near initialization for ‘driver_template.can_queue’)
    8 | #define NULL ((void *)0)
      |              ^
/home/swishkin/rcraid-dkms/arch/src/rc_init.c:344:36: note: in expansion of macro ‘NULL’
  344 |         .proc_dir =                NULL,
      |                                    ^~~~
/home/swishkin/rcraid-dkms/arch/src/rc_init.c: In function ‘rc_init_host’:
/home/swishkin/rcraid-dkms/arch/src/rc_init.c:795:24: error: ‘Scsi_Host_Template’ {aka ‘struct scsi_host_template’} has no member named ‘present’
  795 |         driver_template.present = 1;    /* one virtual adapter */
      |                        ^
In file included from ./include/linux/build_bug.h:5,
                 from ./include/linux/container_of.h:5,
                 from ./include/linux/list.h:5,
                 from ./include/linux/module.h:12,
                 from /home/swishkin/rcraid-dkms/arch/src/rc.h:27,
                 from /home/swishkin/rcraid-dkms/arch/src/rc_msg.c:22:
/home/swishkin/rcraid-dkms/arch/src/rc_msg.c: In function ‘rc_msg_access_ok’:
/home/swishkin/rcraid-dkms/arch/src/rc_msg.c:2491:48: warning: passing argument 1 of ‘__access_ok’ makes pointer from integer without a cast [-Wint-conversion]
 2491 |     accessOk.returnStatus = access_ok( accessOk.access_location, accessOk.access_size);
      |                                        ~~~~~~~~^~~~~~~~~~~~~~~~
      |                                                |
      |                                                rc_uint64_t {aka long long unsigned int}
./include/linux/compiler.h:77:45: note: in definition of macro ‘likely’
   77 | # define likely(x)      __builtin_expect(!!(x), 1)
      |                                             ^
/home/swishkin/rcraid-dkms/arch/src/rc_msg.c:2491:29: note: in expansion of macro ‘access_ok’
 2491 |     accessOk.returnStatus = access_ok( accessOk.access_location, accessOk.access_size);
      |                             ^~~~~~~~~
In file included from ./arch/x86/include/asm/uaccess.h:47,
                 from ./include/linux/uaccess.h:11,
                 from ./include/linux/sched/task.h:11,
                 from ./include/linux/sched/signal.h:9,
                 from ./include/linux/rcuwait.h:6,
                 from ./include/linux/percpu-rwsem.h:7,
                 from ./include/linux/fs.h:33,
                 from ./include/linux/huge_mm.h:8,
                 from ./include/linux/mm.h:746,
                 from ./include/linux/scatterlist.h:8,
                 from ./include/linux/dmapool.h:14,
                 from ./include/linux/pci.h:1551,
                 from /home/swishkin/rcraid-dkms/arch/src/rc.h:35:
./include/asm-generic/access_ok.h:31:50: note: expected ‘const void *’ but argument is of type ‘rc_uint64_t’ {aka ‘long long unsigned int’}
   31 | static inline int __access_ok(const void __user *ptr, unsigned long size)
      |                               ~~~~~~~~~~~~~~~~~~~^~~
make[2]: *** [scripts/Makefile.build:252: /home/swishkin/rcraid-dkms/arch/src/rc_init.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:2021: /home/swishkin/rcraid-dkms/arch/src] Error 2
make: *** [Makefile:68: module] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

How can I resolve this issue?

swishkin avatar Mar 06 '23 19:03 swishkin

I have the same problem. @swishkin you found a solution ?

LeonardoBein avatar Jun 22 '23 18:06 LeonardoBein

I just decided to stay on 6.1.12, so I blocked my distro from upgrading the kernel, because that requires recompiling/reinstalling, which doesn't succeed in my testing.

I'm planning to move to another distribution, I think, so maybe the grass will be greener there.

swishkin avatar Jun 23 '23 03:06 swishkin

@swishkin check out #47 for information on how to get it running on kernels >= 6.2.

fabscav avatar Jun 24 '23 23:06 fabscav

@fabscav, I think that's how I got it working on 6.1.12, but I wasn't able to do the same on 6.2+. I admittedly may have done something wrong or given up too soon, but it's been months since I was really focusing on this, so I can't remember the details.

swishkin avatar Jun 25 '23 01:06 swishkin

@swishkin as mentioned in the comments of that PR, I've recently made some additional changes in my fork, which should enable compatibility with kernels >= 6.2

fabscav avatar Jun 25 '23 07:06 fabscav

@fabscav, just tried cloning your fork (https://github.com/fabscav/rcraid-dkms.git), running makepkg -si, and I receive the same errors as shown in my initial log paste. Is an argument required to make it compile properly?

My output this time does seem to exclude this line, for whatever reason:

make[2]: *** [scripts/Makefile.build:252: /home/swishkin/rcraid-dkms/arch/src/rc_msg.o] Error 1

Also, trying to clone this repo with git clone https://github.com/Exioncore/rcraid-dkms -b compatibility_updates as suggested in #49 still produces the same errors as shown in the second paste in my OP.

swishkin avatar Jul 26 '23 04:07 swishkin

@swishkin

I receive the same errors as shown in my initial log paste.

I don't see how that's possible, since the includes mentioned on that log paste don't exist anymore in the codebase of my fork.

fabscav avatar Jul 26 '23 15:07 fabscav

@swishkin

I receive the same errors as shown in my initial log paste.

I don't see how that's possible, since the includes mentioned on that log paste don't exist anymore in the codebase of my fork.

My mistake! Your readme has the original git clone command, so I wasn't cloning your repo. It installed just fine now. Thanks!

swishkin avatar Jul 27 '23 13:07 swishkin