LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-20-2009, 07:43 AM   #1
urentity
Member
 
Registered: Jan 2009
Posts: 48

Rep: Reputation: 15
build-essential's gcc often different to what kernel was compiled with


I'm sure this question has been answered, apols in advance, but if you install Debian lenny and later get all the devel tools inside the build-essential, it's a good bet the gcc version will be different.

So you could end up "make" ing stuff with a gcc version different to your running kernel.

My question .. I take it, most people end up recompiling their kernel with the right resident gcc version? Do any more packages have to be recompiled after this? Like libc6 or something?
 
Old 07-20-2009, 08:06 AM   #2
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Bullseye
Posts: 1,508

Rep: Reputation: Disabled
Personally i wouldn't be recompiling the kernel,you can install the appropriate gcc then temporarily use that version.
Here's an example:

Code:
aptitude install gcc-4.1
Code:
export CC=/usr/bin/gcc-4.1
You can check the version with:

Code:
echo $CC
Once you close the shell you will go back to running the original version of gcc.
 
Old 07-21-2009, 12:14 PM   #3
urentity
Member
 
Registered: Jan 2009
Posts: 48

Original Poster
Rep: Reputation: 15
environmental variables are one of my weaknesses.

I don't see $CC coming up too often, so, instead, I apt-get'd v4.1 and changed the /usr/bin/gcc symlink to point to it.

Thanks for the reply!
 
Old 07-21-2009, 12:35 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I apt-get'd v4.1 and changed the /usr/bin/gcc symlink to point to it.
Hope you remembered to undo this change when you were done.
 
Old 07-21-2009, 04:03 PM   #5
mk27
Member
 
Registered: Sep 2008
Distribution: fedora, gentoo, ubuntu
Posts: 148

Rep: Reputation: 23
Quote:
Originally Posted by urentity View Post
So you could end up "make" ing stuff with a gcc version different to your running kernel.

My question .. I take it, most people end up recompiling their kernel with the right resident gcc version? Do any more packages have to be recompiled after this? Like libc6 or something?
1) it does not matter if you use a different gcc version. All GCC versions for more than a decade are C standard compliant. What matters is that the development library (glibc) be the same version as the actual library in use, which if you install from packages it will be, and that the library in use is the one the kernel (and 100% of everything else) was compiled against. If that were not the case, you would probably find out right away and your system would be totally broken, but it seems very very unlikely IMO unless you do something incredibly stupid. Recompiling glibc itself is very difficult and you are about as likely to have done that by accident as you are to wake up on the moon tomorrow. So don't worry your head about it.

You don't even have to use GCC. You could try a different compiler; it's the devel libraries that count.

2) "Do any more packages have to be recompiled after this? Like libc6 or something?" For sure not, and as I just said you are unlikely to be able to do such a thing anyway.

Making your own kernel is fine -- I almost always replace the stock kernel. You can screw it up, but don't be scared away, just make sure you understand how to use grub to select a kernel so you can switch back to the original one (ie, make sure each one has it's own menu.lst entry).

There used to be a caveats, vis, which gcc version to use, but I have not seen one of those in years.

Anyway, just to reiterate: it does not matter about the gcc version. If they issued an updated gcc package tomorrow for some reason, it will be fine.

Also: the compiler used to build the distro kernel is probably *not* the distro compiler, no matter what -- but that's just a guess.

Last edited by mk27; 07-21-2009 at 04:13 PM.
 
  


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
Build kernel with GCC, errors? newtovanilla Linux - Newbie 19 05-05-2008 03:17 PM
How to build a pre compiled kernel with source as a single rpm? sundarhere Linux - Kernel 0 10-26-2006 02:27 AM
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
kernel build from gcc 3.3.2 to gcc 3.4.1 alcarbone Linux - Software 1 09-13-2004 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:56 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