Busybox Compilation for Arm

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

katolecho
Location: Valence, France
Posts: 22
Joined: Tue Mar 01, 2005 12:54 pm

Busybox Compilation for Arm

Tue Mar 22, 2005 11:21 am

Hi all
I'm just trying to make my own filesystem located on an NFS server

so i've found on the http-ramdisk a description of "how to make your own Ramdisk" but i've got a little problem

Indeed, the Cross-compiling step of busybox doesn't work

So i'll try to explain you what i've already done:
First of all you need to fetch busybox from the web at this url : http://www.busybox.net/downloads
Always pick the latest release. you also need to have linux-arm tools like arm-linux-gcc, arm-linux-g++ compilers and libraries to perform the cross-compilation. In my case
I put them in /usr/local./arm.

bash$ cd busybox-xx // change your directory to the busybox source directory
bash$ make CROSS=arm-linux- LIBCDIR=/usr/local/arm/2.95.3 LIBRARIES=/usr/local/arm/2.95.3/arm-linux/lib/libc.a -lgcc GCCINCDIR=/usr/local/arm/2.95.3/arm-linux/include
CROSS_CFLAGS+=-I$(LIBCDIR)/lib/gcc-lib/arm-linux/2.95.3/include -I$(GCCINCDIR) PREFIX=/home/user/usr/local/busybox
bash$ make install
so i've downloader the busybox archive and unzipped it
next i've tried the command line just given to do the make step and it doesn't work

Code: Select all

[root@StageIup busybox-1.00-rc3]# make  CROSS=arm-linux-  LIBCDIR=/usr/local/arm/2.95.3  LIBRARIES=/usr/local/arm/2.95.3/arm-linux/lib/libc.a -lgcc  GCCINCDIR=/usr/local/arm/2.95.3/arm-linux/include CROSS_CFLAGS+=-I$(LIBCDIR)/lib/gcc-lib/arm-linux/2.95.3/include -I$(GCCINCDIR) PREFIX=../busyInstall
bash: LIBCDIR: command not found
bash: GCCINCDIR: command not found
/bin/sh: line 1: arm-linux-gcc: command not found
/bin/sh: line 1: arm-linux-gcc: command not found
arm-linux-gcc -I./include -Wall -Wstrict-prototypes -Wshadow -O2 -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG -I/lib/gcc-lib/arm-linux/2.95.3/include    -c -o applets/applets.o applets/applets.c
/bin/sh: line 1: arm-linux-gcc: command not found
make: arm-linux-gcc : commande introuvable
make: *** [applets/applets.o] Erreur 127
so it's seem's that the system doesn't find the arm-linux-gcc
i don't know why :(

I use a pre-build cross compiler, located in /usr/local/arm/2.95.3

if somebody have an idea about how to resolves this problem...

thanks for you help

---
katolecho
katolecho
Location: Valence, France
Posts: 22
Joined: Tue Mar 01, 2005 12:54 pm

Tue Mar 22, 2005 5:35 pm

i've just resolved one part of the problem

Code: Select all

[root@StageIup busybox-1.00-rc3]# make CROSS=/usr/src/arm/2.95.3/bin/arm-linux- LIBCDIR=/usr/local/arm/2.95.3 LIBRARIES=/usr/local/arm/2.95.3/arm-linux/lib/libc.a -lgcc GCCINCDIR=/usr/local/arm/2.95.3/arm-linux/include CROSS_CFLAGS+=-I$(LIBCDIR)/lib/gcc-lib/arm-linux/2.95.3/include -I$(GCCINCDIR) PREFIX=../busyinstall
bash: LIBCDIR: command not found
bash: GCCINCDIR: command not found
/usr/src/arm/2.95.3/bin/arm-linux-gcc -I./include -Wall -Wstrict-prototypes -Wshadow -O2 -fstrict-aliasing -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG -I/lib/gcc-lib/arm-linux/2.95.3/include    -c -o applets/applets.o applets/applets.c
arm-linux-gcc: installation problem, cannot exec `cpp0': No such file or directory
make: *** [applets/applets.o] Erreur 1
so there still the others problems

but at this time make install works fine but the system with Debian-busybox was not tested
pratyush
Contact:
Location: india
Posts: 19
Joined: Fri May 21, 2004 7:16 am

Thu Mar 24, 2005 8:14 am

hi,
i have made my own file system just couple of days ago.
i used busybox-1.00, and had no problem.
u mast have included path of arm-linux-gcc.
now u can use these commands.
#cd busybox-1.00
#make TARGET_ARCH=arm CROSS=arm-linux- ---prefix=/home/pratyush/armdev/rootfs menuconfig
#make TARGET_ARCH=arm CROSS=arm-linux- ---prefix=/home/pratyush/armdev/rootfs all install


or u can also use
#cd busybox-1.00
#make menuconfig
then u can change path of cross compiler and install according to ur set-up.
#make all install

now u can ls to ur rootfs/bin rootfs/sbin and can find ur binaries.

regards
pratyush
pratyush
Contact:
Location: india
Posts: 19
Joined: Fri May 21, 2004 7:16 am

Thu Mar 24, 2005 8:59 am

sorry..command is slightly different....
i checked my script file .its as under:

#cd busybox-1.00
#make TARGET_ARCH=arm CROSS=arm-linux- menuconfig
#make TARGET_ARCH=arm CROSS=arm-linux- PREFIX=/home/pratyush/armdev/rootfs all install
katolecho
Location: Valence, France
Posts: 22
Joined: Tue Mar 01, 2005 12:54 pm

Thu Mar 24, 2005 12:11 pm

seems to have a problem
i can't comile anymore

so i tried your solution with

Code: Select all

[root@StageIup busybox-1.00-rc3]# make TARGET_ARCH=arm CROSS=/usr/src/arm/2.95.3/bin/arm-linux- PREFIX=./compilResult all install
and the result is not very good

Code: Select all

/usr/src/arm/2.95.3/bin/arm-linux-gcc -I./include -Wall -Wstrict-prototypes -Wshadow -O2 -fstrict-aliasing -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG     -c -o applets/applets.o applets/applets.c
arm-linux-gcc: installation problem, cannot exec `cpp0': No such file or directory
make: *** [applets/applets.o] Erreur 1
the menuconfig step was well done (i tried with a default configuration)
it's very strange
katolecho
Location: Valence, France
Posts: 22
Joined: Tue Mar 01, 2005 12:54 pm

Thu Mar 24, 2005 5:52 pm

I've just resolve the problem
I've changed my Cross compiler (2.95.3) to the 3.0 version

it seems to work but an other problem appear:

Code: Select all

In file included from /usr/local/arm/cross-3.0/arm-linux/sys-include/net/route.h:27,
                 from networking/route.c:42:
/usr/local/arm/cross-3.0/arm-linux/sys-include/net/dst.h:30: parse error before "atomic_t"
/usr/local/arm/cross-3.0/arm-linux/sys-include/net/dst.h:67: parse error before '}' token
/usr/local/arm/cross-3.0/arm-linux/sys-include/net/dst.h:77: parse error before "__u32"
/usr/local/arm/cross-3.0/arm-linux/sys-include/net/dst.h:85: parse error before "atomic_t"
/usr/local/arm/cross-3.0/arm-linux/sys-include/net/dst.h:87: parse error before '}' token
In file included from /usr/local/arm/cross-3.0/arm-linux/sys-include/linux/sched.h:18,
                 from /usr/local/arm/cross-3.0/arm-linux/sys-include/net/inetpeer.h:14,
                 from /usr/local/arm/cross-3.0/arm-linux/sys-include/net/route.h:28,
                 from networking/route.c:42:
/usr/local/arm/cross-3.0/arm-linux/sys-include/asm/semaphore.h:18: parse error before "wait_censored_head_t"
/usr/local/arm/cross-3.0/arm-linux/sys-include/asm/semaphore.h: In function `sema_init':
/usr/local/arm/cross-3.0/arm-linux/sys-include/asm/semaphore.h:47: dereferencing pointer to incomplete type
/usr/local/arm/cross-3.0/arm-linux/sys-include/asm/semaphore.h:48: dereferencing pointer to incomplete type
/usr/local/arm/cross-3.0/arm-linux/sys-include/asm/semaphore.h:49: dereferencing pointer to incomplete type
In file included from /usr/local/arm/cross-3.0/arm-linux/sys-include/linux/signal.h:4,
                 from /usr/local/arm/cross-3.0/arm-linux/sys-include/linux/sched.h:26,
                 from /usr/local/arm/cross-3.0/arm-linux/sys-include/net/inetpeer.h:14,
                 from /usr/local/arm/cross-3.0/arm-linux/sys-include/net/route.h:28,
                 from networking/route.c:42:
/usr/local/arm/cross-3.0/arm-linux/sys-include/asm/signal.h: At top level:
/usr/local/arm/cross-3.0/arm-linux/sys-include/asm/signal.h:27: conflicting types for `sigset_t'
/usr/local/arm/cross-3.0/arm-linux/include/sys/select.h:38: previous declaration of `sigset_t'
In file included from /usr/local/arm/cross-3.0/arm-linux/sys-include/linux/sched.h:77,
                 from /usr/local/arm/cross-3.0/arm-linux/sys-include/net/inetpeer.h:14,
                 from /usr/local/arm/cross-3.0/arm-linux/sys-include/net/route.h:28,
                 from networking/route.c:42:
/usr/local/arm/cross-3.0/arm-linux/sys-include/linux/time.h:9: redefinition of `struct timespec'
/usr/local/arm/cross-3.0/arm-linux/sys-include/linux/time.h:88: redefinition of `struct timeval'

(...)


include/libbb.h:254: redefinition of `struct sysinfo'
include/libbb.h:270: warning: declaration of `info' shadows global declaration
include/libbb.h:307: warning: declaration of `flags' shadows global declaration
include/libbb.h:437: warning: declaration of `flags' shadows global declaration
networking/route.c:475: warning: declaration of `flags' shadows global declaration
networking/route.c: In function `set_flags':
networking/route.c:476: warning: declaration of `flags' shadows global declaration
networking/route.c: In function `displayroutes':
networking/route.c:490: warning: declaration of `flags' shadows global declaration
make: *** [networking/route.o] Erreur 1
if anybody now if there is a patch for it one something else...
i'm actually looking for over the Internet but doesn't find anything
so, may someone help me?
katolecho
Location: Valence, France
Posts: 22
Joined: Tue Mar 01, 2005 12:54 pm

Fri Mar 25, 2005 4:01 pm

I've just resolve the problem by using the cross compiler 3.0

all is fine but i had to edit libbb/loop.c and comment #include <linux/version.h>

now i have to find libcrypt.so.1 because the file does not exist


i hope that this topic could help other newb'...
pratyush
Contact:
Location: india
Posts: 19
Joined: Fri May 21, 2004 7:16 am

Mon Mar 28, 2005 11:40 am

hi ,
i was also getting this exec cpp0 error 4 months before when i started my work with arm-linux. this error comes when ur cross compiler is not located in proper path. so by using
$arm-linux-gcc -print-search-dirs ,
u can find the name of directory in which cross compiler is to be installed.just copy the tools directory in the proper path.u won't have any more error.

pratyush
katolecho
Location: Valence, France
Posts: 22
Joined: Tue Mar 01, 2005 12:54 pm

Mon Mar 28, 2005 1:59 pm

that's what i was thinking
but now the problem is about dynamic libraries that don't appear in my distrib
i'll try to post my new error tomorrow, lol

embedded linux is so hard when you never use linux before :cry:

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 3 guests