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:
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?
maybe try symlinking /usr/bin/gcc-3.4 to /usr/bin/gcc ??
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.
You may want to try gcc-3.4.6 the way I build it:
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:
Also, for what it is worth, gcc-4.1.2 is the last compiler which works for kernel 2.4.
Perhaps the least resistive approach is to create a Slackware 11.0 virtual machine and compile from within there. (Sigh.) :scratch:
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.
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
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).
|All times are GMT -5. The time now is 11:09 PM.|