You are not logged in.

#1 2005-05-05 22:16:43

nuopus
Member
From: Mesa, AZ
Registered: 2005-03-09
Posts: 60

kernel compile gcc 4.0

Hello, I seem to be having trouble compiling the current 2.6 kernel in ABS with gcc 4.0. I get the following errors:

 CC [M]  drivers/i2c/algos/i2c-algo-bit.o
In file included from drivers/i2c/algos/i2c-algo-bit.c:31:
include/linux/i2c.h:58: error: array type has incomplete element type
include/linux/i2c.h:197: error: array type has incomplete element type
make[3]: *** [drivers/i2c/algos/i2c-algo-bit.o] Error 1
make[2]: *** [drivers/i2c/algos] Error 2
make[1]: *** [drivers/i2c] Error 2
make: *** [drivers] Error 2
==> ERROR: Build Failed.  Aborting...

Does anyone know of a patch for the 2.6 kernel so that it is compilable with gcc 4.0?

Offline

#2 2005-05-05 22:23:47

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: kernel compile gcc 4.0

yeah, I've gotten those same errors with gcc4

from: http://www.coyotegulch.com/reviews/gcc4/

GCC 4.0 did compile a working kernel; I'm running it even as I type this sentence. The road to success was a bit bumpy; GCC 4.0 produces more warnings than did its predecessors, and I had to make trivial changes in two function prototypes from the file include/linux/i2c.h. GCC 4,0 objected to a declaration like this:

extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num);

I replaced the above with the following:

extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg * msg,int num);

Offline

#3 2005-05-13 21:51:23

mdk
Member
From: Helsinki/Finland
Registered: 2005-04-04
Posts: 26
Website

Re: kernel compile gcc 4.0

Same here. Mayber gcc4 should be moved to "unstable" for the time being?


MDK
Open Source Software Operations/Nokia
michael.kostrzewa (at) nokia.com

Offline

#4 2005-05-13 22:07:07

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: kernel compile gcc 4.0

mdk wrote:

Same here. Mayber gcc4 should be moved to "unstable" for the time being?

umm... it's in testing... testing is a bit worse than unstable... and technically gcc isn't unstable, its that programs haven't updated their code to work with gcc4 yet...

http://archlinux.org/packages.php?id=6522

Offline

#5 2005-05-14 10:30:03

neri
Forum Fellow
From: Victoria, Canada
Registered: 2003-05-04
Posts: 553

Re: kernel compile gcc 4.0

Hi,

this might help, at least I made it for our kernel26
http://www.justdreams.de/archlinux/down … rnel.patch

it shouldn't hurt gcc-3.4 compiler
for the scsi Kernel I'm not sure, some other modules might be affected,
too. For custoumized builds you prolly discover some more non C99
compliant modules.
Look at this quote from
http://gnu.open-mirror.com/software/gcc … anges.html
if you wanna fix things:

Arrays of incomplete element type are invalid in C. GCC now issues
an error for such arrays. Declarations such as extern struct s x[]; (where
struct s  has not been defined) can be moved after the definition of struct s.
Function parameters declared as arrays of incomplete type can instead be declared as pointers.

-neri

Offline

#6 2005-05-20 08:35:12

sweiss
Member
Registered: 2004-02-16
Posts: 635

Re: kernel compile gcc 4.0

phrakture wrote:

yeah, I've gotten those same errors with gcc4

from: http://www.coyotegulch.com/reviews/gcc4/

GCC 4.0 did compile a working kernel; I'm running it even as I type this sentence. The road to success was a bit bumpy; GCC 4.0 produces more warnings than did its predecessors, and I had to make trivial changes in two function prototypes from the file include/linux/i2c.h. GCC 4,0 objected to a declaration like this:

extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num);

I replaced the above with the following:

extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg * msg,int num);

Hmm, since when was a statement like the original one flawed? That's weird.

Offline

#7 2005-05-20 18:57:43

bogomipz
Member
From: Oslo, Norway
Registered: 2003-11-23
Posts: 169

Re: kernel compile gcc 4.0

neri wrote:

this might help, at least I made it for our kernel26
http://www.justdreams.de/archlinux/down … rnel.patch

Worked like charm for my custom kernel, thanks a lot. smile


All of your mips are belong to us!!

Offline

Board footer

Powered by FluxBB