bugGNU GRUB - Bugs: bug #3343, fails to compile: undefined...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #3343: fails to compile: undefined reference to memcpy

Submitter:  Invalid User ID <#18493>
Submitted:  Sun 27 Apr 2003 11:21:42 AM UTC
   
 
Category:  Compilation Severity:  Major
Priority:  5 - Normal Item Group:  Non-software Error
Status:  Wont Fix Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release:  None
Release:  0.93 Reproducibility:  Every Time
Planned Release:  None

Fri 09 Jan 2004 09:50:08 PM UTC, comment #5: 

The problem is NOT caused by -O3.  It's caused by a poor API.

Anonymous
Fri 09 Jan 2004 09:48:44 PM UTC, comment #4: 

There's a better fix.  The API to ti_get_term() and ti_set_term() should use a pointer instead of implicitly copying the argument by using assigment.  Since there's only a single user of the "struct terminfo" (builtins.c), there's no need to copy.  Please fix it this way instead of hacking around this.

Anonymous
Sun 16 Nov 2003 02:37:11 PM UTC, comment #3: 

Do not specify -O3 or other options to gcc.

Yoshinori K. Okuji <okuji>
Group administrator
Tue 22 Jul 2003 06:01:13 PM UTC, comment #2: 

Actually, my last comment does not work that great, but the attached files should solve the problem.

Invalid User ID <#21165>
Tue 22 Jul 2003 04:42:11 PM UTC, comment #1: 

In the three lines mentioned memcpy is not used directly, but there are pass-by-value semantics used. As a consequence it seems that newer versions of gcc try to use memcpy (from stdlib) to create the duplicate structures.

I fixed the problem in my environment by adding the following code to the end of stage2/char_io.c:

#undef memcpy

void *
memcpy (void *to, const void *from, int len)
{
    return grub_memmove (to, from, len);
}

There are most likely more elegant ways to resolve this issue.

Invalid User ID <#21165>
Sun 27 Apr 2003 11:21:42 AM UTC, original submission:  


linuxfromscratch system

gcc version 3.2.2
glibc version 2.3.1

Making all in stage2
make[2]: Entering directory `/usr/src/toinstall/grub-0.93/stage2'
gcc  -O3 -march=i586   -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: In function `ti_set_term':
pre_stage2_exec-terminfo.o(.text+0x220): undefined reference to `memcpy'
pre_stage2_exec-terminfo.o: In function `ti_get_term':
pre_stage2_exec-terminfo.o(.text+0x23d): undefined reference to `memcpy'
collect2: ld returned 1 exit status
make[2]: * [pre_stage2.exec] Error 1
make[2]: Leaving directory `/usr/src/toinstall/grub-0.93/stage2'
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/toinstall/grub-0.93'
make: * [all] Error 2

Invalid User ID <#18493>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2003-11-16 okuji StatusNone None
    Open/ClosedOpen None

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code