Update
Using the old gcc, compiling the kernel worked, but then the image was much too big. Therefore, I rearranged the .config file using make menuconfig, and I set many drivers to "module". Now, new errors appear, which I document on ErrorCompilingKernel20031130 ... ---
{{{New Knowledge: On my debian system, there is also the gcc-2.95 compiler! Now, I just changed the link from gcc to this older version. However, the finally mentioned error does not vanish. On the other hand, there shouldn't be any need of recompiling the kernel to match the gcc version with the kernel compiler's version...}}}
Documentation of Errors that Prevent Kernel Compilation
(2003 - 11 - 28)
I just downloaded the kernel source of version 2.4.22. My gcc's verion is 3.3.2 (Debian, x86). The config file for the compilation is quoted below. After {{{make oldconfig make dep make clean }}} I started 'make vmlinux' and got a first error in usb.h: {{{make all_targets make[3]: Entering directory `/data/src/linux-2.4.22/drivers/usb' gcc -DKERNEL -I/data/src/linux-2.4.22/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -nostdinc -iwithprefix include -DKBUILD_BASENAME=usb -DEXPORT_SYMTAB -c usb.c gcc -DKERNEL -I/data/src/linux-2.4.22/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -nostdinc -iwithprefix include -DKBUILD_BASENAME=usb_debug -c -o usb-debug.o usb-debug.c gcc -DKERNEL -I/data/src/linux-2.4.22/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -nostdinc -iwithprefix include -DKBUILD_BASENAME=hub -c -o hub.o hub.c gcc -DKERNEL -I/data/src/linux-2.4.22/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -nostdinc -iwithprefix include -DKBUILD_BASENAME=devio -c -o devio.o devio.c gcc -DKERNEL -I/data/src/linux-2.4.22/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-comon -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -nostdinc -iwithprefix include -DKBUILD_BASENAME=inode -c -o inode.o inode.c inode.c:681: error: redefinition of `usbdevfs_add_bus' /data/src/linux-2.4.22/include/linux/usb.h:1119: error: `usbdevfs_add_bus' previously defined here inode.c:693: error: redefinition of `usbdevfs_remove_bus' /data/src/linux-2.4.22/include/linux/usb.h:1120: error: `usbdevfs_remove_bus' previously defined here inode.c:703: error: redefinition of `usbdevfs_add_device' /data/src/linux-2.4.22/include/linux/usb.h:1121: error: `usbdevfs_add_device' previously defined here inode.c:715: error: redefinition of `usbdevfs_remove_device' /data/src/linux-2.4.22/include/linux/usb.h:1122: error: `usbdevfs_remove_device' previously defined here inode.c:750: error: redefinition of `usbdevfs_init' /data/src/linux-2.4.22/include/linux/usb.h:1124: error: `usbdevfs_init' previously defined here inode.c:775: error: redefinition of `usbdevfs_cleanup' /data/src/linux-2.4.22/include/linux/usb.h:1125: error: `usbdevfs_cleanup' previously defined here make[3]: *** [inode.o] Error 1 make[3]: Leaving directory `/data/src/linux-2.4.22/drivers/usb' make[2]: *** [first_rule] Error 2 make[2]: Leaving directory `/data/src/linux-2.4.22/drivers/usb' make[1]: *** [_subdir_usb] Error 2 make[1]: Leaving directory `/data/src/linux-2.4.22/drivers' make: *** [_dir_drivers] Error 2 }}} As this seemed due to a non-working #ifdef/#else fork in the header file, now I commented out the affected lines 1119 to 1125: {{{#ifdef CONFIG_USB_DEVICEFS
extern void usbdevfs_add_bus(struct usb_bus *bus); extern void usbdevfs_remove_bus(struct usb_bus *bus); extern void usbdevfs_add_device(struct usb_device *dev); extern void usbdevfs_remove_device(struct usb_device *dev);
extern int usbdevfs_init(void); extern void usbdevfs_cleanup(void);
#else