The root cause is still that your kernel sources (in /sys) do not match
your installed world. The kernel module build process uses bsd.own.mk
from /usr/share/mk, which should define MK_CLANG_IS_CC. If it doesn't,
but your kernel source references it, there is a mismatch.
In some cases, you could fix it by setting MAKESYSPATH to the share/mk
dir under your source tree. There is still no guarantee your module
will build or load correctly.
As Doug Barton said in reply to r232473: "Building ports where the
sources and the installed kernel differ is not a supported
configuration. The fact that it happens to work most of the time is a
That said, i think it may be time to bow to the pressure, and just put a
fixup for this issue in kmod.mk, and the other .mk files, like I
initially did in r232473, but with a BIG FAT WARNING printed, so you at
least know you are attempting to shoot your extremities. :)