LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   which gcc is my kernel compiled with (https://www.linuxquestions.org/questions/linux-kernel-70/which-gcc-is-my-kernel-compiled-with-816399/)

connie84911 06-25-2010 02:08 PM

which gcc is my kernel compiled with
 
Is there a command to tell me which gcc my kernel was compiled with? I didn't compile the kernel myself - just installed it. I'm running Ubuntu 9.10. uname command output:

$uname -a
$Linux connie 2.6.31-21-generic #59-Ubuntu SMP Wed Mar 24 07:28:56 UTC 2010 i686 GNU/Linux

Thanks

paulsm4 06-25-2010 02:18 PM

Hi -

AFAIK, No: there isn't any command that tells you which version of GCC a kernel was compiled with.

But out of curiousity: *why*?

PS:
One (perhaps useful, perhaps not ;)) bit of trivia:

When you start compiling your own kernels, you can specify "CONFIG_IKCONFIG_PROC". This will create a file "/proc/config.gz", so you can always see exactly what options were specified in building the kernel.

connie84911 06-25-2010 02:36 PM

I have read on the web that to load a .ko the OS, kernel, and GCC on the machine I am trying to load on must be the same as the compiler machine.

I would like to load a module that was not compiled on my machine. When I try to load the module I get:

insmod: error inserting './example.ko': -1 Invalid module format

From the syslog I get:

example: disagrees about version of symbol module_layout

Thanks for any suggestions

knudfl 06-25-2010 03:22 PM

You can use an editor with a small module, e.g.

/lib/modules/2.6.xx.xx/kernel/drivers/pci/pci-stub.ko (5.9 kB)
.. and read the GCC version.

( Or do 'zcat pci-stub.ko.gz')

But gcc alone is not a guaranty for any compatibility.
Must also be the same OS, same version, same kernel.
..


All times are GMT -5. The time now is 03:25 PM.