Bug#697061: nvidia-kernel-dkms: Module fails to build against linux-headers-3.7-trunk-amd64 (VM_RESERVED undeclared)

Andreas Beckmann debian at abeckmann.de
Wed Jan 23 00:22:59 UTC 2013


On 2013-01-22 19:19, Andre Beck wrote:
> for reasons I don't grok entirely, 304.64-4 doesn't fix the build issue
> for me, though I'm building against linux-3.7.y stable (which in turn
> is built using kernel-package).
So that's a non-debian kernel ...

My compile test chroot contains all Debian kernel header packages from
squeeze, squeeze-backports, wheezy, sid, experimental (including ABIs no
longer available) for all kernel flavors that exist for arch:amd64. And
it builds without failures.
But I have no vanilla kernels in my test scenario ...

> The dkms make.log still complains about
> the missing symbol VM_RESERVED. It does build, however, as soon as I
> remove the outer level of ifdefing which tries to match for kernel
> versions >= 3.7.0, so that seems to somehow not trigger correctly.
...
> intuitively before even thinking about reporting) and that builds without
> issues on 3.7.3 as well as 3.7.4. The LINUX_VERSION_CODE stuff doesn't
> look wrong though, so I'm not of much help identifying the issue here.

if LINUX_VERSION_CODE doesn't work here, it probably doesn't work
elsewhere, too (conftest.h ...)


For debugging add this

#define STRINGIFY(x) #x
#define DO_PRAGMA(x) _Pragma (#x)
#define DUMP(x) DO_PRAGMA(message ("DUMP " #x " = " STRINGIFY(x)))
DUMP(LINUX_VERSION_CODE)
DUMP(KERNEL_VERSION(3,7,0))

right above the problematic #ifdef and look in the dkms build log for
the output.

I get for linux-headers-3.7-trunk-amd64 (3.7.3-1~experimental.1) the
following:

/var/lib/dkms/nvidia/304.64/build/nv-mmap.c:478:1: note: #pragma
message: DUMP LINUX_VERSION_CODE = 198403
/var/lib/dkms/nvidia/304.64/build/nv-mmap.c:479:1: note: #pragma
message: DUMP KERNEL_VERSION(3,7,0) = (((3) << 16) + ((7) << 8) + (0))

and   3*2^16 + 7*2^8 + 0 = 198400   (according to bc)

I would expect LINUX_VERSION_CODE not to be defined, that should be the
only way to trigger this error, so Debian kernels #include things
differently than upstream ...

Also add to the head of conftest.h (after the #include block):

#ifndef LINUX_VERSION_CODE
#error NO LINUX_VERSION_CODE
#endif

After a failed build
  grep version.h /var/lib/dkms/nvidia/304.64/build/.nv*
might be interesting to see whether a "wrong" version.h gets included,
also look for all the version.h in your kernel tree ...


Andreas



More information about the pkg-nvidia-devel mailing list