Hi all, I am new to grub development. For the past two days, I am unable to compile the grub 1.95 on ubuntu 7.04. It gives the following error.
gcc -I. -I./. -I. -Iinclude -I./include -Wall -W -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -Os -falign-jumps=1 -falign-loops=1 -falign-functions=1 -fno-builtin -mrtd -mregparm=3 -m32 -MD -c -o kernel_img-
symlist.o symlist.c gcc -o kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-disk_i386_pc_biosdisk.o kernel_img-term_i386_pc_console.o kernel_img-
symlist.o -nostdlib -Wl,-N,-Ttext,8200 -fno-builtin -mrtd -mregparm=3 -m32 kernel_img-kern_device.o: In function `grub_device_iterate': /home/salman/grub-1.95/kern/device.c:140: undefined reference to `__stack_chk_fail'
kernel_img-kern_disk.o: In function `grub_disk_write': /home/salman/grub-1.95/kern/disk.c:531: undefined reference to `__stack_chk_fail' kernel_img-kern_misc.o: In function `grub_vsprintf': /home/salman/grub-
1.95/kern/misc.c:897: undefined reference to `__stack_chk_fail' kernel_img-kern_rescue.o: In function `grub_rescue_cmd_cat': /home/salman/grub-1.95/kern/rescue.c:169: undefined reference to `__stack_chk_fail'
kernel_img-kern_i386_pc_init.o: In function `grub_machine_set_prefix': /home/salman/grub-1.95/kern/i386/pc/init.c:239: undefined reference to `__stack_chk_fail' kernel_img-kern_parser.o:/home/salman/grub-
1.95/kern/parser.c:230: more undefined references to `__stack_chk_fail' follow collect2: ld returned 1 exit status make: *** [kernel.exec] Error 1
I am thinking that if I would build it with static libc. But, it raises the question that since grub will be loaded in real or protected mode and libc is a user-mode library, so the solution is out of my mind. Please help me out. Also, I saw in the previous mailing archives that a patch related to enable stack smashing is posted. I dig into the code but did not find anything.