On a fresh Redhat 7 box, i've downloaded 2.2.17 kernel. After a make config, I do a make dep it goes away, the first error being make bzImage find: /usr/src/linux/include/asm: No such file or directory To fix it I do [root@redhat linux]# cd /usr/include [root@redhat include]# mv asm asm.orig [root@redhat include]# ln -s /usr/src/linux/include/asm asm [root@redhat include]# mv linux linux.orig [root@redhat include]# ln -s /usr/src/linux/include/linux linux [root@redhat include]# cd /usr/src/linux/include [root@redhat include]# ln -s asm-i386/ asm It compiles until ... make[2]: Entering directory `/usr/src/linux-2.2.17/arch/i386/lib' cc -D__KERNEL__ -I/usr/src/linux/include -D__ASSEMBLY__ -traditional -c checksum.S -o checksum.o 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[2]: Leaving directory `/usr/src/linux-2.2.17/arch/i386/lib' make[1]: *** [first_rule] Error 2 make[1]: Leaving directory `/usr/src/linux-2.2.17/arch/i386/lib' make: *** [_dir_arch/i386/lib] Error 2 Ok, I give up and try 2.4.0-test8, it throws up lots of errors like this after a cd include ln -s asm-i386 asm make dep;make bzImage gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -mpreferred-stack-boundary =2 -march=i686 -fno-strict-aliasing -c -o vm.o vm.c In file included from /usr/src/linux/include/asm/smp.h:21, from /usr/src/linux/include/linux/smp.h:14, from /usr/src/linux/include/linux/sched.h:22, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from /usr/src/linux/include/linux/malloc.h:4, from /usr/src/linux/include/linux/proc_fs.h:5, from drmP.h:47, from vm.c:33: Then errors in agpsupport gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -mpreferred-stack-boundary =2 -march=i686 -fno-strict-aliasing -c -o agpsupport.o agpsupport.c In file included from /usr/src/linux/include/asm/smp.h:21, from /usr/src/linux/include/linux/smp.h:14, from /usr/src/linux/include/linux/sched.h:22, from /usr/src/linux/include/linux/mm.h:4, from /usr/src/linux/include/linux/slab.h:14, from /usr/src/linux/include/linux/malloc.h:4, from /usr/src/linux/include/linux/proc_fs.h:5, from drmP.h:47, from agpsupport.c:32: /usr/src/linux/include/asm/apic.h:13:29: warning: nothing can be pasted after this token agpsupport.c:244:47: warning: pasting would not give a valid preprocessing token agpsupport.c:35: parse error before `drm_agp' agpsupport.c:35: warning: type defaults to `int' in declaration of `drm_agp' agpsupport.c:35: warning: initialization makes integer from pointer without a cast agpsupport.c:35: warning: excess elements in scalar initializer agpsupport.c:35: warning: (near initialization for `drm_agp') agpsupport.c:35: warning: excess elements in scalar initializer agpsupport.c:35: warning: (near initialization for `drm_agp') agpsupport.c:35: warning: excess elements in scalar initializer agpsupport.c:35: warning: (near initialization for `drm_agp') agpsupport.c:35: warning: excess elements in scalar initializer agpsupport.c:35: warning: (near initialization for `drm_agp') agpsupport.c:35: warning: excess elements in scalar initializer agpsupport.c:35: warning: (near initialization for `drm_agp') agpsupport.c:35: warning: excess elements in scalar initializer agpsupport.c:35: warning: (near initialization for `drm_agp') agpsupport.c:35: warning: excess elements in scalar initializer agpsupport.c:35: warning: (near initialization for `drm_agp') agpsupport.c:35: warning: data definition has no type or storage class agpsupport.c:41: parse error before `*' agpsupport.c:41: warning: function declaration isn't a prototype agpsupport.c:42: warning: no semicolon at end of struct or union agpsupport.c:43: parse error before `*' agpsupport.c:43: warning: function declaration isn't a prototype agpsupport.c:44: parse error before `*' agpsupport.c:44: warning: function declaration isn't a prototype agpsupport.c:48: parse error before `*' agpsupport.c:48: warning: function declaration isn't a prototype agpsupport.c:50: parse error before `}' agpsupport.c:50: warning: type defaults to `int' in declaration of `drm_agp_func_u' agpsupport.c:50: warning: data definition has no type or storage class agpsupport.c:54: parse error before `drm_agp_func_u' agpsupport.c:54: warning: no semicolon at end of struct or union agpsupport.c:55: warning: type defaults to `int' in declaration of `drm_agp_fill_t' agpsupport.c:55: warning: data definition has no type or storage class agpsupport.c:57: parse error before `drm_agp_fill' agpsupport.c:57: warning: type defaults to `int' in declaration of `drm_agp_fill' agpsupport.c:58: warning: braces around scalar initializer agpsupport.c:58: warning: (near initialization for `drm_agp_fill[0]') agpsupport.c:58: warning: initialization makes integer from pointer without a cast agpsupport.c:59: parse error before `)' agpsupport.c:59: request for member `free_memory' in something not a structure or union agpsupport.c:59: warning: excess elements in scalar initializer agpsupport.c:59: warning: (near initialization for `drm_agp_fill[0]') agpsupport.c:60: warning: braces around scalar initializer agpsupport.c:60: warning: (near initialization for `drm_agp_fill[1]') agpsupport.c:60: warning: initialization makes integer from pointer without a cast agpsupport.c:61: parse error before `)' agpsupport.c:61: request for member `allocate_memory' in something not a structure or union agpsupport.c:61: warning: excess elements in scalar initializer agpsupport.c:61: warning: (near initialization for `drm_agp_fill[1]') agpsupport.c:62: warning: braces around scalar initializer agpsupport.c:62: warning: (near initialization for `drm_agp_fill[2]') agpsupport.c:62: warning: initialization makes integer from pointer without a cast agpsupport.c:63: parse error before `)' agpsupport.c:63: request for member `bind_memory' in something not a structure or union agpsupport.c:63: warning: excess elements in scalar initializer agpsupport.c:63: warning: (near initialization for `drm_agp_fill[2]') agpsupport.c:64: warning: braces around scalar initializer agpsupport.c:64: warning: (near initialization for `drm_agp_fill[3]') agpsupport.c:64: warning: initialization makes integer from pointer without a cast agpsupport.c:65: parse error before `)' agpsupport.c:65: request for member `unbind_memory' in something not a structure or union agpsupport.c:65: warning: excess elements in scalar initializer agpsupport.c:65: warning: (near initialization for `drm_agp_fill[3]') agpsupport.c:66: warning: braces around scalar initializer agpsupport.c:66: warning: (near initialization for `drm_agp_fill[4]') agpsupport.c:66: warning: initialization makes integer from pointer without a cast agpsupport.c:67: parse error before `)' agpsupport.c:67: request for member `enable' in something not a structure or union agpsupport.c:67: warning: excess elements in scalar initializer agpsupport.c:67: warning: (near initialization for `drm_agp_fill[4]') agpsupport.c:68: warning: braces around scalar initializer agpsupport.c:68: warning: (near initialization for `drm_agp_fill[5]') agpsupport.c:68: warning: initialization makes integer from pointer without a cast agpsupport.c:69: parse error before `)' agpsupport.c:69: request for member `acquire' in something not a structure or union agpsupport.c:69: warning: excess elements in scalar initializer agpsupport.c:69: warning: (near initialization for `drm_agp_fill[5]') agpsupport.c:70: warning: braces around scalar initializer agpsupport.c:70: warning: (near initialization for `drm_agp_fill[6]') agpsupport.c:70: warning: initialization makes integer from pointer without a cast agpsupport.c:71: parse error before `)' agpsupport.c:280:76: warning: pasting would not give a valid preprocessing token agpsupport.c:284:56: warning: pasting would not give a valid preprocessing token agpsupport.c:333:50: warning: pasting would not give a valid preprocessing token agpsupport.c:71: request for member `release' in something not a structure or union agpsupport.c:71: warning: excess elements in scalar initializer agpsupport.c:71: warning: (near initialization for `drm_agp_fill[6]') agpsupport.c:72: warning: braces around scalar initializer agpsupport.c:72: warning: (near initialization for `drm_agp_fill[7]') agpsupport.c:72: warning: initialization makes integer from pointer without a cast agpsupport.c:73: parse error before `)' agpsupport.c:73: request for member `copy_info' in something not a structure or union agpsupport.c:73: warning: excess elements in scalar initializer agpsupport.c:73: warning: (near initialization for `drm_agp_fill[7]') agpsupport.c:74: warning: braces around scalar initializer agpsupport.c:74: warning: (near initialization for `drm_agp_fill[8]') agpsupport.c:74: warning: initialization makes integer from pointer without a cast agpsupport.c:74: warning: excess elements in scalar initializer agpsupport.c:74: warning: (near initialization for `drm_agp_fill[8]') agpsupport.c:75: warning: data definition has no type or storage class agpsupport.c: In function `drm_agp_info': agpsupport.c:82: `agp_kern_info' undeclared (first use in this function) agpsupport.c:82: (Each undeclared identifier is reported only once agpsupport.c:82: for each function it appears in.) agpsupport.c:82: `kern' undeclared (first use in this function) agpsupport.c:82: warning: statement with no effect agpsupport.c:83: parse error before `info' agpsupport.c:85: structure has no member named `agp' agpsupport.c:85: request for member `copy_info' in something not a structure or union agpsupport.c:87: structure has no member named `agp' agpsupport.c:88: `info' undeclared (first use in this function) agpsupport.c: In function `drm_agp_acquire': agpsupport.c:110: structure has no member named `agp' agpsupport.c:110: request for member `acquire' in something not a structure or union agpsupport.c:111: request for member `acquire' in something not a structure or union agpsupport.c:112: structure has no member named `agp' agpsupport.c: In function `drm_agp_release': agpsupport.c:122: structure has no member named `agp' agpsupport.c:122: request for member `release' in something not a structure or union agpsupport.c:123: request for member `release' in something not a structure or union agpsupport.c:124: structure has no member named `agp' agpsupport.c: In function `drm_agp_enable': agpsupport.c:136: structure has no member named `agp' agpsupport.c:136: request for member `enable' in something not a structure or union agpsupport.c:141: structure has no member named `agp' agpsupport.c:142: request for member `enable' in something not a structure or union agpsupport.c:143: structure has no member named `agp' agpsupport.c:143: structure has no member named `agp' agpsupport.c:144: structure has no member named `agp' agpsupport.c: In function `drm_agp_alloc': agpsupport.c:154: `drm_agp_mem_t' undeclared (first use in this function) agpsupport.c:154: `entry' undeclared (first use in this function) agpsupport.c:154: warning: statement with no effect agpsupport.c:155: `agp_memory' undeclared (first use in this function) agpsupport.c:155: `memory' undeclared (first use in this function) agpsupport.c:155: warning: statement with no effect agpsupport.c:156: parse error before `unsigned' agpsupport.c:158: structure has no member named `agp' agpsupport.c:166: `pages' undeclared (first use in this function) agpsupport.c:167: `type' undeclared (first use in this function) agpsupport.c:169: warning: implicit declaration of function `drm_alloc_agp' agpsupport.c:179: structure has no member named `agp' agpsupport.c:180: structure has no member named `agp' agpsupport.c:180: structure has no member named `agp' agpsupport.c:181: structure has no member named `agp' agpsupport.c:187: structure has no member named `agp' agpsupport.c:188: structure has no member named `agp' agpsupport.c:189: warning: implicit declaration of function `drm_free_agp' agpsupport.c: At top level: agpsupport.c:196: parse error before `*' agpsupport.c:198: warning: return type defaults to `int' agpsupport.c: In function `drm_agp_lookup_entry': agpsupport.c:199: `drm_agp_mem_t' undeclared (first use in this function) agpsupport.c:199: `entry' undeclared (first use in this function) agpsupport.c:199: warning: statement with no effect agpsupport.c:201: structure has no member named `agp' agpsupport.c: In function `drm_agp_unbind': agpsupport.c:213: `drm_agp_mem_t' undeclared (first use in this function) agpsupport.c:213: `entry' undeclared (first use in this function) agpsupport.c:213: warning: statement with no effect agpsupport.c:215: structure has no member named `agp' agpsupport.c:221: warning: implicit declaration of function `drm_unbind_agp' agpsupport.c: In function `drm_agp_bind': agpsupport.c:230: `drm_agp_mem_t' undeclared (first use in this function) agpsupport.c:230: `entry' undeclared (first use in this function) agpsupport.c:230: warning: statement with no effect agpsupport.c:231: parse error before `int' agpsupport.c:234: structure has no member named `agp' agpsupport.c:234: request for member `bind_memory' in something not a structure or union agpsupport.c:240: `page' undeclared (first use in this function) agpsupport.c:241: `retcode' undeclared (first use in this function) agpsupport.c:241: warning: implicit declaration of function `drm_bind_agp' agpsupport.c:242: structure has no member named `agp' agpsupport.c:244: structure has no member named `agp' agpsupport.c: In function `drm_agp_free': agpsupport.c:254: `drm_agp_mem_t' undeclared (first use in this function) agpsupport.c:254: `entry' undeclared (first use in this function) agpsupport.c:254: warning: statement with no effect agpsupport.c:256: structure has no member named `agp' agpsupport.c:264: structure has no member named `agp' agpsupport.c: At top level: agpsupport.c:271: parse error before `*' agpsupport.c:272: warning: return type defaults to `int' agpsupport.c: In function `drm_agp_init': agpsupport.c:273: `fill' undeclared (first use in this function) agpsupport.c:273: warning: statement with no effect agpsupport.c:274: `drm_agp_head_t' undeclared (first use in this function) agpsupport.c:274: `head' undeclared (first use in this function) agpsupport.c:274: invalid lvalue in assignment agpsupport.c:275: parse error before `int' agpsupport.c:279: parse error before `get_module_symbol' agpsupport.c:281: `agp_available' undeclared (first use in this function) agpsupport.c:290: request for member `copy_info' in something not a structure or union agpsupport.c:291: `NOT_SUPPORTED' undeclared (first use in this function) agpsupport.c:297: `INTEL_GENERIC' undeclared (first use in this function) agpsupport.c:297: break statement not within loop or switch agpsupport.c:298: `INTEL_LX' undeclared (first use in this function) agpsupport.c:298: break statement not within loop or switch agpsupport.c:299: `INTEL_BX' undeclared (first use in this function) agpsupport.c:299: break statement not within loop or switch agpsupport.c:300: `INTEL_GX' undeclared (first use in this function) agpsupport.c:300: break statement not within loop or switch agpsupport.c:301: `INTEL_I810' undeclared (first use in this function) agpsupport.c:301: break statement not within loop or switch agpsupport.c:304: `INTEL_I840' undeclared (first use in this function) agpsupport.c:304: break statement not within loop or switch agpsupport.c:307: `VIA_GENERIC' undeclared (first use in this function) agpsupport.c:307: break statement not within loop or switch agpsupport.c:308: `VIA_VP3' undeclared (first use in this function) agpsupport.c:308: break statement not within loop or switch agpsupport.c:309: `VIA_MVP3' undeclared (first use in this function) agpsupport.c:309: break statement not within loop or switch agpsupport.c:312: `VIA_MVP4' undeclared (first use in this function) agpsupport.c:312: break statement not within loop or switch agpsupport.c:313: `VIA_APOLLO_KX133' undeclared (first use in this function) agpsupport.c:314: break statement not within loop or switch agpsupport.c:315: `VIA_APOLLO_KT133' undeclared (first use in this function) agpsupport.c:316: break statement not within loop or switch agpsupport.c:319: `VIA_APOLLO_PRO' undeclared (first use in this function) agpsupport.c:320: break statement not within loop or switch agpsupport.c:321: `SIS_GENERIC' undeclared (first use in this function) agpsupport.c:321: break statement not within loop or switch agpsupport.c:322: `AMD_GENERIC' undeclared (first use in this function) agpsupport.c:322: break statement not within loop or switch agpsupport.c:323: `AMD_IRONGATE' undeclared (first use in this function) agpsupport.c:323: break statement not within loop or switch agpsupport.c:324: `ALI_GENERIC' undeclared (first use in this function) agpsupport.c:324: break statement not within loop or switch agpsupport.c:325: `ALI_M1541' undeclared (first use in this function) agpsupport.c:325: break statement not within loop or switch agpsupport.c:326: default label not within a switch statement agpsupport.c:326: break statement not within loop or switch agpsupport.c: In function `drm_agp_uninit': agpsupport.c:340: `fill' undeclared (first use in this function) agpsupport.c:340: warning: statement with no effect make[4]: *** [agpsupport.o] Error 1 make[4]: Leaving directory `/usr/src/linux-2.4.0-test8/drivers/char/drm' make[3]: *** [first_rule] Error 2 make[3]: Leaving directory `/usr/src/linux-2.4.0-test8/drivers/char/drm' make[2]: *** [_subdir_drm] Error 2 make[2]: Leaving directory `/usr/src/linux-2.4.0-test8/drivers/char' make[1]: *** [_subdir_char] Error 2 make[1]: Leaving directory `/usr/src/linux-2.4.0-test8/drivers' make: *** [_dir_drivers] Error 2 Is Redhat broke, or the Linux kernel? thanks
I am seeing the same problem with 2.2.17 w/ AMD K6 450. On a whim, compiling down to the 386 optimization did not help. In case it helps: Linux version 2.2.16-22 (root.redhat.com) (gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)) #1 Tue Aug 2 2 16:16:55 EDT 2000 Detected 451032 kHz processor. Console: colour VGA+ 80x25 Calibrating delay loop... 897.84 BogoMIPS Memory: 257596k/262144k available (1048k kernel code, 412k reserved, 3024k data, 64k init, 0k bigmem) Dentry hash table entries: 262144 (order 9, 2048k) Buffer cache hash table entries: 262144 (order 8, 1024k) Page cache hash table entries: 65536 (order 6, 256k) VFS: Diskquotas version dquot_6.4.0 initialized CPU: L1 I Cache: 32K L1 D Cache: 32K CPU: AMD AMD-K6(tm) 3D processor stepping 0c Checking 386/387 coupling... OK, FPU using exception 16 error reporting. Checking 'hlt' instruction... OK. POSIX conformance testing by UNIFIX mtrr: v1.35a (19990819) Richard Gooch (rgooch.au) PCI: PCI BIOS revision 2.10 entry at 0xfb2c0 PCI: Using configuration type 1 PCI: Probing PCI hardware PCI: 00:38 [1106/0586]: Work around ISA DMA hangs (00) Activating ISA DMA hang workarounds. Linux NET4.0 for Linux 2.2 Based upon Swansea University Computer Society NET3.039 NET4: Unix domain sockets 1.0 for Linux NET4.0. NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP, IGMP TCP: Hash tables configured (ehash 262144 bhash 65536) Linux IP multicast router 0.06 plus PIM-SM Initializing RT netlink socket Starting kswapd v 1.5 Detected PS/2 Mouse Port. Serial driver version 4.27 with MANY_PORTS MULTIPORT SHARE_IRQ enabled ttyS00 at 0x03f8 (irq = 4) is a 16550A ttyS01 at 0x02f8 (irq = 3) is a 16550A pty: 256 Unix98 ptys configured apm: BIOS not found. Real Time Clock Driver v1.09 RAM disk driver initialized: 16 RAM disks of 4096K size VP_IDE: IDE controller on PCI bus 00 dev 39 VP_IDE: not 100% native mode: will probe irqs later ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:pio, hdb:pio ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:pio hda: WDC AC36400L, ATA DISK drive hdc: TOSHIBA DVD-ROM SD-M1202, ATAPI CDROM drive hdd: R/RW 4x4x24, ATAPI CDROM drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 ide1 at 0x170-0x177,0x376 on irq 15 hda: WDC AC36400L, 6149MB w/256kB Cache, CHS=833/240/63 Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 md driver 0.90.0 MAX_MD_DEVS=256, MAX_REAL=12 raid5: measuring checksumming speed raid5: MMX detected, trying high-speed MMX checksum routines pII_mmx : 843.915 MB/sec p5_mmx : 749.046 MB/sec 8regs : 584.073 MB/sec 32regs : 420.624 MB/sec using fastest function: pII_mmx (843.915 MB/sec) scsi : 0 hosts. scsi : detected total. md.c: sizeof(mdp_super_t) = 4096 Partition check: hda: [PTBL] [784/255/63] hda1 hda2 < hda5 hda6 hda7 hda8 > autodetecting RAID arrays autorun ... ... autorun DONE. VFS: Mounted root (ext2 filesystem) readonly. Freeing unused kernel memory: 64k freed Adding Swap: 530104k swap-space (priority -1) Linux agpgart interface v0.99 (c) Jeff Hartmann agpgart: Maximum main memory to use for agp memory: 204M agpgart: Detected Via VP3 chipset agpgart: AGP aperture is 64M @ 0xe0000000
In fact, I just found this attached to #18027 and it apparently fixed my compile problems: ------- Additional comments from jakub 2000-10-03 04:40 ------- <snip> Concerning kernel compilation, RELEASE-NOTES mention that you should not compile 2.2.x kernels with this gcc, use make CC='kgcc -D__KERNEL__ -I$(HPATH)' instead, the checksum.S failure is because 2.2 kernels use -traditional and GNU macro extensions at the same time (fixed in 2.4 kernels), many of the pasting warnings are bugs in 2.2 kernels and not bugs in cpp.
Would adding this to the Makefile be the correct way to correct this properly? CC =kgcc -D__KERNEL__ -I$(HPATH) Please note the closing bracket for anyone reading this :-) I cannot find reference to the "use make CC='kgcc -D__KERNEL__ -I$(HPATH" in the RELEASE-NOTES on cdrom 1 or 2, nor kernel 2.2.x, or 2.4.x, is it on cdrom 3,4 or 5 as I don't have those and a lot of mirrors don't either. Nor could I find it in redhat-7.0/i386/en/preview/README Would be nice to find this to study :-) May I also suggest a HOWTO on this for 2.2.x and 2.4.x kernel configuration on Redhat 7.0 so others can quickly and anywhere else appropriate. many, many thanks Darren
As Jakub pointed out, the compilation problems are mainly an issue with not using the kgcc compiler instead of gcc. The kernel-source package we ship automatically detects the presence of kgcc and uses it in preference to gcc. If there are other legitimate kernel bugs, please open a new ticket with one kernel bug per ticket. I'm closing this one on the knowledge that most of the compilation errors are simply an issue of documentation more than anything else.