Compile time error in 2.3.22

Deven Phillips (d.phillips@cytronix.net)
Sat, 16 Oct 1999 16:23:11 -1000


Problem: During make bzImage, arch/i386/kernel/setup.c -> Undeclared function
mem_end

Problem detail:
While compiling the 2.3.22 kernel with the attached kernel config, I
received an error syaing that there was an undeclared function in
linux/arch/i386/kernel/setup.c. Upon reading through setup.c I determined that
the proper name for the VARIABLE that was intended was mem_end_p, a pointer,
and it was entered on line 622 and 625 as mem_end (an undeclared variable
name). After cahnging those two lines to suit the proper name the file
comp[iled without a hitch. Here is the relevent code. The line numbers for the
code are prepended to each line. (Sorry, I don't know how to make a diff.)

gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -DCPU=686 -march=i686 -c -o setup.o setup.c
setup.c: In function `setup_arch':
setup.c:622: `memory_end' undeclared (first use in this function)
setup.c:622: (Each undeclared identifier is reported only once
setup.c:622: for each function it appears in.)
make[1]: *** [setup.o] Error 1
make[1]: Leaving directory `/usr/src/linux/arch/i386/kernel'
make: *** [_dir_arch/i386/kernel] Error 2

Original code from linux/arch/i386/kernel/setup.c

618: #ifdef CONFIG_BLK_DEV_INITRD
619: if (LOADER_TYPE) {
620: initrd_start = INITRD_START ? INITRD_START + PAGE_OFFSET : 0;
621: initrd_end = initrd_start+INITRD_SIZE;
622: if ( initrd_end > memory_end ) {
623: printk("initrd extends beyond end of memory "
624: "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
625: initrd_end,memory_end);
626: initrd_start = 0;
627: }
628: }
629:#endif

Patched code from linux/arch/i386/kernel/setup.c

618: #ifdef CONFIG_BLK_DEV_INITRD
619: if (LOADER_TYPE) {
620: initrd_start = INITRD_START ? INITRD_START + PAGE_OFFSET : 0;
621: initrd_end = initrd_start+INITRD_SIZE;
622: if ( initrd_end > *memory_end_p ) {
623: printk("initrd extends beyond end of memory "
624: "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
625: initrd_end,*memory_end_p);
626: initrd_start = 0;
627: }
628: }
629:#endif

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/