LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 08-29-2005, 08:13 AM   #1
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 339

Rep: Reputation: 31
Kernel compilation problem


When i try to compile my kernels (2.4.29, 2.4.30 2.4.31) i get this error:

Quote:
gcc -D__KERNEL__ -I/boot/linux-2.4.31/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -
fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -fno-unit-at-a-time -DKBUILD_BASENAME=main -c -o init/ma
in.o init/main.c
In file included from /boot/linux-2.4.31/include/linux/kernel.h:15,
from /boot/linux-2.4.31/include/linux/wait.h:13,
from /boot/linux-2.4.31/include/linux/fs.h:12,
from /boot/linux-2.4.31/include/linux/capability.h:17,
from /boot/linux-2.4.31/include/linux/binfmts.h:5,
from /boot/linux-2.4.31/include/linux/sched.h:9,
from /boot/linux-2.4.31/include/linux/mm.h:4,
from /boot/linux-2.4.31/include/linux/slab.h:14,
from /boot/linux-2.4.31/include/linux/proc_fs.h:5,
from init/main.c:15:
/boot/linux-2.4.31/include/asm/byteorder.h:14: warning: type qualifiers ignored on function return type
/boot/linux-2.4.31/include/asm/byteorder.h:30: warning: type qualifiers ignored on function return type
In file included from /boot/linux-2.4.31/include/linux/byteorder/little_endian.h:11,
from /boot/linux-2.4.31/include/asm/byteorder.h:65,
from /boot/linux-2.4.31/include/linux/kernel.h:15,
from /boot/linux-2.4.31/include/linux/wait.h:13,
from /boot/linux-2.4.31/include/linux/fs.h:12,
from /boot/linux-2.4.31/include/linux/capability.h:17,
from /boot/linux-2.4.31/include/linux/binfmts.h:5,
from /boot/linux-2.4.31/include/linux/sched.h:9,
from /boot/linux-2.4.31/include/linux/mm.h:4,
from /boot/linux-2.4.31/include/linux/slab.h:14,
from /boot/linux-2.4.31/include/linux/proc_fs.h:5,
from init/main.c:15:
/boot/linux-2.4.31/include/linux/byteorder/swab.h:160: warning: type qualifiers ignored on function return type
/boot/linux-2.4.31/include/linux/byteorder/swab.h:173: warning: type qualifiers ignored on function return type
/boot/linux-2.4.31/include/linux/byteorder/swab.h:186: warning: type qualifiers ignored on function return type
/boot/linux-2.4.31/include/linux/byteorder/swab.h:200: warning: type qualifiers ignored on function return type
In file included from /boot/linux-2.4.31/include/linux/prefetch.h:13,
from /boot/linux-2.4.31/include/linux/list.h:6,
from /boot/linux-2.4.31/include/linux/wait.h:14,
from /boot/linux-2.4.31/include/linux/fs.h:12,
from /boot/linux-2.4.31/include/linux/capability.h:17,
from /boot/linux-2.4.31/include/linux/binfmts.h:5,
from /boot/linux-2.4.31/include/linux/sched.h:9,
from /boot/linux-2.4.31/include/linux/mm.h:4,
from /boot/linux-2.4.31/include/linux/slab.h:14,
from /boot/linux-2.4.31/include/linux/proc_fs.h:5,
from init/main.c:15:
/boot/linux-2.4.31/include/asm/processor.h:75: error: array type has incomplete element type
make: *** [init/main.o] Error 1
Code:
gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with
-system-zlib --libexecdir=/usr/lib --enable-nls --without-included-gettext --enable-threads=posix --program-suffix=-4.0 --ena
ble-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enabl
e-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror
 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)
any idea how to fix this?
after google searching i find out that i have to downgrade - is this the only solution?

Last edited by JJX; 08-29-2005 at 08:25 AM.
 
Old 08-30-2005, 07:57 AM   #2
mrosati
Member
 
Registered: Nov 2003
Location: Mestre - ITALY
Distribution: Debian sarge
Posts: 132

Rep: Reputation: 15
maybe you have selected some options not supported by your processor? what kind of machine do you have? can't you upgrade insdead of downgrade your kernel?
 
Old 08-30-2005, 08:30 AM   #3
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 602

Rep: Reputation: 49
It looks like you are trying to compile kernel v. 2.4 with gcc4.0. Either use another compiler (gcc3.3 should work ok, 2.95 will definitely work) or use kernel2.6.

Why bother with 2.4 in the first place?
 
Old 08-30-2005, 10:35 AM   #4
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,455

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
Try this:
  1. Save your .config file in a nice, safe place.
  2. make mrproper to clean everything away.
  3. make defconfig to create a default configuration.(or, restore your original .config)
  4. Now make xconfig and select your options again.
I would be in favor of the defconfig route because that will produce a self-consistent set of options and it seems to pay attention to what kind of CPU, etc. you have. However, if you don't want to do that, probably the area where you need to focus is in the selection of "Processor type and features."

Looking at this line in /include/linux/asm/processor.h (using "75g" in the less command, or less +75 ..., either of which put the desired line at the top of the page), I see that this particular line has something to do with SMP... does your system, in fact, have multiple processors?

Curious that you're building a kernel in /boot ... And if you do stick with 2.4, be sure to apply all of its patches!
 
Old 08-31-2005, 06:50 AM   #5
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 339

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by r0b0
It looks like you are trying to compile kernel v. 2.4 with gcc4.0. Either use another compiler (gcc3.3 should work ok, 2.95 will definitely work) or use kernel2.6.

Why bother with 2.4 in the first place?
yep, thats the problem - finally i downgraded to gcc 3.3.6 and everything is ok now. (i was searching for a workaround)


Quote:
Originally posted by sundialsvcs
Curious that you're building a kernel in /boot ... And if you do stick with 2.4, be sure to apply all of its patches! [/B]
- why not build the kernel in /boot dir???
- kernel patches are cumulative or not? (i think 2.4.31 includes all patches)

- with the first chance (lack of time) i will upgrade to 2.6.12

thx for the replies
 
  


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
problem during kernel compilation!! vishamr2000 Linux - General 6 11-21-2005 06:08 AM
Kernel compilation problem LinuxLover Linux - Enterprise 3 05-11-2005 12:03 PM
kernel compilation problem SirrusX Slackware 8 03-07-2005 08:13 AM
kernel compilation problem vishamr2000 Linux - Newbie 2 08-22-2004 05:35 AM
Problem after 2.6.3 kernel compilation frzburn Linux - General 3 03-11-2004 08:12 AM


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

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