LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Cannot compile kernel due to bzImage error (https://www.linuxquestions.org/questions/linux-software-2/cannot-compile-kernel-due-to-bzimage-error-345064/)

zahoo 07-20-2005 12:25 PM

Cannot compile kernel due to bzImage error
 
Hi,

I'm not a newbie at kernel compilation at all. I've compiled kernel more than 100 times (at least). I'm using Debian sid. My problem is the following: I want to compile 2.4.x kernel (I tried 2.4.25 2.4.27). I got the sources from the ftp.hu.kernel.org. I untarred them, made the config. I made it up to the "make dep" but the "make bzImage" failed. It says something about main.h error (I will include it soon, I am not at home right now).

So here is the error message:

"In file included from /usr/src/linux/include/linux/prefetch.h:13,
from /usr/src/linux/include/linux/list.h:6,
from /usr/src/linux/include/linux/wait.h:14,
from /usr/src/linux/include/linux/fs.h:12,
from /usr/src/linux/include/linux/capability.h:17,
from /usr/src/linux/include/linux/binfmts.h:5,
from /usr/src/linux/include/linux/sched.h:9,
from /usr/src/linux/include/linux/mm.h:4,
from /usr/src/linux/include/linux/slab.h:14,
from /usr/src/linux/include/linux/proc_fs.h:5,
from init/main.c:15:
/usr/src/linux/include/asm/processor.h:75: error: array type has incomplete
element type
In file included from /usr/src/linux/include/linux/sched.h:23,
from /usr/src/linux/include/linux/mm.h:4,
from /usr/src/linux/include/linux/slab.h:14,
from /usr/src/linux/include/linux/proc_fs.h:5,
from init/main.c:15:
/usr/src/linux/include/linux/smp.h:29: error: conflicting types for
'smp_send_reschedule'
/usr/src/linux/include/asm/smp.h:42: error: previous declaration of
'smp_send_reschedule' was here
In file included from /usr/src/linux/include/linux/unistd.h:9,
from init/main.c:17:
/usr/src/linux/include/asm/unistd.h:375: warning: conflicting types for
built-in function '_exit'
make: *** [init/main.o] Error 1"



I even tried to compile 2.6.5 kernel (of course with "make" instead of "make dep" and "make bzImage") but it failed too.
The strange thing is that I compiled the 2.4.25 kernel before on this system. The only change I made is that I made an apt-get dist-upgrade (since it used to be a woody). But I reinstalled the whole system from the very beginning (fdisk, etc...) and put a clear sid on the laptop. The result is the same. I'm not able to compile any of kernels despite that I'm using original "fresh" kernel-sources.

There might be some problem with the sid packages?

Any help is appreciated!

Thanks!


Zahoo

Zeistler 07-21-2005 05:19 AM

Which version of Gcc do you have installed?

type gcc -v in console to check

Some versions of gcc are unable to build the kernel due to various problems.

zahoo 07-25-2005 09:23 PM

Thank Zeistler,

your hint solved my problem. I think when I made a dist-upgrade to sid the gcc was updated to gcc-4.x. I set up a pure sarge system on my computer and everything is fine now.

I just don't know what was I missing in my sid version in order to be able to compile the kernel with a very new compiler like gcc-4.x. I think I got to figure it out if want to keep up with sid. Does anyone have an idea or experience about this (compiling kernel with gcc > 4.0) problem?

Thanks anyway!


Zahoo

Teukka 08-18-2005 07:33 AM

Hi

I have the same problem in unstable debian, solved it like this:

Code:

apt-get install gcc-3.4
rm /usr/bin/gcc && ln -s /usr/bin/gcc3.4 /usr/bin/gcc

And then compiled the kernel, works just fine.

I'ts your choice if you leave gcc to point "old" gcc or not


All times are GMT -5. The time now is 01:40 PM.