LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Sorry, your GCC is too recent for kernel 2.4 (http://www.linuxquestions.org/questions/slackware-14/sorry-your-gcc-is-too-recent-for-kernel-2-4-a-699519/)

Woodsman 01-23-2009 11:11 PM

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.

lurko 01-23-2009 11:37 PM

maybe try symlinking /usr/bin/gcc-3.4 to /usr/bin/gcc ??

ErV 01-24-2009 12:55 AM

Quote:

Originally Posted by Woodsman (Post 3419326)
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 (Post 3419347)
maybe try symlinking /usr/bin/gcc-3.4 to /usr/bin/gcc ??

No, it is possible to use another compiler without that.

gnashley 01-24-2009 01:42 AM

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.

Woodsman 01-24-2009 02:28 PM

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.) :scratch:

gnashley 01-25-2009 01:53 AM

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.

wtarreau 01-27-2009 04:03 PM

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


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