compiling busybox-1.6.1 for cris architecture fails

hinko.kocevar at cetrtapot.si hinko.kocevar at cetrtapot.si
Fri Aug 31 12:06:46 UTC 2007


Denys Vlasenko wrote:
> On Friday 31 August 2007 08:36, hinko.kocevar at cetrtapot.si wrote:
>> Denys Vlasenko wrote:
>>> On Thursday 30 August 2007 14:02, hinko.kocevar at cetrtapot.si wrote:
>>>> Hi,
>>>>
>>>> We are using rather old version of busybox (1.1.2) on our embedded
>>>> systems and would like to upgrade to the latest stable version - 1.6.1.
>>>> The applets seem to compile just fine, but linking fails to produce
>>>> busybox_unstripped. We are using uClibc.
>>>>
>>>> Complete build (with make V=1) is located at:
>>>>
>>>> http://4thway.0catch.com/busybox-error_3.txt
>>> Strange, I don't see error message.
>>>
>>> Do you have busybox_ld.err file? It may contain error message.
>> Yes. I have uploaded it to the
>> http://4thway.0catch.com/busybox_ld.err
>>
>>> Can you remove "-Wl,-M" from Makefile and rerun the command?
>> I've rebuild without the "-Wl,-M" and the result seems the same but the
>> busybox_ld.err is smaller. See
>> http://4thway.0catch.com/busybox_ld.err_nowlm
> 
> This is fixed in 1.7.0. Link map is saved into separate file,
> making error message much easer to find. Sorry.
> 
> Does it make sense to you to jump to 1.7.0, since you
> have to jump anyway?

I'll try it out. I guess it is not that of a problem, just that it is 
labeled unstable and I hesitate to break something else by introducing 
untested code in the production systems [like it is not enough that our 
own untested stuff makes it there :-/]...

> 
>> It is something about the glibc _start symbol?!
> 
> uclibc.
> 
> applets/built-in.o: In function `__negdi2':
> /usr/src/redhat/BUILD/cris-dist-1.62/gnu-toplev/gcc/libgcc2.c:52: multiple 
> definition of `_start'
> /fw/car2_R1.gen/stage.uclibc/lib/crt0.o(.text+0x0): first defined here
> applets/built-in.o: In function `__negdi2':
> /usr/src/redhat/BUILD/cris-dist-1.62/gnu-toplev/gcc/libgcc2.c:52: multiple 
> definition of `__mainp'
> /fw/car2_R1.gen/stage.uclibc/lib/crt0.o(.data.rel+0x0): first defined here
> applets/built-in.o: In function `__negdi2':
> /usr/src/redhat/BUILD/cris-dist-1.62/gnu-toplev/gcc/libgcc2.c:52: multiple 
> definition of `__data_start'
> /fw/car2_R1.gen/stage.uclibc/lib/crt0.o(.data+0x0): first defined here
> collect2: ld returned 1 exit status
> 
> Something is messed up in the toolchain.
> 
> Does libgcc2.c in gcc you use really define _start? Why?
> 

Can't tell since the path points to non-existent source file on my 
system - it is pre-built toolchain that Axis supplies (makers of the 
cris CPU). Would have to download the toolchain source and check (maybe 
later).

> Can you successfully cross-compile "Hello world"?

Sure, it even runs:).

hinkok at genovefa /tmp $ cat hello.c
#include <stdio.h>

int main (void)
{
	printf("Hello world..\n");
	return 0;
}

hinkok at genovefa /tmp $ gcc_cris -mlinux -DLINUX -DLINUX_SYSTEM 
-D_REENTRANT -mno-mul-bug-workaround 
-muclibc=/fw/car2_R1.gen/stage.uclibc/ hello.c
hinkok at genovefa /tmp $ scp a.out root at 10.0.0.200:/tmp
root at 10.0.0.200's password:
a.out                                         100% 2228     2.2KB/s 
00:00
hinkok at genovefa /tmp $ ssh root at 10.0.0.200 /tmp/a.out
root at 10.0.0.200's password:
Hello world..


Let me just say that I had no problems while compiling (ancient) 
busybox-1.1.2 source. I would bet my money in the linker options - but 
which?!

Regards,
Hinko

-- 
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar at cetrtapot.si
Http: www.cetrtapot.si




More information about the busybox mailing list