Modules built on HOST PC wrong format, cannot load

I’m following the instructions for building the kernel here:

https://wiki.radxa.com/Rock5/guide/build-debian-from-debos-radxa

However, ko modules built here can not be loaded through insmod. I am receiving the error:

insmod: ERROR: could not insert module /tmp/squashfs.ko: Invalid module format

I’ve confirmed that the same module from the distro does load. Are there extra steps or missing flags? The “file” output on both modules is the same (different hash)

ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), BuildID[sha1]=XXXX, not stripped

Thanks

Because the kernel module cannot be used on kernels other than the one it compiled against to. Even minor differences in kernel configs could break a kernel module’s compatibility. The most “convenient” way to add kernel modules is to compile the whole kernel and package it to deb, then install the whole kernel deb package.