This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with __mulsi3 and __divsi3 __umodsi3 operators


On Tue, Dec 05, 2000 at 01:58:06AM -0800, Suet Fei Li wrote:
> Hi guys, I am porting ecos to a new processor (Xtensa). And when I tried to
> link the whole thing together, I had this weird problem.  The compiler
> complains:
[..] 
> M:/ecos_xtensa3/install/lib/libtarget.a(infra_diag.o): In function
> `diag_write_num':
> //E/PROGRA~1/CYGNUS~1/eCos/packages/infra/v1_2_1/src/diag.cxx:190: undefined
> reference to `__umodsi3'
> //E/PROGRA~1/CYGNUS~1/eCos/packages/infra/v1_2_1/src/diag.cxx:192: undefined
> reference to `__udivsi3'

> Seems like it has problem finding arithmatic operators like: \, % and
> multiply etc.

Yes, thats correct. gcc has a little library of functions it calls to
perform these operations. This library is called libgcc.a. If you look
at your target.ld script there should be a line

GROUP(libtarget.a libgcc.a)

and in your gcc installation there should be this library.

So it looks like either you are not linking this library or it does
not have these functions in it.

Compile your program with -v and you can see gcc link in this library...

lunn@tux:~$ arm-elf-gcc -v -I/usr/local/pkg/plcuts/ecos-work-sa-1.4.4/install/include  -L/usr/local/pkg/plcuts/ecos-work-sa-1.4.4/install/include hello.c
Reading specs from /usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/specs
gcc version 2.9-ecos-99r1-001005
 /usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/cpp -lang-c -v -I/usr/local/pkg/plcuts/ecos-work-sa-1.4.4/install/include -undef -D__GNUC__=2 -D__GNUC_MINOR__=9 -Darm -Darm_elf -D__ELF__ -D__arm__ -D__arm_elf__ -D__ELF__ -D__arm -D__arm_elf -Acpu(arm) -Amachine(arm) -D__CHAR_UNSIGNED__ -D__ARM_ARCH_4T__ -D__APCS_32__ hello.c /tmp/ccL0shIb.i
GNU CPP version 2.9-ecos-99r1-001005 (ARM/ELF non-Linux)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/pkg/plcuts/ecos-work-sa-1.4.4/install/include
 /usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/include
 /usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/../../../../arm-elf/include
End of search list.
 /usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/cc1 /tmp/ccL0shIb.i -quiet -dumpbase hello.c -version -o /tmp/ccu9CAWF.s
GNU C version 2.9-ecos-99r1-001005 (arm-elf) compiled by GNU C version 2.7.2.3.
 /usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/../../../../arm-elf/bin/as -o /tmp/ccT9txeD.o /tmp/ccu9CAWF.s
 /usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/collect2 -X /usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/crtbegin.o /usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/../../../../arm-elf/lib/crt0.o -L/usr/local/pkg/plcuts/ecos-work-sa-1.4.4/install/include -L/usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005 -L/usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/../../../../arm-elf/lib /tmp/ccT9txeD.o -lgcc -lc -lgcc /usr/local/pkg/H686-arm-elf-1.4.4/lib/gcc-lib/arm-elf/2.9-ecos-99r1-001005/crtend.o

So check if you are linking this library. If you are have a look
inside the library and see what i contains.

        Andrew




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]