cross compiler for new target-machine problem
Kim, Ji Hoon
jhkim82@gmail.com
Mon May 23 17:18:00 GMT 2005
Hi there,
I'm trying to make new compiler for new processor.
So, I described "machine.c, machine.h, machine.md".
And for library, I use newlib.
But, I can' link to c library like libgcc.a, libm.a, libc.a , etc.
So, I tested my linker with simple hand-writing codes and I knew
linker worked well.
If there is a c code like below,
#include <math.h>
int main(){
double a = 4.0;
a = sqrt(a);
return a;
}
I got the result like below when compiling.
/var/tmp//cckhwGLp.o(.text+0x44): In function `_main':
: undefined reference to `___fixdfsi'
/var/tmp//cckhwGLp.o(.text+0x44): In function `_main':
: relocation truncated to fit: R_MIPS_PC16 ___fixdfsi
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(w_sqrt.o)(.text+0x8c): In
function `sqrt':
../../../../../newlib/libm/math/w_sqrt.c:71: undefined reference to `___ltdf2'
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(w_sqrt.o)(.text+0x8c):../../../../../newlib/libm/math/w_sqrt.c:71:
relocation truncated to fit: R_MIPS_PC16 ___ltdf2
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x1f8): In
function `__ieee754_sqrt':
../../../../../newlib/libm/math/e_sqrt.c:177: undefined reference to `___gedf2'
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x1f8):../../../../../newlib/libm/math/e_sqrt.c:177:
relocation truncated to fit: R_MIPS_PC16 ___gedf2
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x23c):../../../../../newlib/libm/math/e_sqrt.c:180:
undefined reference to `___gtdf2'
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x23c):../../../../../newlib/libm/math/e_sqrt.c:180:
relocation truncated to fit: R_MIPS_PC16 ___gtdf2
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x2ec):../../../../../newlib/libm/math/e_sqrt.c:117:
undefined reference to `___subdf3'
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x34c):../../../../../newlib/libm/math/e_sqrt.c:117:
undefined reference to `___divdf3'
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x34c):../../../../../newlib/libm/math/e_sqrt.c:117:
relocation truncated to fit: R_MIPS_PC16 ___divdf3
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x37c):../../../../../newlib/libm/math/e_sqrt.c:110:
undefined reference to `___muldf3'
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x37c):../../../../../newlib/libm/math/e_sqrt.c:110:
relocation truncated to fit: R_MIPS_PC16 ___muldf3
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x39c):../../../../../newlib/libm/math/e_sqrt.c:110:
undefined reference to `___adddf3'
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(e_sqrt.o)(.text+0x39c):../../../../../newlib/libm/math/e_sqrt.c:110:
relocation truncated to fit: R_MIPS_PC16 ___adddf3
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(s_matherr.o)(.text+0x34):
In function `matherr':
../../../../../newlib/libm/common/s_matherr.c:121: undefined reference
to `___nedf2'
/home/comm/lib/gcc-lib/mkr-elf/3.3.2/libm.a(s_matherr.o)(.text+0x34):../../../../../newlib/libm/common/s_matherr.c:121:
relocation truncated to fit: R_MIPS_PC16 ___nedf2
collect2: ld returned 1 exit status
And, I obtained libgcc.a, libc.a, libm.a, etc.
When I compile the newlib, I had an error during compile regex.c.
I found regex.c had a role that "Extended regular expression matching
and search library"
Then, does regex.c occur all my problems??
I can't find any reason why compiler doesn't work when used with
standard library.
Who can help me solve such a problem?
Thanks a lot.
------
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