Linux - Error when compiling the NVIDIA kernal module

Answer ID 165
Published 11/30/2004 07:25 AM
Updated 02/25/2008 10:48 AM

Compiling the NVIDIA kernel module gives this error:

 

You appear to be compiling the NVIDIA kernel module with

a compiler different from the one that was used to compile

the running kernel. This may be perfectly fine, but there

are cases where this can lead to unexpected behaviour and

system crashes.

 

If you know what you are doing and want to override this

check, you can do so by setting IGNORE_CC_MISMATCH.

 

In any other case, set the CC environment variable to the

name of the compiler that was used to compile the kernel.


You should compile the NVIDIA kernel module with the same compiler

version that was used to compile your kernel.  Some Linux kernel data

structures are dependent on the version of gcc used to compile it;

for example, in include/linux/spinlock.h:

 

...

* Most gcc versions have a nasty bug with empty initializers.

*/

#if (__GNUC__ > 2)

  typedef struct { } rwlock_t;

  #define RW_LOCK_UNLOCKED (rwlock_t) { }

#else

  typedef struct { int gcc_is_buggy; } rwlock_t;

  #define RW_LOCK_UNLOCKED (rwlock_t) { 0 }

#endif

 

If the kernel is compiled with gcc 2.x, but gcc 3.x is used when the

kernel interface is compiled (or vice versa), the size of rwlock_t

will vary, and things like ioremap will fail.

 

To check what version of gcc was used to compile your kernel, you

can examine the output of:

 

cat /proc/version

 

To check what version of gcc is currently in your $PATH, you can

examine the output of:

 

gcc -v

Was this answer helpful?
Your rating has been submitted, please tell us how we can make this answer more useful.

LIVE CHAT

Chat online with one of our support agents

CHAT NOW

ASK US A QUESTION

Contact Support for assistance

CONTACT US