Undefined reference to strlen, although library is supplied

Hermann-Simon Lichte gem@upb.de
Mon Feb 9 16:56:00 GMT 2004


> ----(Snip)---------------------------------------------------------------------- 
> 
> /usr/local/lib/gcc-lib/powerpc-eabi/3.3.2/libgcc.a(eabi.o)(.text+0xc4): 
> In function `__eabi':
> /home/gem/crossgcc/build-gcc/gcc/eabi.S:232: undefined reference to 
> `__init'
> ----(Snip)---------------------------------------------------------------------- 

This was just a problem with my .ld file.  It is fixed by now.  I do now 
include crt0.o (the one from newlib without modifications) along with my 
own system functions.

However, the main question is still there!  The functions from libc.a 
aren't referenced, but -mads and -myellowknife use the same libc.a. 
This is kind of weird.

[gem@pc-ram2 ~/mpc555/blinky++]$ make all
powerpc-eabi-gcc -mcpu=505 -c src/crt0.S -o src/crt0.o
powerpc-eabi-gcc -mcpu=505 -c src/system.c -o src/system.o
powerpc-eabi-gcc -mcpu=505 -c src/main.cc -o src/main.o
powerpc-eabi-gcc -mcpu=505 -c src/LED.cc -o src/LED.o
powerpc-eabi-gcc -T phycore555.ld -o build/blinky++.elf src/crt0.o 
src/system.o src/LED.o src/main.o -lstdc++ -lg -lc
/usr/local/lib/gcc-lib/powerpc-eabi/3.3.2/libgcc.a(unwind-dw2.o)(.text+0x3e4): 
In function `extract_cie_info':
/home/gem/crossgcc/gcc-3.3.2/gcc/unwind-dw2.c:247: undefined reference 
to `strlen'
/usr/local/lib/gcc-lib/powerpc-eabi/3.3.2/libgcc.a(unwind-dw2.o)(.text+0xd08): 
In function `execute_cfa_program':
/home/gem/crossgcc/gcc-3.3.2/gcc/unwind-dw2.c:820: undefined reference 
to `memcpy'
/usr/local/lib/gcc-lib/powerpc-eabi/3.3.2/libgcc.a(unwind-dw2.o)(.text+0xd38):/home/gem/crossgcc/gcc-3.3.2/gcc/unwind-dw2.c:828: 
undefined reference to `memcpy'
/usr/local/lib/gcc-lib/powerpc-eabi/3.3.2/libgcc.a(unwind-dw2.o)(.text+0x11e4): 
In function `uw_update_context_1':
/home/gem/crossgcc/gcc-3.3.2/gcc/unwind-dw2.c:1051: undefined reference 
to `memcpy'
/usr/local/lib/gcc-lib/powerpc-eabi/3.3.2/libgcc.a(unwind-dw2.o)(.text+0x1684): 
In function `uw_install_context_1':
/home/gem/crossgcc/gcc-3.3.2/gcc/unwind-dw2.c:1237: undefined reference 
to `memcpy'
/usr/local/lib/gcc-lib/powerpc-eabi/3.3.2/libgcc.a(unwind-dw2.o)(.text+0x188c): 
In function `_Unwind_RaiseException':
/home/gem/crossgcc/gcc-3.3.2/gcc/unwind.inc:85: undefined reference to 
`memcpy'
/usr/local/lib/gcc-lib/powerpc-eabi/3.3.2/libgcc.a(unwind-dw2.o)(.text+0x19e0):/home/gem/crossgcc/gcc-3.3.2/gcc/unwind.inc:126: 
more undefined references to `memcpy' follow
/usr/local/lib/gcc-lib/powerpc-eabi/3.3.2/libgcc.a(unwind-dw2-fde.o)(.text+0x648): 
In function `get_cie_encoding':
/home/gem/crossgcc/gcc-3.3.2/gcc/unwind-dw2-fde.c:274: undefined 
reference to `strlen'
collect2: ld returned 1 exit status
make: *** [all] Error 1



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list