what does, "export CC=gcc32" do?

Place to discuss Fedora and/or Red Hat

what does, "export CC=gcc32" do?

Postby edwardsen35 » Mon Dec 08, 2003 3:47 pm

I have a Nvidia Video Card and when I installed Fedora I had a problem installing the driver. In /var/log/nvidia-installer.log got the following error message:
Code: Select all
 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.

Well I went on Nvidia's support forum and I found a post that said to run
Code: Select all
export CC=gcc32
before you install the driver and that worked. When I installed fedora I used gcc version 3.2.3 but I currently have gcc version 3.3.2 installed. My question is, when I ran
Code: Select all
export CC=gcc32
what exactly did that do? Did it tell the computer to use gcc version 3.2.3 from now on when installing programs or just that one time or until I restart the computer?
edwardsen35
user
user
 
Posts: 26
Joined: Mon Feb 10, 2003 9:11 am

Postby Tux » Mon Dec 08, 2003 4:19 pm

Until you restart. You have to add the command to a user/system init script for it to stick.
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby Void Main » Mon Dec 08, 2003 6:56 pm

"export CC=gcc32" sets the "CC" environment variable to "gcc32" which let the build scripts know they should use gcc32 as the compiler rather than gcc. If you notice, gcc32 and gcc are not the same version as you hinted at:

Code: Select all
[voidmain@laplinux voidmain]$ gcc32 --version
gcc32 (GCC) 3.2.3 20030422 (Red Hat Linux 3.2.3-6)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
[voidmain@laplinux voidmain]$ gcc --version
gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Hence gcc32 really means gcc v3.2.x. If you do a "cat /proc/version" you'll notice Fedora's kernel was compiled with gcc version 3.2:

Code: Select all
[voidmain@laplinux voidmain]$ cat /proc/version
Linux version 2.4.22-1.2115.nptl (bhcompile@daffy.perf.redhat.com) (gcc version 3.2.3 20030422 (Red Hat Linux 3.2.3-6)) #1 Wed Oct 29 15:42:51 EST 2003


The same compiler should be used to compile kernel modules as was used to compile the kernel. If not, you can end up with some problems like the ones you have experienced.

Now I haven't tried this but I suppose there is a good chance that if you compile the kernel with gcc v3.3.x and then try and compile your video drivers with the same compiler it *might* work. There very well could be other incompatibilities with the v3.3.x compiler that are causing problems though and might explain why the kernel comes compiled with v3.2.x.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby edwardsen35 » Mon Dec 08, 2003 8:04 pm

Thanks for the help Void Main and Tux
edwardsen35
user
user
 
Posts: 26
Joined: Mon Feb 10, 2003 9:11 am

Postby Calum » Tue Dec 09, 2003 3:36 pm

Void Main wrote:"export CC=gcc32" sets the "CC" environment variable to "gcc32" which let the build scripts know they should use gcc32 as the compiler rather than gcc. If you notice, gcc32 and gcc are not the same version as you hinted at

finally one i actually know the answer to, and void main gets there first! :D
never mind, void, i have come to expect it on these forums, there are so many people who know stuff here, i hang around mainly to try and sook it all up by osmosis!
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 1 guest

cron