[U-Boot] integratorcp board - multiple definition of `__udivsi3' & undefined reference to `raise' Error

Gururaja Hebbar K R gururajakr at sanyo.co.in
Thu Aug 28 12:47:13 CEST 2008


Hi,

I am using CodeSourcery Arm Toolchain to compile U-boot-1.3.3 for integrator cp board. 

1. I set the proper environment variables (BUILD_DIR, PATH, CROSS_COMPILE) 

export PATH=/home/user/project/arm-2007q1/bin:$PATH
export CROSS_COMPILE=arm-none-linux-gnueabi-
export BUILD_DIR=/home/user/project/u_boot/Ubuild_all

2. Then i give 
make clean
make distclean
make cp926ejs_config
make

At the end of the compile i get 

..snip..
..snip..
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_udivsi3.o): In function `__aeabi_uidiv':
(.text+0x0): multiple definition of `__udivsi3'
lib_arm/libarm.a(_udivsi3.o):/home/user/project/u_boot/u-boot-1.3.3/lib_arm/_udivsi3.S:17: first defined here
arm-none-linux-gnueabi-ld: ERROR: Source object /opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_udivdi3.o) has EABI version 5, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of file /opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_udivdi3.o)
arm-none-linux-gnueabi-ld: ERROR: Source object /opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_udivsi3.o) has EABI version 5, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of file /opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_udivsi3.o)
arm-none-linux-gnueabi-ld: ERROR: Source object /opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_dvmd_lnx.o) has EABI version 5, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of file /opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_dvmd_lnx.o)
arm-none-linux-gnueabi-ld: ERROR: Source object /opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_clz.o) has EABI version 5, but target u-boot has EABI version 0
arm-none-linux-gnueabi-ld: failed to merge target specific data of file /opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_clz.o)
/opt/toolchain/arm-2008q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.3/libgcc.a(_dvmd_lnx.o): In function `__aeabi_ldiv0':
(.text+0x8): undefined reference to `raise'
make: *** [/home/user/project/u_boot/Ubuild_all/u-boot] Error 1

When i searched for the place of error, i found that in uboot-1.3.3/board/integratorcp/integratorcp.c 

@line 235, in function 
ulong get_timer_masked (void)
{
	..snip..
	..snip..

	lastdec	  = now;
	timestamp = (ulong)(total_count/div_timer);

	return timestamp;
}

I think we need to change it to use do_div function as below.

ulong get_timer_masked (void)
{
	unsigned long long n;

	..snip..
	..snip..
	lastdec = now;

	n = total_count;
	do_div(n, div_timer);
	timestamp = (ulong)n;
	
	return timestamp;
}

Also include div64.h

If this correct, then i can send a patch for integrator[ap/cp] board. Since both has same c code for this function.

Correct me if i am wrong

Thanks in advance

Regards
Gururaja


More information about the U-Boot mailing list