Unix/Linux Go Back    


Gentoo Gentoo Linux is a versatile and fast, completely free Linux distribution geared towards developers and network professionals.

Which GCC Built My Kernel?

Gentoo


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 06-19-2007
deckard's Unix or Linux Image
deckard deckard is offline
Registered User
 
Join Date: Jul 2002
Last Activity: 8 June 2012, 5:12 PM EDT
Location: Ohio
Posts: 135
Thanks: 0
Thanked 0 Times in 0 Posts
Which GCC Built My Kernel?

I'm playing around with the kqemu accelerator for the QEMU virtualization software. I can't remember which version of gcc I used to build my kernel. I have 3.4.6 and 4.1.1 on this (Gentoo) system. I seem to remember there is some command I can run against binaries that will tell me what gcc (and linker, etc..) built them. so far my searches have only turned up:

gcc -v (Shows me what version of GCC I have)

and

uname -a (which shows me all the kernel info except which GCC built it)

Any suggestions?
Sponsored Links
    #2  
Old Unix and Linux 06-19-2007
porter porter is offline Forum Advisor  
Registered User
 
Join Date: Jan 2007
Last Activity: 8 January 2008, 6:50 PM EST
Posts: 2,965
Thanks: 0
Thanked 5 Times in 5 Posts
Try nm on the binary and see what symbols it spits out.
Sponsored Links
    #3  
Old Unix and Linux 06-20-2007
vino's Unix or Linux Image
vino vino is offline Forum Advisor  
Supporter (in vino veritas)
 
Join Date: Feb 2005
Last Activity: 8 February 2016, 5:12 PM EST
Location: Sydney, Down Under
Posts: 2,848
Thanks: 0
Thanked 13 Times in 13 Posts
Quote:
Originally Posted by porter View Post
Try nm on the binary and see what symbols it spits out.
But if the binary is stripped i.e. built with the -s flag, then I dont think nm will output anything.
    #4  
Old Unix and Linux 07-17-2007
this213 this213 is offline
Registered User
 
Join Date: Feb 2006
Last Activity: 15 April 2010, 3:09 PM EDT
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
cat /proc/version | head -n1 | cut -d" " -f1-3,5-7
Sponsored Links
    #5  
Old Unix and Linux 07-17-2007
sysgate's Unix or Linux Image
sysgate sysgate is offline Forum Advisor  
Unix based
 
Join Date: Nov 2006
Last Activity: 17 November 2016, 5:32 AM EST
Location: Bulgaria
Posts: 1,420
Thanks: 0
Thanked 6 Times in 6 Posts

Code:
awk '{print $5,$6,$7}' /proc/version

or just
Code:
awk '{print $7}' /proc/version

to get the version number directly - 4.1.1 in my case.

Last edited by sysgate; 07-17-2007 at 09:02 AM..
Sponsored Links
    #6  
Old Unix and Linux 08-07-2007
deckard's Unix or Linux Image
deckard deckard is offline
Registered User
 
Join Date: Jul 2002
Last Activity: 8 June 2012, 5:12 PM EDT
Location: Ohio
Posts: 135
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks!

I've been on vacation, but the answers referring to /proc/version are exactly what I needed!Linux
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Kernel Modules Not geting built rupeshkp728 UNIX for Advanced & Expert Users 1 01-28-2012 11:34 AM
bash built-in gwgreen1 Shell Programming and Scripting 4 06-09-2010 02:33 AM
built-in hex editor? Loriel Shell Programming and Scripting 7 12-02-2008 02:56 PM
How to convert Linux Kernel built-in module into a loadable module anitemp Linux 0 10-10-2008 01:33 AM
ksh built-in function solea Shell Programming and Scripting 1 09-23-2004 08:25 AM



All times are GMT -4. The time now is 05:03 AM.