This is the mail archive of the
ecos-maintainers@sources.redhat.com
mailing list for the eCos project.
Linking error: undefined reference __umoddi3, __udivdi3
- From: Ganeshan <ganeshan at ads-networks dot com>
- To: ecos-maintainers at ecos dot sourceware dot org
- Date: Tue, 30 Dec 2003 14:04:29 +0530
- Subject: Linking error: undefined reference __umoddi3, __udivdi3
- Organization: ADS Networks
- Reply-to: ganeshan at ads-networks dot com
I am building the application for h8300 series on linux.
I have built the toolchain, followed the
http://ecos.sourceware.org/build-toolchain.html with
target as h8300-elf. and it is in /gnutools/h8300-elf
my system is installed Linux-9.0, kernel- 2.4.20-8
gcc native compiler version is 3.2.2 (which has been used to build the
h8300-elf toolchain).
GNU tools used:
binutils-2.13.1.tar.bz2
gcc-core-3.2.1.tar.gz
gcc-g++-3.2.1.tar.gz
newlib-1.11.0.tar.gz
insight-5.3.tar.bz2
eCos - 2.0
I could not able to build the a simple 'c' program.
The following command used to build.
#mpco is the target which I have created.
ecosconfig new h8max // even I tried to build
h8300h_sim target
ecosconfig remove CYGPKG_LIBM //since the math library build is
given problem & also right it is not required for me
ecosconfig remove CYGPKG_KERNEL //Right now it is not required for me
ecosconfig tree
make
###############################
test.c
##############################
cyg_start()
{
int i,j,k;
i=5;
j=8;
k=i+j;
}
############ end of test.c ########
To compile and link with my small 'c' program. I used the following
command
h8300-elf-gcc -g -mh -I./install/include -L./install/lib -Ttarget.ld
-nostdlib test.c
I got following errors
Reading specs from /gnutools/lib/gcc-lib/h8300-elf/3.2.1/specs
Configured with: /src/gcc-3.2.1/configure --target=h8300-elf
--prefix=/gnutools --enable-languages=c,c++ --with-gnu-as --with-gnu-ld
--with-newlib --with-gxx-include-dir=/gnutools/h8300-elf/include -v :
(reconfigured) /src/gcc-3.2.1/configure --target=h8300-elf
--prefix=/gnutools --enable-languages=c,c++ --with-gnu-as --with-gnu-ld
--with-newlib --with-gxx-include-dir=/gnutools/h8300-elf/include -v
Thread model: single
gcc version 3.2.1
/gnutools/lib/gcc-lib/h8300-elf/3.2.1/cc1 -lang-c -v
-I./install/include -D__GNUC__=3 -D__GNUC_MINOR__=2
-D__GNUC_PATCHLEVEL__=1 -D__GXX_ABI_VERSION=102
-D__LONG_MAX__=2147483647L -D__LONG_MAX__=2147483647L -D__NO_INLINE__
-D__STDC_HOSTED__=1 -D__H8300H__ -D__SIZE_TYPE__=unsigned long
-D__PTRDIFF_TYPE__=long -Acpu=h8300h -Amachine=h8300h
-D__INT_MAX__=32767 -D__LONG_LONG_MAX__=2147483647L -D__ELF__ hello.c
-quiet -dumpbase hello.c -mh -g -version -o /tmp/ccGL5leO.s
GNU CPP version 3.2.1 (cpplib) (Hitachi H8/300)
GNU C version 3.2.1 (h8300-elf)
compiled by GNU C version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).
ignoring nonexistent directory "/gnutools/h8300-elf/sys-include"
#include "..." search starts here:
#include <...> search starts here:
install/include
/gnutools/include
/gnutools/lib/gcc-lib/h8300-elf/3.2.1/include
/gnutools/h8300-elf/include
End of search list.
/gnutools/lib/gcc-lib/h8300-elf/3.2.1/../../../../h8300-elf/bin/as
--traditional-format -o /tmp/ccW0tsgt.o /tmp/ccGL5leO.s
/gnutools/lib/gcc-lib/h8300-elf/3.2.1/collect2 -m h8300helf
-L./install/lib -L/gnutools/lib/gcc-lib/h8300-elf/3.2.1/h8300h
-L/gnutools/lib/gcc-lib/h8300-elf/3.2.1
-L/gnutools/lib/gcc-lib/h8300-elf/3.2.1/../../../../h8300-elf/lib/h8300h
-L/gnutools/lib/gcc-lib/h8300-elf/3.2.1/../../../../h8300-elf/lib
/tmp/ccW0tsgt.o -Ttarget.ld
./install/lib/libtarget.a(infra_diag.o): In function `.LM38':
infra_diag.o(.text+0x233): undefined reference to `___umoddi3'
./install/lib/libtarget.a(infra_diag.o): In function `.LM40':
infra_diag.o(.text+0x27d): undefined reference to `___udivdi3'
./install/lib/libtarget.a(infra_diag.o): In function `.LM65':
infra_diag.o(.text+0x437): undefined reference to `___umoddi3'
./install/lib/libtarget.a(infra_diag.o): In function `.LM66':
infra_diag.o(.text+0x47d): undefined reference to `___udivdi3'
./install/lib/libtarget.a(infra_diag.o): In function `.LM141':
infra_diag.o(.text+0x8ef): undefined reference to `___ashrdi3'
./install/lib/libtarget.a(infra_diag.o): In function `.LM162':
infra_diag.o(.text+0xa4b): undefined reference to `___negdi2'
collect2: ld returned 1 exit status
What could be the wrong?
Thanks in advance
begin:vcard
n:Ganeshan;N
tel;fax:2296502
tel;home:3592259
tel;work:2296484 Ext:25
x-mozilla-html:FALSE
url:www.ads-networks.com
org:Analog and Digital Systems;Networking
version:2.1
email;internet:ganeshan@ads-networks.com
adr;quoted-printable:;;Lavelle Mansion,=0D=0ALavelle Road=0D=0A;Bangalore;Karnataka;560 001;INDIA
fn:Ganeshan
end:vcard