LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-25-2010, 02:08 PM   #1
connie84911
LQ Newbie
 
Registered: Jan 2010
Posts: 24

Rep: Reputation: 0
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
 
Old 06-25-2010, 02:18 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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.

Last edited by paulsm4; 06-25-2010 at 02:21 PM.
 
Old 06-25-2010, 02:36 PM   #3
connie84911
LQ Newbie
 
Registered: Jan 2010
Posts: 24

Original Poster
Rep: Reputation: 0
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
 
Old 06-25-2010, 03:22 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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.
..
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kerenel Compiled with x86_64 gcc vs. i686 gcc zvivered Linux - Embedded & Single-board computer 1 10-27-2009 09:52 AM
build-essential's gcc often different to what kernel was compiled with urentity Debian 4 07-21-2009 04:03 PM
ndiswrapper & kernel compiled with different GCC, how to solve this? Sammael Linux - Wireless Networking 4 09-28-2006 09:23 PM
stock kernel 2.4.31 compiled with wrong gcc? uselpa Slackware 6 09-26-2005 01:35 AM
redhat fedora gcc version (compiled for 2.4.20) doesn't match kernel version 2.4.22 start1000 Linux - Software 0 03-16-2004 08:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration