>From MandrakeLinux-9.0beta2-CD3.i586.iso
rpm: kernel-source-2.4.18-22mdk.i586.rpm
"make modules" doesn't work out of the box. I'm using Mandrake 8.1,
gcc version 2.96 20000731 (Mandrake Linux 8.1 2.96-0.62mdk) as my development
system.
After "make clean", "make depend", "make bzImage", "make modules", the build
fails at "drivers/char/ftape/compressor/zftape-compress.c". The build output
is:
gcc -D__KERNEL__ -I/usr/src/linux-2.4.18-22mdk/include -Wall -Wstrict-prototype
s -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe
-mpreferred-stack-boundary=2 -march=i586 -DMODULE -DMODVERSIONS -include /usr/s
rc/linux-2.4.18-22mdk/include/linux/modversions.h -nostdinc -I /usr/lib/gcc-lib
/i586-mandrake-linux-gnu/2.96/include -DKBUILD_BASENAME=zftape_compress -c -o z
ftape-compress.o zftape-compress.c
In file included from /usr/src/linux-2.4.18-22mdk/include/linux/mm.h:4,
from zftape-compress.c:35:
/usr/src/linux-2.4.18-22mdk/include/linux/sched.h:6: nondigits in number and not
hexadecimal
/usr/src/linux-2.4.18-22mdk/include/linux/sched.h:6: nondigits in number and not
hexadecimal
/usr/src/linux-2.4.18-22mdk/include/linux/sched.h:6: parse error before `7b16c34
4'
/usr/src/linux-2.4.18-22mdk/include/linux/sched.h:6: warning: function declarati
on isn't a prototype
make[4]: *** [zftape-compress.o] Error 1
make[4]: Leaving directory `/usr/src/linux-2.4.18-22mdk/drivers/char/ftape/compr
essor'
It looks like the modversions macros have failed, because rhconfig.h or
linux/version.h isn't included prior to the include of "linux/sched.h"
I'm not at all sure what the right way to fix this is. A simple program
like that has only one line:
#include <linux/sched.h>
will fail to compile with the compile
line:
gcc -D__KERNEL__ -I/usr/src/linux-2.4.18-22mdk/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe
-mpreferred-stack-boundary=2 -march=i586 -DMODULE -DMODVERSIONS -include
/usr/src/linux-2.4.18-22mdk/include/linux/modversions.h -g -nostdinc -I
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/2.96/include -c test.c
One way to fix it would be to include "linux/version.h" immediately before
the declaration of 'event' in "linux/sched.h".
What's the correct way to fix this??