Skip to contentSkip to conversation

Cannot compile nouveau.o in drm with kernel 2.6.26

DISCUSSION Garnet MacPhee 2 participants 4 messages Jul 19, 2008 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

I am getting the following error when trying to compile nouveau.o in drm/linux-core on linux kernel 2.6.26. Drm itself compiles and installs correctly. I am using the latest drm git. I cannot access bugzilla from the nouveau page because it says it has an invalid security certificate.

root@default:~/drm/linux-core# make nouveau.o
make DRM_MODULES=nouveau.o modules
make[1]: Entering directory `/root/drm/linux-core'
make -C /lib/modules/2.6.26/source  SUBDIRS=`pwd` DRMSRCDIR=`pwd` modules
make[2]: Entering directory `/usr/src/linux-2.6.26'
   CC [M]  /root/drm/linux-core/drm_auth.o
In file included from include/linux/gfp.h:4,
                  from include/linux/slab.h:12,
                  from include/linux/percpu.h:5,
                  from include/asm/local.h:4,
                  from include/linux/module.h:19,
                  from /root/drm/linux-core/drmP.h:44,
                  from /root/drm/linux-core/drm_auth.c:36:
include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory
include/linux/mmzone.h:197:5: warning: "MAX_NR_ZONES" is not defined
In file included from include/linux/gfp.h:4,
                  from include/linux/slab.h:12,
                  from include/linux/percpu.h:5,
                  from include/asm/local.h:4,
                  from include/linux/module.h:19,
                  from /root/drm/linux-core/drmP.h:44,
                  from /root/drm/linux-core/drm_auth.c:36:
include/linux/mmzone.h:218: error: 'MAX_NR_ZONES' undeclared here (not in a function)
In file included from include/asm/pci.h:4,
                  from include/linux/pci.h:948,
                  from /root/drm/linux-core/drmP.h:51,
                  from /root/drm/linux-core/drm_auth.c:36:
include/linux/mm.h:429:63: warning: "NR_PAGEFLAGS" is not defined
include/linux/mm.h:477:62: warning: "NR_PAGEFLAGS" is not defined
make[3]: *** [/root/drm/linux-core/drm_auth.o] Error 1
make[2]: *** [_module_/root/drm/linux-core] Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.26'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/root/drm/linux-core'
make: *** [nouveau.o] Error 2
root@default:~/drm/linux-core#

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 1 line · On Fri, 18 Jul 2008 18:22:47 -0600 Garnet MacPhee…

I am getting the following error when trying to compile nouveau.o in drm/linux-core on linux kernel 2.6.26. Drm itself

By "Drm itself" I assume you are referring to libdrm.

Quoted 2 lines

compiles and installs correctly. I am using the latest drm git. I cannot access bugzilla from the nouveau page because it says it has an invalid security certificate.

IIRC it is just waiting for browsers to add cacert.org to trusted root certificates, it should be fine to accept.

Quoted 20 lines
root@default:~/drm/linux-core# make nouveau.o
make DRM_MODULES=nouveau.o modules
make[1]: Entering directory `/root/drm/linux-core'
make -C /lib/modules/2.6.26/source  SUBDIRS=`pwd` DRMSRCDIR=`pwd` modules
make[2]: Entering directory `/usr/src/linux-2.6.26'
   CC [M]  /root/drm/linux-core/drm_auth.o
In file included from include/linux/gfp.h:4,
                  from include/linux/slab.h:12,
                  from include/linux/percpu.h:5,
                  from include/asm/local.h:4,
                  from include/linux/module.h:19,
                  from /root/drm/linux-core/drmP.h:44,
                  from /root/drm/linux-core/drm_auth.c:36:
include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory
include/linux/mmzone.h:197:5: warning: "MAX_NR_ZONES" is not defined
In file included from include/linux/gfp.h:4,
                  from include/linux/slab.h:12,
                  from include/linux/percpu.h:5,
                  from include/asm/local.h:4,
                  from include/linux/module.h:19,
Quoted 8 lines
                  from /root/drm/linux-core/drmP.h:44,
                  from /root/drm/linux-core/drm_auth.c:36:
include/linux/mmzone.h:218: error: 'MAX_NR_ZONES' undeclared here (not in a function)
In file included from include/asm/pci.h:4,
                  from include/linux/pci.h:948,
                  from /root/drm/linux-core/drmP.h:51,
                  from /root/drm/linux-core/drm_auth.c:36:
include/linux/mm.h:429:63: warning: "NR_PAGEFLAGS" is not defined

These look funny. Did you build your kernel from the same source tree the DRM is using (/lib/modules/2.6.26/source)?
I haven't seen these errors before, but my first guess would be an unconfigured or never-compiled kernel source tree. Hmm, yes, at least include/linux/bounds.h is a build-time generated file.

If you are using a precompiled kernel image from your favourite distribution, you might need to install also another package which allows building custom kernel modules. This is distro specific.

Signature · 2 lines
Pekka Paalanen
http://www.iki.fi/pq/
#3 lore raw
Quoted 6 lines · Pekka Paalanen
Quoted 1 line · On Fri, 18 Jul 2008 18:22:47 -0600 Garnet MacPhee…

I am getting the following error when trying to compile nouveau.o in drm/linux-core on linux kernel 2.6.26. Drm itself

By "Drm itself" I assume you are referring to libdrm.

Yes, thats right.

Quoted 31 lines
Quoted 22 lines

root@default:~/drm/linux-core# make nouveau.o
make DRM_MODULES=nouveau.o modules
make[1]: Entering directory `/root/drm/linux-core'
make -C /lib/modules/2.6.26/source  SUBDIRS=`pwd` DRMSRCDIR=`pwd` modules
make[2]: Entering directory `/usr/src/linux-2.6.26'
   CC [M]  /root/drm/linux-core/drm_auth.o
In file included from include/linux/gfp.h:4,
                  from include/linux/slab.h:12,
                  from include/linux/percpu.h:5,
                  from include/asm/local.h:4,
                  from include/linux/module.h:19,
                  from /root/drm/linux-core/drmP.h:44,
                  from /root/drm/linux-core/drm_auth.c:36:
include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory
include/linux/mmzone.h:197:5: warning: "MAX_NR_ZONES" is not defined
In file included from include/linux/gfp.h:4,
                  from include/linux/slab.h:12,
                  from include/linux/percpu.h:5,
                  from include/asm/local.h:4,
                  from include/linux/module.h:19,
Quoted 8 lines
                  from /root/drm/linux-core/drmP.h:44,
                  from /root/drm/linux-core/drm_auth.c:36:
include/linux/mmzone.h:218: error: 'MAX_NR_ZONES' undeclared here (not in a function)
In file included from include/asm/pci.h:4,
                  from include/linux/pci.h:948,
                  from /root/drm/linux-core/drmP.h:51,
                  from /root/drm/linux-core/drm_auth.c:36:
include/linux/mm.h:429:63: warning: "NR_PAGEFLAGS" is not defined
Quoted 2 lines

These look funny. Did you build your kernel from the same source tree the DRM is using (/lib/modules/2.6.26/source)?

Yes, /lib/modules/2.6.26/source is actually a pointer, and it points to /usr/src/linux-2.6.26 just like it should.

Quoted 8 lines

I haven't seen these errors before, but my first guess would be an unconfigured or never-compiled kernel source tree. Hmm, yes, at least include/linux/bounds.h is a build-time generated file.

If you are using a precompiled kernel image from your favourite distribution, you might need to install also another package which allows building custom kernel modules. This is distro specific.

I am running Slackware 12.1, and I compile my own custom kernel, I do not use the precompiled ones (they are 2.6.24 vintage). The kernel has indeed been compiled, and I can run X using the nv driver.

Also, the same drm git will build correctly with kernel 2.6.25.

#4 lore raw
In reply to Pekka Paalanen

OK, I found the problem.

Running 'make clean' after compiling 2.6.26 will remove /usr/src/linux-2.6.26/include/linux/bounds.h. This is a change in behavior from 2.6.25 and earlier kernels.

I have always run 'make clean' (NOT make mrproper) after compiling a kernel, more out of habit than anything else, I guess. It never caused a problem before.

I am now happily running nouveau on kernel 2.6.26. Sorry about making noise on the list, but hopefully this will save somebody some time and hassle. I don't know what the long term solution should be, whether 'make clean' should be changed back to its previous behavior, whether drivers should stop referencing bounds.h, or whether people just have to change their behavior and not run 'make clean' after compiling.