Skip to contentSkip to conversation

xtime declaration

DISCUSSION Bryan Chua 3 participants 4 messages Aug 2, 2001 – Aug 3, 2001 MIPS

lore
Share & tools
lore

Bryan Chua

author
#0 lore raw

Has anyone else come across a compile error:

mips-linux-gcc -I /local/chua/public/linux-mips-latest/include/asm/gcc -D__KERNEL__ -I/local/chua/public/linux-mips-latest/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -G 0
-mno-abicalls -fno-pic -mcpu=r5000 -mips2 -Wa,--trap -pipe -c -o
timer.o timer.c
timer.c:35: conflicting types for xtime' /local/chua/public/linux-mips-latest/include/linux/sched.h:540: previous declaration of xtime'

in include/linux/sched.h:
extern struct timeval xtime;

int timer.c:
volatile struct timeval xtime __attribute__ ((aligned (16)));

I am using gcc 3.0 and binutils 2.11.2, both of the released versions. I do not know if my kernel actually runs yet with this toolchain...

-- bryan

#1 lore raw
Quoted 11 lines · Bryan Chua

Has anyone else come across a compile error:

mips-linux-gcc -I /local/chua/public/linux-mips-latest/include/asm/gcc

(quoted diff) +0 -3
-D__KERNEL__ -I/local/chua/public/linux-mips-latest/include -Wall
-Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -G 0
-mno-abicalls -fno-pic -mcpu=r5000 -mips2 -Wa,--trap -pipe    -c -o

timer.o timer.c
timer.c:35: conflicting types for xtime' /local/chua/public/linux-mips-latest/include/linux/sched.h:540: previous declaration of xtime'

Quoted 8 lines

in include/linux/sched.h:
extern struct timeval xtime;

int timer.c:
volatile struct timeval xtime __attribute__ ((aligned (16)));

I am using gcc 3.0 and binutils 2.11.2, both of the released versions. I do not know if my kernel actually runs yet with this toolchain...

That's a bug which got fixed in the latest kernels by removing the volatile from the sched.h declaration.

Ralf

#2 lore raw

Ralf Baechle wrote:
[snip]

Quoted 7 lines
Quoted 7 lines

timer.c:35: conflicting types for xtime' /local/chua/public/linux-mips-latest/include/linux/sched.h:540: previous declaration of xtime'

in include/linux/sched.h:
extern struct timeval xtime;

Quoted 8 lines
Quoted 5 lines

int timer.c:
volatile struct timeval xtime __attribute__ ((aligned (16)));

I am using gcc 3.0 and binutils 2.11.2, both of the released versions. I do not know if my kernel actually runs yet with this toolchain...

That's a bug which got fixed in the latest kernels by removing the volatile from the sched.h declaration.

And since timer.c kept the volatile definition, it does not compile now. The volatile should either be removed in timer.c or added in sched.h, I don't know what is right.

Thiemo

#3 lore raw
Quoted 6 lines · Thiemo Seufer
Quoted 2 lines

That's a bug which got fixed in the latest kernels by removing the volatile from the sched.h declaration.

And since timer.c kept the volatile definition, it does not compile now. The volatile should either be removed in timer.c or added in sched.h, I don't know what is right.

Remove the volatile from timer.c; that's what's in 2.4.7.

Ralf