Hello, compiling grub 0.9.4 (cvs) using gcc 3.3.2 and binutils 2.14 fails because of implicit use of memcpy in the functions ti_set_term and ti_get_term defined in stage2/terminfo.{c,h} which is not coverd by the macrodefinition of memcpy:
| [...] | gcc -march=athlon -O3 -o pre_stage2.exec -nostdlib -Wl,-N | -Wl,-Ttext -Wl,8200 pre_stage2_exec-asm.o pre_stage2_exec-bios.o | pre_stage2_exec-boot.o pre_stage2_exec-builtins.o | pre_stage2_exec-char_io.o pre_stage2_exec-cmdline.o | pre_stage2_exec-common.o pre_stage2_exec-console.o | pre_stage2_exec-disk_io.o pre_stage2_exec-fsys_ext2fs.o | pre_stage2_exec-fsys_fat.o pre_stage2_exec-fsys_ffs.o | pre_stage2_exec-fsys_jfs.o pre_stage2_exec-fsys_minix.o | pre_stage2_exec-fsys_reiserfs.o pre_stage2_exec-fsys_vstafs.o | pre_stage2_exec-fsys_xfs.o pre_stage2_exec-gunzip.o | pre_stage2_exec-hercules.o pre_stage2_exec-md5.o | pre_stage2_exec-serial.o pre_stage2_exec-smp-imps.o | pre_stage2_exec-stage2.o pre_stage2_exec-terminfo.o | pre_stage2_exec-tparm.o | pre_stage2_exec-terminfo.o(.text+0x23b): In function `ti_set_term': | : undefined reference to `memcpy' | pre_stage2_exec-terminfo.o(.text+0x261): In function `ti_get_term': | : undefined reference to `memcpy' collect2: | ld returned 1 exit status Here is a diff-snippet of what I did ti 'fix' that. Please note that I would consider this a bad hack, as it changes the smantics of ti_get_term, but at lest it worked for me... :-) 8<--------------------- grub-gcc_3.3.2-patch ------------------------ diff -u grub/stage2/builtins.c grub-sw/stage2/builtins.c --- grub/stage2/builtins.c Mon Mar 10 02:12:26 2003 +++ grub-sw/stage2/builtins.c Sat Nov 15 12:52:08 2003 @@ -4213,8 +4213,7 @@ else { /* No option specifies printing out current settings. */ - term = ti_get_term (); - + memcpy ((char *) &term, ti_get_term(), sizeof (term)); grub_printf ("name=%s\n", ti_escape_string (term.name)); grub_printf ("cursor_address=%s\n", diff -u grub/stage2/terminfo.c grub-sw/stage2/terminfo.c --- grub/stage2/terminfo.c Fri Jan 24 17:21:35 2003 +++ grub-sw/stage2/terminfo.c Sat Nov 15 14:02:18 2003 @@ -247,13 +247,12 @@ void ti_set_term (struct terminfo new) { - term = new; + memcpy ((char *) &term, (char *) &new, sizeof (term)); } /* return the current terminal emulation */ -struct terminfo +char * ti_get_term(void) { - return term; + return (char *) &term; } - diff -u grub/stage2/terminfo.h grub-sw/stage2/terminfo.h --- grub/stage2/terminfo.h Mon Mar 10 02:12:26 2003 +++ grub-sw/stage2/terminfo.h Sat Nov 15 12:51:07 2003 @@ -41,7 +41,7 @@ char *ti_unescape_string (const char *in); void ti_set_term (struct terminfo term); -struct terminfo ti_get_term (void); +char *ti_get_term (void); void ti_cursor_address (int x, int y); void ti_clear_screen (void); ----------------------- grub-gcc_3.3.2-patch ---------------------->8 sorry I'did not use the bugtacking system, but the site was down... cheers -- Sascha Wilde If you think technology can solve your problems you don't understand technology and you don't understand your problems. (Marcus Ranum) _______________________________________________ Bug-grub mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-grub