Home Man
Today's Posts

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

Which GCC Built My Kernel?


Login to Reply

Thread Tools Search this Thread
# 1  
Old 06-19-2007
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)


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

Any suggestions?
# 2  
Old 06-19-2007
Try nm on the binary and see what symbols it spits out.
# 3  
Old 06-20-2007
Originally Posted by porter
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 07-17-2007
cat /proc/version | head -n1 | cut -d" " -f1-3,5-7
# 5  
Old 07-17-2007
awk '{print $5,$6,$7}' /proc/version

or just
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..
# 6  
Old 08-07-2007

I've been on vacation, but the answers referring to /proc/version are exactly what I needed!
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unload kernel module at boot time (Debian Wheezy 7.2, 3.2.0-4-686-pae kernel) gacanepa Linux 0 01-01-2014 01:21 PM
Using gFORTRAN to compile something built for g77 butson UNIX for Dummies Questions & Answers 8 05-22-2013 02:08 PM
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
Which file is read by kernel to set its default system kernel parameters values? girish.batra Solaris 1 03-28-2010 03:09 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
Built in ram limit for 64 bit kermit Linux 2 05-18-2007 03:42 PM
ksh built-in function solea Shell Programming and Scripting 1 09-23-2004 08:25 AM
awk built in variables Reza Nazarian UNIX for Dummies Questions & Answers 4 02-18-2002 12:50 AM

All times are GMT -4. The time now is 05:25 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password