public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] problem with __mulsi3 and __divsi3 __umodsi3 operators
@ 2000-12-05  1:58 Suet Fei Li
  2000-12-05  2:18 ` Andrew Lunn
  2000-12-05  2:25 ` Jesper Skov
  0 siblings, 2 replies; 3+ messages in thread
From: Suet Fei Li @ 2000-12-05  1:58 UTC (permalink / raw)
  To: 'ecos-discuss@sources.redhat.com'

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:

_______
xt-gcc -nostartfiles -LM:\ecos_xtensa3\install/lib -Wl  -o cpu_1 comms.o
inst
_ui_2.o inst_transport_1_transport_bs.o inst_transport_1_transport_remote.o
inst
_transport_1_merge2.o inst_transport_1_data_converter.o
inst_transport_1_merge1.
o param.o tasks.o user_start.o memset.o memcpy.o    -Ttarget.ld -nostdlib

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'

M:/ecos_xtensa3/install/lib/libtarget.a(kernel_memfixed.o): In function
`Cyg_Mem
polt2<Cyg_Mempool_Fixed_Implementation>::try_alloc(int)':
//M/ecos_xtensa3/install/include/cyg/kernel/mempolt2.hxx(.text+0xd):
undefined reference to `__divsi3'
//M/ecos_xtensa3/install/include/cyg/kernel/mempolt2.hxx(.text+0x2a):
undefined reference to `__mulsi3'
//M/ecos_xtensa3/install/include/cyg/kernel/mempolt2.hxx(.text+0x51):
undefined reference to `__mulsi3'
//M/ecos_xtensa3/install/include/cyg/kernel/mempolt2.hxx(.gnu.linkonce.t.fre
e__t12Cyg_Mempolt21Z32Cyg_Mempool_Fixed_ImplementationPUci+0x2b): undefined
reference to `__divsi3'
//M/ecos_xtensa3/install/include/cyg/kernel/mempolt2.hxx(.gnu.linkonce.t.fre
e__t12Cyg_Mempolt21Z32Cyg_Mempool_Fixed_ImplementationPUci+0x32): undefined
reference to `__mulsi3'
M:/ecos_xtensa3/install/lib/libtarget.a(kernel_memfixed.o): In function
`Cyg_Mempool_Fixed::~Cyg_Mempool_Fixed(void)':
//E/PROGRA~1/CYGNUS~1/eCos/packages/kernel/v1_2_1/src/mem/memfixed.cxx:92:
undefined reference to `__mulsi3'
M:/ecos_xtensa3/install/lib/libtarget.a(kernel_memfixed.o): In function
`Cyg_Mempolt2<Cyg_Mempool_Fixed_Implementation>::try_alloc(int)':
//M/ecos_xtensa3/install/include/cyg/kernel/mempolt2.hxx(.gnu.linkonce.t.get
_freemem__t12Cyg_Mempolt21Z32Cyg_Mempool_Fixed_Implementation+0x1e):
undefined reference to `__mulsi3'
//M/ecos_xtensa3/install/include/cyg/kernel/mempolt2.hxx(.gnu.linkonce.t.get
_totalmem__t12Cyg_Mempolt21Z32Cyg_Mempool_Fixed_Implementation+0x1e):
undefined reference to `__mulsi3'
//M/ecos_xtensa3/install/include/cyg/kernel/mempolt2.hxx(.gnu.linkonce.t.try
_alloc__t12Cyg_Mempolt21Z32Cyg_Mempool_Fixed_Implementationi+0x63):
undefined reference to `__mulsi3'
M:/ecos_xtensa3/install/lib/libtarget.a(kernel_memfixed.o)(.gnu.linkonce.t.a
lloc__t12Cyg_Mempolt21Z32Cyg_Mempool_Fixed_ImplementationiUx+0x63)://M/ecos_
xtensa3/install/include/cyg/kernel/mempolt2.hxx: more undefined references
to `__mulsi3'

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

Does anyone have any insight on this?  I am totally lost. Any help will be
great.

suetfei

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] problem with __mulsi3 and __divsi3 __umodsi3 operators
  2000-12-05  1:58 [ECOS] problem with __mulsi3 and __divsi3 __umodsi3 operators Suet Fei Li
@ 2000-12-05  2:18 ` Andrew Lunn
  2000-12-05  2:25 ` Jesper Skov
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2000-12-05  2:18 UTC (permalink / raw)
  To: Suet Fei Li; +Cc: 'ecos-discuss@sources.redhat.com'

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] problem with __mulsi3 and __divsi3 __umodsi3 operators
  2000-12-05  1:58 [ECOS] problem with __mulsi3 and __divsi3 __umodsi3 operators Suet Fei Li
  2000-12-05  2:18 ` Andrew Lunn
@ 2000-12-05  2:25 ` Jesper Skov
  1 sibling, 0 replies; 3+ messages in thread
From: Jesper Skov @ 2000-12-05  2:25 UTC (permalink / raw)
  To: Suet Fei Li; +Cc: 'ecos-discuss@sources.redhat.com'

>>>>> "Suet" == Suet Fei Li <suetfei@bwrc.eecs.berkeley.edu> writes:

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

Suet> Does anyone have any insight on this?  I am totally lost. Any
Suet> help will be great.

Those functions should be defined in libgcc.a which should appear in
the linker file like this:

GROUP(libtarget.a libgcc.a)

Jesper

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-12-05  2:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-05  1:58 [ECOS] problem with __mulsi3 and __divsi3 __umodsi3 operators Suet Fei Li
2000-12-05  2:18 ` Andrew Lunn
2000-12-05  2:25 ` Jesper Skov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).