Hi RiscFivers ! 
I have installed debian image :
$ uname -a
Linux starfive 5.15.0-starfive #1 SMP Mon Dec 19 07:56:37 EST 2022 riscv64 GNU/Linux
and I try to compile a kernel module, which I already compiled on others Debian systems :
$ make
make -C /lib/modules/5.15.0-starfive/build M=/home/invite/mod1 modules
make[1] : on entre dans le répertoire « /usr/src/linux-headers-5.15.0-starfive »
scripts/Makefile.build:44: arch/riscv/kernel/vdso/Makefile: Aucun fichier ou dossier de ce type
make[2]: *** Aucune règle pour fabriquer la cible « arch/riscv/kernel/vdso/Makefile ». Arrêt.
make[1]: *** [arch/riscv/Makefile:120 : vdso_prepare] Erreur 2
make[1] : on quitte le répertoire « /usr/src/linux-headers-5.15.0-starfive »
make: *** [Makefile:11 : default] Erreur 2
So the error is
scripts/Makefile.build:44: arch/riscv/kernel/vdso/Makefile: No file found !!
Of course I have installed all usuals packages for this operation.
Thank’s for your ideas 
Patrick
Hi,
I give some more precisions :
When I modify the file scripts/Makefile.build to resolve the problem I got another error :
warning: the compiler differs from the one used to build the kernel
The kernel was built by: riscv64-unknown-linux-gnu-gcc (GCC) 10.2.0
You are using: gcc (Debian 11.3.0-3) 11.3.0
MODPOST /home/invite/mod1/Module.symvers
/bin/sh: 1: scripts/mod/modpost: Exec format error
make[2]: *** [scripts/Makefile.modpost:134 : /home/invite/mod1/Module.symvers] Erreur 126
So I have build on the card VisionFive2 another kernel as explain in VisionFive 2 Debian Wiki - 202302 Release | RVspace
I have choose the tag VF2_v3.0.4.
After installation of the 3 .deb packages, I change my target but I got the same error again 
$ make
make -C /lib/modules/5.15.0/build M=/home/invite/mod1 modules
make[1] : on entre dans le répertoire « /usr/src/linux-headers-5.15.0 »
scripts/Makefile.build:44: arch/riscv/kernel/vdso/Makefile: Aucun fichier ou dossier de ce type
make[2]: *** Aucune règle pour fabriquer la cible « arch/riscv/kernel/vdso/Makefile ». Arrêt.
make[1]: *** [arch/riscv/Makefile:120 : vdso_prepare] Erreur 2
make[1] : on quitte le répertoire « /usr/src/linux-headers-5.15.0 »
make: *** [Makefile:11 : default] Erreur 2
Thank you for your help 
Patrick
I come back to tell the good news 
I have change my tag and take :
$ git checkout linux_5.15.10_devel_pwmdac
Re-compilation and re-installation of the 3 .deb files.
$ make
make -C /lib/modules/5.15.10/build M=/home/invite/mod1 modules
make[1] : on entre dans le répertoire « /usr/src/linux-headers-5.15.10 »
CC [M] /home/invite/mod1/mod1.o
MODPOST /home/invite/mod1/Module.symvers
CC [M] /home/invite/mod1/mod1.mod.o
LD [M] /home/invite/mod1/mod1.ko
make[1] : on quitte le répertoire « /usr/src/linux-headers-5.15.10 »
It works now !
$ ls -al
total 124
drwxr-xr-x 2 invite invite 4096 11 juin 17:14 .
drwxr-xr-x 15 invite invite 4096 11 juin 13:35 …
-rw-r–r-- 1 invite invite 328 11 juin 17:13 Makefile
-rw-r–r-- 1 invite invite 310 20 oct. 2022 mod1.c
-rw-r–r-- 1 invite invite 4128 11 juin 17:14 mod1.ko
-rw-r–r-- 1 invite invite 182 11 juin 17:14 .mod1.ko.cmd
-rw-r–r-- 1 invite invite 26 11 juin 17:13 mod1.mod
-rw-r–r-- 1 invite invite 581 11 juin 17:13 mod1.mod.c
-rw-r–r-- 1 invite invite 106 11 juin 17:13 .mod1.mod.cmd
-rw-r–r-- 1 invite invite 2760 11 juin 17:14 mod1.mod.o
-rw-r–r-- 1 invite invite 30943 11 juin 17:14 .mod1.mod.o.cmd
-rw-r–r-- 1 invite invite 2096 11 juin 17:13 mod1.o
-rw-r–r-- 1 invite invite 30628 11 juin 17:13 .mod1.o.cmd
-rw-r–r-- 1 invite invite 26 11 juin 17:13 modules.order
-rw-r–r-- 1 invite invite 134 11 juin 17:13 .modules.order.cmd
-rw-r–r-- 1 invite invite 0 11 juin 17:13 Module.symvers
-rw-r–r-- 1 invite invite 181 11 juin 17:13 .Module.symvers.cmd
So I think that there is an error in the installation of the headers files for some versions 
Next time !
Patrick