I installed the latest version of raspios, here is the uname -a Linux raspberrypi 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux
I git cloned V4l2loopback and tried compiling after getting the linux headers. I get the following error.
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/pi/v4l2loopback KCPPFLAGS="-DSNAPSHOT_VERSION='"0.12.7-412-g850a2e3"'" modules
make[1]: Entering directory '/usr/src/linux-headers-6.1.21+'
CC [M] /home/pi/v4l2loopback/v4l2loopback.o
MODPOST /home/pi/v4l2loopback/Module.symvers
ERROR: modpost: "__aeabi_ldivmod" [/home/pi/v4l2loopback/v4l2loopback.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:126: /home/pi/v4l2loopback/Module.symvers] Error 1
make[1]: *** [Makefile:1964: modpost] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.21+'
make: *** [Makefile:53: v4l2loopback.ko] Error 2
I googled and found that is error mostly shows up when you do 64 bit division on 32 bit. I looked through the code and found instances of divisions with 64 bit and I tried to replace it with do_div() but to no avail. I get a whole bunch of other errors when I do that. How do you fix this issue?