LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Wrong GCC version (https://www.linuxquestions.org/questions/linux-software-2/wrong-gcc-version-581893/)

replica9000 09-03-2007 11:45 AM

Wrong GCC version
 
I updated my Debian system going from Etch to Sid (kernel 2.6.18-5-K7 to 2.6.22-1-K7)

I'm trying to reconfigure VMWare to work with the new kernel and when I do I get this error:

Code:

Your kernel was built with "gcc" version "4.1.3", while you are trying to use
"/usr/bin/gcc" version "4.2.1". This configuration is not recommended and
VMware Workstation may crash if you'll continue. Please try to use exactly same
compiler as one used for building your kernel. Do you want to go with compiler
"/usr/bin/gcc" version "4.2.1" anyway? [no]

I can't find a way to downgrade GCC. How do I make the kernel GCC and installed GCC match?

manwichmakesameal 09-03-2007 01:22 PM

You should be able to get gcc 4.1.3 thru synaptic. Or you could just rebuild your kernel with your current version of gcc.

almatic 09-03-2007 04:38 PM

this may sound like a stupid question but did you actually boot the new kernel after update ? Usually debian has the correct gcc version installed.

You can downgrade the gcc by adding the testing repository and then do 'aptitude install gcc/testing'. But make sure that this is really your problem (type 'cat /proc/version' to see what compiler was used for the kernel and 'gcc --version' for the gcc version). You can also have more versions of gcc installed as gcc is just a symlink to /usr/bin/gcc-version.

replica9000 09-03-2007 09:45 PM

Quote:

Originally Posted by almatic (Post 2880131)
this may sound like a stupid question but did you actually boot the new kernel after update ? Usually debian has the correct gcc version installed.

You can downgrade the gcc by adding the testing repository and then do 'aptitude install gcc/testing'. But make sure that this is really your problem (type 'cat /proc/version' to see what compiler was used for the kernel and 'gcc --version' for the gcc version). You can also have more versions of gcc installed as gcc is just a symlink to /usr/bin/gcc-version.

Of course I rebooted into the correct kernel, it was the first thing I did after the upgrade finished.

This is the current version reported by those commands:
Code:

debian-etchtop:/home/replica# cat /proc/version
Linux version 2.6.22-1-k7 (Debian 2.6.22-3) (waldi@debian.org) (gcc version 4.1.3 20070718 (prerelease) (Debian 4.1.2-14)) #1 SMP Sun Jul 29 15:15:55 UTC 2007
debian-etchtop:/home/replica# gcc --version
gcc (GCC) 4.2.1 (Debian 4.2.1-3)
Copyright (C) 2007 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.

And I viewed the properties of /usr/bin/gcc and that came up as /usr/bin/gcc-4.2

I have files for both gcc-4.1 and gcc-4.2 installed
http://www.replica9000.bizland.com/l...snapshot30.png

So should I simply point the link to gcc-4.1? Or is there something else I should do?

almatic 09-04-2007 03:55 AM

Quote:

Originally Posted by replica9000 (Post 2880334)
So should I simply point the link to gcc-4.1? Or is there something else I should do?

yup, make a new symlink, then try the installation again.

replica9000 09-04-2007 01:20 PM

Quote:

Originally Posted by almatic (Post 2880580)
yup, make a new symlink, then try the installation again.

Well it worked, sort of. Not sure if it's gcc or the kernel headers that's the problem, or the vmware-config.pl script:

Code:

None of the pre-built vmmon modules for VMware Workstation is suitable for your
running kernel.  Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux-headers-2.6.22-1-k7/include]

Extracting the sources of the vmmon module.

Building the vmmon module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmmon-only'
make -C /usr/src/linux-headers-2.6.22-1-k7/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.22-1-k7'
  CC [M]  /tmp/vmware-config1/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config1/vmmon-only/linux/driver.c:80:
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘compat_exit’
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘exit_code’
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: warning: type defaults to ‘int’ in declaration of ‘_syscall1’
make[2]: *** [/tmp/vmware-config1/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config1/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.22-1-k7'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config1/vmmon-only'
Unable to build the vmmon module.

For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".

Execution aborted.

I had no issues installing this before.

replica9000 09-04-2007 03:04 PM

Scratch that last problem. I found out I needed a patch (vmware-any-any-update113.tar.gz) for the kernel 2.6.22-1 from http://platan.vc.cvut.cz/ftp/pub/vmware/

ran the patch script followed by the vmware-config.pl script and everything appears to be working good.

Thanks for you help with my gcc problem though.


All times are GMT -5. The time now is 05:22 PM.