LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 01-23-2009, 11:11 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 3,476

Rep: Reputation: 531Reputation: 531Reputation: 531Reputation: 531Reputation: 531Reputation: 531
Sorry, your GCC is too recent for kernel 2.4


There are a few threads here at LQ about using both GCC 3.4.x and 4.x.

When I try to compile the 2.4 kernel in Slackware 12.2, I receive the message "Sorry, your GCC is too recent for kernel 2.4."

I have Eric's GCC 3.4 package installed. I checked the PATH variable and gcc34 is in the path.

I use a shell script to automate my kernel compiles. Although I am not running a .configure file, I nonetheless tried the following in my script:

CC=gcc34
CXX=g++34
export CC CXX

Same error message.

Is there a way to pass the GCC 34 information to the newer make command?

What am I missing?

Thanks.
 
Old 01-23-2009, 11:37 PM   #2
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Rep: Reputation: 35
maybe try symlinking /usr/bin/gcc-3.4 to /usr/bin/gcc ??
 
Old 01-24-2009, 12:55 AM   #3
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by Woodsman View Post
There are a few threads here at LQ about using both GCC 3.4.x and 4.x.

When I try to compile the 2.4 kernel in Slackware 12.2, I receive the message "Sorry, your GCC is too recent for kernel 2.4."

I have Eric's GCC 3.4 package installed. I checked the PATH variable and gcc34 is in the path.

I use a shell script to automate my kernel compiles. Although I am not running a .configure file, I nonetheless tried the following in my script:

CC=gcc34
CXX=g++34
export CC CXX

Same error message.

Is there a way to pass the GCC 34 information to the newer make command?

What am I missing?

Thanks.
As I remember it gcc/g++ 3.4 were named something like "gcc-3.4.0" and "gcc-3.4.0-g++", not "gcc34" and "g++34". Just open shell, type "gcc", press "tab" and see what is available.

Have you tried "make CC=gcc-3.4.0 CXX=gcc-3.4.0-g++" ? It should work.

If it doesn't (although it is VERY unlikely), read kernel's makefile find out which variable is used to specify compiler, and override it on commandline.


Quote:
Originally Posted by lurko View Post
maybe try symlinking /usr/bin/gcc-3.4 to /usr/bin/gcc ??
No, it is possible to use another compiler without that.
 
Old 01-24-2009, 01:42 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,749

Rep: Reputation: 461Reputation: 461Reputation: 461Reputation: 461Reputation: 461
You may want to try gcc-3.4.6 the way I build it:
http://distro.ibiblio.org/pub/linux/...vel/gcc-3.4.6/

I build and install it in its' own separate subdirectory instead of puttin it in the regular path and then use a wrapper to run it with. The wrapper, called GCC34, is placed in the regular path and sets up the PATH variable for the extra compiler, so thta using the compiler is as easy as:
GCC34 (commands)

Also, for what it is worth, gcc-4.1.2 is the last compiler which works for kernel 2.4.
 
Old 01-24-2009, 02:28 PM   #5
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 3,476

Original Poster
Rep: Reputation: 531Reputation: 531Reputation: 531Reputation: 531Reputation: 531Reputation: 531
Quote:
Also, for what it is worth, gcc-4.1.2 is the last compiler which works for kernel 2.4.
Sometimes I am weary of the "moving target" aspect of free/libre software. Improvements usually are beneficial. Usually.

Perhaps the least resistive approach is to create a Slackware 11.0 virtual machine and compile from within there. (Sigh.)
 
Old 01-25-2009, 01:53 AM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,749

Rep: Reputation: 461Reputation: 461Reputation: 461Reputation: 461Reputation: 461
Yeah, I know what you mean -I'm still running an 11.0 as my main workbase. I should tell you also that gcc-4.1.2 will only work for the latest 2.4 kernels -I think only 2.4.37. For anything between the original 2.4.33 which came with slack-11.0, you'll need to use gcc-3.4.6. Willy Tarreau did some work for the 2.4.37 release which allows it to compile with gcc as late as 4.1.2. He even tried with later compilers, but the results were worse than failure -what I mean is that the kernel compiles without warnings but does not work.

Still, 3.4.6 is a pretty stable compiler and it is good to have a working install of it if you ever compile old code.
 
Old 01-27-2009, 04:03 PM   #7
wtarreau
haproxy maintainer
 
Registered: Mar 2008
Posts: 3

Rep: Reputation: 0
Hi,

ErV is right, you have to pass CC= on the "make" command line. Make
does not override its own variables with environment variable, but
only with variables on the command line.

I'm personally used to build my kernels with "make CC=gcc-3.4" on a
lot of machines. It could happen that you also have to force "HOSTCC"
if you find one gcc which is not able to build the userspace tools
such as lxdialog, etc... though that has not happened to me yet.

So in order to resume :
- make CC=gcc-3.4 oldconfig
- make CC=gcc-3.4 dep
- make CC=gcc-3.4 bzImage modules

etc...
I strongly recommend that you do NOT replace your standard gcc with
the old one. You should just get used to passing the variable to make,
that way you'll get far less unpleasant surprizes.

For those interested in building their own environment, I suggest
that you read "linux-2.4.37/Documentation/using-newer-gcc.txt" that
describes the whole process in details (at least I hope).

Cheers,
Willy
 
  


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
I Can't Update To The Most Recent Kernel/Headers davidx Linux - Software 18 10-19-2008 09:57 PM
Slackware's recent gcc upgrades LocoMojo Slackware 11 12-19-2005 07:20 PM
I/O problems with CD-ROM after recent (04JAN05) kernel update kirill_igum Fedora 2 01-05-2005 12:39 PM
compiling kernel 2.2.26 on a recent distro syrekron Linux - General 2 06-23-2004 10:06 AM
vmware recent kernel support? Present Linux - Software 2 04-07-2004 03:26 PM


All times are GMT -5. The time now is 04:04 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration