Hi.
I have been using busybox 1.0 in an old snapgear tree for a while
and while it works fine it is getting quite old. So i decided to upgrade.
Upgrading to anything above 1.2.1 (1.3.0 has a new build system)
does not seem to work.
GCC:
Target: arm-linux
Configured with: /gcc-4.1.2-final/configure --target=arm-linux
--prefix=/opt/armtools --with-sysroot=/opt/armtools/arm-linux/sysroot
--enable-__cxa_atexit --enable-c99 --enable-long-long --enable-multilib
--enable-shared --disable-libmudflap --enable-threads=posix
--with-float=soft --disable-libssp --enable-languages=c,c++
Thread model: posix
gcc version 4.1.2
This is what i get:
EXTRA_LDFLAGS="-nostdlib"
EXTRA_CFLAGS="-DBB_NOMMU -D__UCLIBC__"
...
Everything builds fine up until the final link.
/opt/armtools/lib/gcc/arm-linux/4.1.2/../../../../arm-linux/bin/ld.real:
--gc-sections and -r may not be used together
Removing -r from the link_cmd causes it to fail linking.
Removing --gc-sections from the link_cmd results in a binary.
The binary however is not correct.
busybox-1.6.0$ file busybox_unstripped
busybox_unstripped: BFLT executable - version 4 ram gotpic
/busybox-1.6.0$ /opt/armtools/bin/arm-linux-flthdr busybox_unstripped
busybox_unstripped
Magic: bFLT
Rev: 4
Build Date: Fri Jun 29 13:25:43 2007
Entry: 0x50
Data Start: 0x26c60
Data End: 0x2cc10
BSS End: 0x30950
Stack Size: 0x4e20
Reloc Start: 0x2cc10
Reloc Count: 0x1af
Flags: 0x2 ( Has-PIC-GOT )
The image should be a 0x1 (Load to RAM image).
Forcing flags to 0x3 ( Flags: ( Load-to-Ram Has-PIC-GOT )) causes
the binary to crash upon exec.
/> ls
BINFMT_FLAT: reloc outside program 0x807d0200 (0 - 0x31dc4/0x27d40),
killing ls!
The strange part is that anything before 1.3.0 works with this
toolchain. But not anything above that. What strage flags can cause this?
The only object that uses ld -r is applets/applet.o which generates
a applets/built-in.o that is 10-12k big. All other objects seems to
become archives and empty built-in.o's.
ucfront-gcc arm-linux-gcc -Wp,-MD,applets/.applets.o.d -std=gnu99
-Iinclude -Ilibbb
-I/home/christianm/ontime/Projects/trunk/redfox/linux/snapgear/user/busybox.gm/busybox-1.6.0/libbb
-include include/autoconf.h -D_GNU_SOURCE -DNDEBUG
-D"BB_VER=KBUILD_STR(1.6.0)" -DBB_BT=AUTOCONF_TIMESTAMP -fno-common
-fno-builtin -Wall -DEMBED -msoft-float -fno-strict-aliasing -Dlinux
-D__linux__ -Dunix -D__uClinux__ -fno-common -fno-builtin -Wall -DEMBED
-msoft-float -fno-strict-aliasing -Dlinux -D__linux__ -Dunix -D__uClinux__
-O2 -g -fomit-frame-pointer -DBB_NOMMU -D__UCLIBC__ -D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(applets)"
-D"KBUILD_MODNAME=KBUILD_STR(applets)" -c -o applets/applets.o
applets/applets.c
ucfront-gcc arm-linux-gcc -Wl,-elf2flt -Wl,-Bstatic -nostdlib -r -o
applets/built-in.o applets/applets.o
...
I am at loss here. Any useful hints?
Best regards,
\|||/
(o o)
----------------------------------ooO-(_)-Ooo----------------------------------
name: Christian Melki |
-------------------------------------------------------------------------------
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox