I installed Red Hat 7.0. I tried to recompile a new configured kernel but I could not. I'm using an x86 PC with an Athlon AMD processor 750MHz. I downloaded 2.2.17 version of the Linux kernel at linux.org. floppy.c:603:60: warning: pasting would not give a valid preprocessing token floppy.c:712:34: warning: pasting would not give a valid preprocessing token floppy.c:718:72: warning: pasting would not give a valid preprocessing token floppy.c:719:48: warning: pasting would not give a valid preprocessing token floppy.c:720:67: warning: pasting would not give a valid preprocessing token floppy.c:721:49: warning: pasting would not give a valid preprocessing token floppy.c:883:36: warning: pasting would not give a valid preprocessing token floppy.c:1131:36: warning: pasting would not give a valid preprocessing token floppy.c:1158:41: warning: pasting would not give a valid preprocessing token floppy.c:1188:38: warning: pasting would not give a valid preprocessing token floppy.c: In function `result': floppy.c:1168: warning: `status' might be used uninitialized in this function floppy.c:1544:56: warning: pasting would not give a valid preprocessing token floppy.c:1569:52: warning: pasting would not give a valid preprocessing token floppy.c:1702:30: warning: pasting would not give a valid preprocessing token floppy.c:2341:58: warning: pasting would not give a valid preprocessing token floppy.c:2381:60: warning: pasting would not give a valid preprocessing token floppy.c:2483:79: warning: pasting would not give a valid preprocessing token floppy.c:2495:65: warning: pasting would not give a valid preprocessing token floppy.c:2520:65: warning: pasting would not give a valid preprocessing token floppy.c:2729:67: warning: pasting would not give a valid preprocessing token floppy.c:2792:63: warning: pasting would not give a valid preprocessing token floppy.c:3999:72: warning: pasting would not give a valid preprocessing token floppy.c:4015:78: warning: pasting would not give a valid preprocessing token floppy.c:4034:52: warning: pasting would not give a valid preprocessing token floppy.c:4094:69: warning: pasting would not give a valid preprocessing token floppy.c:4102:59: warning: pasting would not give a valid preprocessing token floppy.c:4250:35: warning: pasting would not give a valid preprocessing token floppy.c:4257:35: warning: pasting would not give a valid preprocessing token floppy.c:4268:88: warning: pasting would not give a valid preprocessing token eepro100.c: In function `speedo_show_state': eepro100.c:1144: warning: unused variable `phy_num' eepro100.c:1143: warning: unused variable `ioaddr' cdrom.c:395:73: warning: pasting would not give a valid preprocessing token cdrom.c:426:75: warning: pasting would not give a valid preprocessing token cdrom.c:484:88: warning: pasting would not give a valid preprocessing token cdrom.c:502:57: warning: pasting would not give a valid preprocessing token cdrom.c:554:67: warning: pasting would not give a valid preprocessing token cdrom.c:567:64: warning: pasting would not give a valid preprocessing token cdrom.c:609:57: warning: pasting would not give a valid preprocessing token cdrom.c:668:83: warning: pasting would not give a valid preprocessing token cdrom.c:896:61: warning: pasting would not give a valid preprocessing token cdrom.c:900:40: warning: pasting would not give a valid preprocessing token cdrom.c:1132:76: warning: pasting would not give a valid preprocessing token cdrom.c:1247:84: warning: pasting would not give a valid preprocessing token cdrom.c:1281:57: warning: pasting would not give a valid preprocessing token cdrom.c:1311:48: warning: pasting would not give a valid preprocessing token cdrom.c:1602:74: warning: pasting would not give a valid preprocessing token cdrom.c:1615:76: warning: pasting would not give a valid preprocessing token /usr/src/linux/include/linux/sunrpc/debug.h:53:57: warning: nothing can be pasted after this token In file included from proc.c:30: smb_debug.h:14:56: warning: nothing can be pasted after this token In file included from dir.c:18: smb_debug.h:14:56: warning: nothing can be pasted after this token In file included from cache.c:22: smb_debug.h:14:56: warning: nothing can be pasted after this token In file included from sock.c:29: smb_debug.h:14:56: warning: nothing can be pasted after this token In file included from inode.c:32: smb_debug.h:14:56: warning: nothing can be pasted after this token In file included from file.c:26: smb_debug.h:14:56: warning: nothing can be pasted after this token support.c: In function `ntfs_dupuni2map': support.c:230: warning: unused variable `uni_page' support.c: In function `ntfs_dupmap2uni': support.c:301: warning: `cl' might be used uninitialized in this function support.c:301: warning: `ch' might be used uninitialized in this function open.c: In function `sys_truncate': open.c:126: warning: implicit declaration of function `abs' In file included from /usr/src/linux/include/linux/sunrpc/types.h:14, from /usr/src/linux/include/linux/sunrpc/sched.h:14, from /usr/src/linux/include/linux/nfs_fs.h:16, from super.c:31: /usr/src/linux/include/linux/sunrpc/debug.h:53:57: warning: nothing can be pasted after this token In file included from /usr/src/linux/include/linux/sunrpc/types.h:14, from /usr/src/linux/include/linux/sunrpc/sched.h:14, from /usr/src/linux/include/linux/nfs_fs.h:16, from filesystems.c:17: /usr/src/linux/include/linux/sunrpc/debug.h:53:57: warning: nothing can be pasted after this token {standard input}: Assembler messages: {standard input}:1910: Warning: using `%eax' instead of `%ax' due to `l' suffix {standard input}:1910: Warning: using `%eax' instead of `%ax' due to `l' suffix {standard input}: Assembler messages: {standard input}:1034: Warning: using `%eax' instead of `%ax' due to `l' suffix {standard input}:1034: Warning: using `%eax' instead of `%ax' due to `l' suffix tcp.c:472:41: warning: pasting would not give a valid preprocessing token tcp.c:522:49: warning: pasting would not give a valid preprocessing token tcp_input.c:918:63: warning: pasting would not give a valid preprocessing token tcp_input.c:1386:76: warning: pasting would not give a valid preprocessing token tcp_input.c:1393:52: warning: pasting would not give a valid preprocessing token tcp_input.c:1441:85: warning: pasting would not give a valid preprocessing token tcp_input.c:1451:52: warning: pasting would not give a valid preprocessing token tcp_input.c:1464:79: warning: pasting would not give a valid preprocessing token tcp_input.c:1734:61: warning: pasting would not give a valid preprocessing token tcp_input.c:1912:60: warning: pasting would not give a valid preprocessing token tcp_input.c:1919:60: warning: pasting would not give a valid preprocessing token tcp_input.c:2365:59: warning: pasting would not give a valid preprocessing token tcp_output.c: In function `tcp_send_active_reset': tcp_output.c:814: warning: unused variable `tp' tcp_ipv4.c:1345:67: warning: pasting would not give a valid preprocessing token (then, they are similar message errors... here's how it finished:) {standard input}: Assembler messages: {standard input}:1073: Warning: indirect lcall without `*' {standard input}:1157: Warning: indirect lcall without `*' {standard input}:1235: Warning: indirect lcall without `*' {standard input}:1276: Warning: indirect lcall without `*' {standard input}:1308: Warning: indirect lcall without `*' {standard input}:1340: Warning: indirect lcall without `*' {standard input}:1372: Warning: indirect lcall without `*' {standard input}:1403: Warning: indirect lcall without `*' {standard input}:1434: Warning: indirect lcall without `*' /tmp/ccN4ccv5.s: Assembler messages: /tmp/ccN4ccv5.s:681: Warning: using `%eax' instead of `%ax' due to `l' suffix /tmp/ccN4ccv5.s:682: Warning: using `%eax' instead of `%ax' due to `l' suffix /tmp/ccN4ccv5.s:683: Warning: using `%eax' instead of `%ax' due to `l' suffix /tmp/ccN4ccv5.s:684: Warning: using `%eax' instead of `%ax' due to `l' suffix /tmp/ccN4ccv5.s:843: Warning: using `%eax' instead of `%ax' due to `l' suffix /tmp/ccN4ccv5.s:844: Warning: using `%eax' instead of `%ax' due to `l' suffix /tmp/ccN4ccv5.s:845: Warning: using `%eax' instead of `%ax' due to `l' suffix /tmp/ccN4ccv5.s:846: Warning: using `%eax' instead of `%ax' due to `l' suffix /tmp/ccN4ccv5.s:926: Warning: using `%eax' instead of `%ax' due to `l' suffix /tmp/ccN4ccv5.s:927: Warning: using `%eax' instead of `%ax' due to `l' suffix checksum.S:231: badly punctuated parameter list in #define checksum.S:237: badly punctuated parameter list in #define make[2]: *** [checksum.o] Error 1 make[1]: *** [first_rule] Error 2 make: *** [_dir_arch/i386/lib] Error 2 I think probably it's not a bug. Perhaps I'm doing something wrong, what can I do?? I'm compling it as a 686 PC, is this right to an Athlon microprocessor?
You need to do an "export CC=kgcc" before compiling the kernel. Alternatively, you can use a recent 2.2.18pre kernel (2.2.18pre15 is fine), which uses kgcc automatically if available. (kgcc is the kernel-compiler which is a version of gcc which is known to compile the kernel in a reliable way)
Hi! It's me again. I did what you said and I got new error: [root@HOST1 linux]# make bzImage kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pip e -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686 -c -o init/main.o init/main .c kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pip e -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686 -DUTS_MACHINE='"i386"' -c -o init/version.o init/version.c make -C kernel make[1]: Cambiando a directorio `/usr/src/linux-2.2.16/kernel' make all_targets make[2]: Cambiando a directorio `/usr/src/linux-2.2.16/kernel' kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pip e -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686 -DEXPORT_SYMTAB -c signal. c In file included from /usr/src/linux/include/linux/modversions.h:49, from /usr/src/linux/include/linux/module.h:19, from signal.c:10: /usr/src/linux/include/linux/modules/i386_ksyms.ver:6: warning: `cpu_data' redefined /usr/src/linux/include/asm/processor.h:96: warning: this is the location of the previous definition /usr/src/linux/include/linux/modules/i386_ksyms.ver:28: warning: `smp_num_cpus' redefined /usr/src/linux/include/linux/smp.h:77: warning: this is the location of the previous definition /usr/src/linux/include/linux/modules/i386_ksyms.ver:118: warning: `smp_call_function' redefined /usr/src/linux/include/linux/smp.h:83: warning: this is the location of the previous definition kgcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pip e -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686 -DEXPORT_SYMTAB -c ksyms.c In file included from /usr/src/linux/include/linux/modversions.h:49, from /usr/src/linux/include/linux/module.h:19, from ksyms.c:14: /usr/src/linux/include/linux/modules/i386_ksyms.ver:6: warning: `cpu_data' redefined /usr/src/linux/include/asm/processor.h:96: warning: this is the location of the previous definition /usr/src/linux/include/linux/modules/i386_ksyms.ver:28: warning: `smp_num_cpus' redefined /usr/src/linux/include/linux/smp.h:77: warning: this is the location of the previous definition /usr/src/linux/include/linux/modules/i386_ksyms.ver:118: warning: `smp_call_function' redefined /usr/src/linux/include/linux/smp.h:83: warning: this is the location of the previous definition In file included from /usr/src/linux/include/linux/interrupt.h:51, from ksyms.c:21: /usr/src/linux/include/asm/hardirq.h:23: warning: `synchronize_irq' redefined /usr/src/linux/include/linux/modules/i386_ksyms.ver:138: warning: this is the location of the previous definition In file included from /usr/src/linux/include/linux/interrupt.h:52, from ksyms.c:21: /usr/src/linux/include/asm/softirq.h:75: warning: `synchronize_bh' redefined /usr/src/linux/include/linux/modules/i386_ksyms.ver:142: warning: this is the location of the previous definition /usr/src/linux/include/linux/kernel_stat.h: In function `kstat_irqs': In file included from ksyms.c:17: /usr/src/linux/include/linux/kernel_stat.h:47: `smp_num_cpus' undeclared (first use in this function) /usr/src/linux/include/linux/kernel_stat.h:47: (Each undeclared identifier is reported only once /usr/src/linux/include/linux/kernel_stat.h:47: for each function it appears in.) make[2]: *** [ksyms.o] Error 1 make[2]: Saliendo directorio `/usr/src/linux-2.2.16/kernel' make[1]: *** [first_rule] Error 2 make[1]: Saliendo directorio `/usr/src/linux-2.2.16/kernel' make: *** [_dir_kernel] Error 2 [root@HOST1 linux]#
Ok. This is caused by a 2nd thing. You have to do a "make mrproper" if you switch from SMP to non-SMP. If not, you get the errors you list. Warning: "make mrproper" also deletes the .config file, so you may want to copy that to a safe place first, do the make mrproper, copy it back and then do an "make oldconfig" before you do the "make bzImage". (of course, the kgcc thing remains.)
Hi! I could make it work. Thanks for your patience and for your knowledge. :)