Hello,
This is still reproducible in unstable (linux 7.2.12-1), with armhf
userland and the arm64 kernel.
Steps, as root on an arm64 machine:
mmdebstrap --variant=apt --architectures=armhf,arm64 \
--include=linux-headers-arm64:arm64 sid sid-armhf
chroot sid-armhf apt-get update
chroot sid-armhf apt-get install -y reform2-lpc-dkms
The DKMS build fails:
ERROR: modpost: reform2_lpc: type mismatch between of_tis_spi_match[] and
MODULE_DEVICE_TABLE(of, ...)
apt installs linux-kbuild-7.2.12+deb14:armhf to satisfy the headers'
dependency. Replacing it with the arm64 build makes the same DKMS build
succeed:
chroot sid-armhf apt-get install -y linux-kbuild-7.2.12+deb14:arm64
debian/rules.d/scripts/mod/Makefile.real generates devicetable-offsets.h
with the host compiler, and real-*/types.h only gives kernel_ulong_t the
size of the target. Pointer and long members keep the size of the host,
so in modpost.real-lsb-64 built on armhf, struct of_device_id is 196
bytes instead of 200. Upstream generates the offsets with the target
compiler, so it does not have this problem.
There are a few ways to fix this, but I can't think of one that's
obviously correct.
1. Generate the offsets for the 64-bit variants with a compiler for a
64-bit target. This gives the exact layout, but needs clang or a
cross gcc as a build dependency, and Debian has no 64-bit cross gcc
that runs on armhf.
2. Rewrite the pointer and long members of mod_devicetable.h as
kernel_ulong_t before generating the offsets. This needs no new
dependencies, but has to match the declarations in the header.
This came up on Raspberry Pi OS, where the 32-bit userland is used with
the 64-bit kernel.
Cheers,
Serge