LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-28-2008, 05:48 PM   #1
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Rep: Reputation: 30
Build kernel with GCC, errors?


Why can't I build the 2.4.34 kernel with a newer version of GCC? Error messages indicated not to use GCC >= 4.2 because it does not compile the kernel. It would not build. It stopped.

1) Why can't you use a later version of GCC?
2) Isn't GCC backward compatible?
3) Aren't there command-line options to have GCC >=4.2 compile an older Linux kernel? Why?
 
Old 04-28-2008, 06:21 PM   #2
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
Usually you have to add the compatibility libs to compile code that was designed for older GCC versions. The more specialized the compile (like kernels) the more you need these libs. For instance in Fedora we have compat-gcc-34 for compatibility with gcc 3.4. They only seem to do this on major code jumps (2.96, 3.4).
 
Old 04-28-2008, 06:55 PM   #3
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL
Distribution: Funtoo
Posts: 6,926

Rep: Reputation: 128Reputation: 128
Welcome to LQ!

Why are you trying to build such an old kernel version in the first place?

The latest stable kernel is 2.6.25.

You should read Linux Kernel in a Nutshell to learn about the Linux kernel.
 
Old 04-28-2008, 08:14 PM   #4
ischi
Member
 
Registered: Apr 2008
Location: Tübingen
Distribution: Fedora 9 (Thinkpad T60), Debian 3.1 (Server)
Posts: 51

Rep: Reputation: 15
The GCC is not backwards compatible, at least it doesn't have to be, if a File depends on special funtions which are no longer availible in the next version. Especially the Kernel might heavyly depend on functions which were special to the GCC of this time to provide an optimized Code. But you can have more than one gcc on your PC ... personnally i still use the gcc3.3 for special libs i have to work with.
Between version 3 and 4 GCC was under heavy development so don't expect it to be very compatible with earlier Code, at least if its like Kernel Code.
 
Old 04-29-2008, 03:19 PM   #5
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Original Poster
Rep: Reputation: 30
Question GCC backward compatibility libraries

Thank you for the input on GCC.

1) What libraries can I use for backward compatibility?
2) Where can I find them? There did not seem to be any on the main GCC site.
 
Old 04-29-2008, 06:22 PM   #6
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
What distro are you using?
 
Old 04-29-2008, 06:31 PM   #7
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Original Poster
Rep: Reputation: 30
OpenSuse.
Are there different names for the backward compatibility libraries? Are they made by Gnu?

Since you can download and build GCC from the GNU web site, is it better to just do that then trying to use backward compatible libraries, if there is a problem with distributions of Linux?
 
Old 04-29-2008, 06:44 PM   #8
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
You really want to stick with the one(GCC) for your distro (saves a lot of headaches). Each distro MAY call the compatible libs something slightly different.

Why are you trying to put a 2.4 kernel on a 2.6 distro? That is going to cause all kinds of hate and discontent.
 
Old 04-29-2008, 06:53 PM   #9
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Original Poster
Rep: Reputation: 30
Question Backward Kernel, impossible?

1) Will it not work to go to a previous version kernel? I am not planning to run an earlier kernel for a long time. I just want to try it. This is all new to me.

2) How can I build old kernels and run them then? They build soooo much faster.

3) Where can I find the source for the backward compatibility libraries so that I can build them to see if that solves it?
 
Old 04-29-2008, 06:57 PM   #10
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL
Distribution: Funtoo
Posts: 6,926

Rep: Reputation: 128Reputation: 128
The 2.6 kernels build much faster than the 2.4 kernels,
and the steps to build are more simple. Kernel Rebuild Guide

Check the requirements for any software before you build.
 
Old 04-29-2008, 07:06 PM   #11
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Original Poster
Rep: Reputation: 30
2.4 builds must faster than 2.6

Not so for me. The builds of the 2.4.36 kernels have been 10 to 20 times faster than the builds for the 2.6.2X kernels. I have been doing clean builds, so everything is built.
 
Old 04-29-2008, 07:34 PM   #12
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL
Distribution: Funtoo
Posts: 6,926

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by newtovanilla View Post
Why can't I build the 2.4.34 kernel with a newer version of GCC? Error messages indicated not to use GCC >= 4.2 because it does not compile the kernel. It would not build. It stopped.

1) Why can't you use a later version of GCC?
2) Isn't GCC backward compatible?
3) Aren't there command-line options to have GCC >=4.2 compile an older Linux kernel? Why?
You changed version numbers from your OP to post #11:
Quote:
Not so for me. The builds of the 2.4.36 kernels have been 10 to 20 times faster than the builds for the 2.6.2X kernels. I have been doing clean builds, so everything is built.
Are you saying 2.4.36 builds with gcc-4.2 and 2.4.34 does not?

I have not built a 2.4 series kernel since this one on my server:
Code:
mingdao@paul:~$ uname -a
Linux paul 2.4.31 #5 Sat Mar 11 20:06:20 CST 2006 i686 unknown unknown GNU/Linux
but you'd have to provide some output, such as "time make" to convince me.
 
Old 04-29-2008, 07:35 PM   #13
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
Ok, using older kernels (2.4 to 2.6, Major revision change) is not a big deal on the compile based distros(slack, gentoo,etc) but on the package based distros (Fedora, Suse, etc) the system is very tightly integrated with the kernel. If you want to run older kernels, it will be much easier if you use a distro designed to do this type of thing (like gentoo).

The backward compatible libs should be available on suse through yast.
 
Old 04-29-2008, 09:18 PM   #14
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Original Poster
Rep: Reputation: 30
Build for 2.4.3X

Thank you for your comments.

The kernel builds for all of the 2.4.3X tries that I have made have built fast. Roughly 10 to 20 times faster than the 2.6.2X builds. But that is not the point of this post! I have been posting about compile error messages with later versions of GCC when trying to compile the 2.4.3X kernels. I have had much fewer errors trying the 2.4.3X kernels.

1) Where can I get the source code to build the compatibility libraries for GCC? As opposed to using a distribution rpm or package. Isn't this something that GNU provides?

2) If you want to compare the build times for the 2.4.3X and the 2.6.2X kernels, you can time them on your system. As you probably already know, they may build faster if you do not build them clean, including all modules. But I am new to all this stuff!
 
Old 04-30-2008, 12:07 AM   #15
newtovanilla
Member
 
Registered: Apr 2008
Posts: 267

Original Poster
Rep: Reputation: 30
Smile Older Version of GCC works

I tried an older version of GCC without using the compatiability libraries and the newer GCC, and there were no build errors. The older version of GCC seemed to solve that problem. It does not help me to figure out why the newer version would not work. I have not been able to try to use the compatibility libraries yet.

For the timing data on the kernel build of 2.4.36:
real 5m9.813s
user 4m23.492s
sys 0m19.957s

For the timing data on the kernel build of 2.6.20:
It was still building past 70 minutes. It shortly crashed after that. Some other tries without any time data were about an hour plus some naps.

That time utility is neat. Thank you for that comment. Thank you for the compatibility library comment too. It may help me to get the newer version of GCC to work to build the older kernels.

The 2.4.3X kernel does not boot but it builds without error.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
GCC errors in ndiswrapper build karloslambchop Linux - Wireless Networking 3 05-26-2006 03:39 AM
need to make ndiswrapper for 16k stacks kernel but build errors cDizzle Linux - Software 1 04-10-2006 04:01 PM
kernel build problems -how to install older gcc version? kpachopoulos Fedora 3 07-04-2005 09:56 AM
First kernel build and getting boot errors astender Linux - General 1 11-22-2004 04:20 PM
kernel build from gcc 3.3.2 to gcc 3.4.1 alcarbone Linux - Software 1 09-13-2004 09:19 AM


All times are GMT -5. The time now is 03:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration