LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-25-2005, 07:08 PM   #1
spencerbray
LQ Newbie
 
Registered: Jan 2005
Posts: 7

Rep: Reputation: 0
Busybox and uClibc


New to linux and the embedded world, I have tried to create a valid root filesystem using BusyBox and uClibC. I am not cross compling to another platform, its all i386.

If I make busybox with a static linked library all works fine as expected and I can boot from my new filesystem. Changing the busybox config to a dynamic linked library configuration, I start to get problems. This is where my knowledge takes a nose dive. From what I can google, I need to compile busybox against uclibc libs as right now it's being compiled against the glibc lib. Now I think that uclibc should create a gcc wrapper for me to cross compile against somewhere under /usr/i386-linux-uclibc. No such luck.

Can anyone tell me how to get it do this? Am I missing something fundermental?

I'm going mad with this. Your help would be much appreciated.

 
Old 01-25-2005, 10:16 PM   #2
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Well technically unless you'll be adding several programs to the disk, ie not busybox emulated programs, you won't save much space using dynamically linked binaries. Especially if you include any C++ programs, as those libraries are huge. Instead I'd trim down bsybox to what I need and compile it static. Also uclibc isn't required. You can use the standard glibc libraries as well. However, you can downsize things quiet a bit using uclibc. Either way, run "ldd" on the busybox binary to determine what libraries it requires. Install those libraries on the disk and it should run fine. You can also use strace to get even more info on what's needed.

As far as uclibc goes. There are couple of ways to set it up under linux. They offer a toolchain installer that will download everything for you, compile it and install it. All you have to do then is set busybox to use it instead of the host gcc & glibc. That option is set in the configuration menu when you configure busybox, ie "make menuconfig", under "Build Options -> Do you want to build BusyBox with a Cross Compiler?". Mine is set to:

/usr/local/compiler/cross/uclibc-3.3/bin/i386-linux-uclibc-

which is where my uclibc gcc toolchain is installed. Busybox will append the gcc and etc onto the end of the i386-linux-uclibc- so don't add it. They also offer a complete uclibc development environment that you can install and chroot into to build things against the uclibc libraries, although I haven't tired it. BTW, you'll need to build an ldd for your host that uses uclibc if you want to use it on uclibc binaries. Check the FAQ for info on doing that.
 
Old 01-26-2005, 03:50 AM   #3
spencerbray
LQ Newbie
 
Registered: Jan 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Ham ;-),

Many thanks for your reply. I've read many articles on the web about building a boot floppy with uclibc/ busybox and none of them mention using a toolchain. Are they using another method to complile busybox against uclibc? Its a mystery to me.

I'm currently trying the toolchain option you described. However it seems to download and do loads of stuff for me. Feel a bit cheated. Do you know of a "from scratch" type approach that i could use to understand the full process?

Also, what would happen if I pointed /lib at the i386-linux-uclibc/lib dir for the duration of the busybox build. Would this work?

Spencer

 
Old 01-26-2005, 02:41 PM   #4
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Quote:
Originally posted by spencerbray
Ham ;-),

Many thanks for your reply. I've read many articles on the web about building a boot floppy with uclibc/ busybox and none of them mention using a toolchain. Are they using another method to complile busybox against uclibc? Its a mystery to me.
There use to be a wrapper of sorts that would allow you to use your existing glibc toolchain, but they dropped support for it in favor a complete uclibc toolchain instead. More info can be found at http://uclibc.org/FAQ.html#wrapper.

Quote:
Originally posted by spencerbray
I'm currently trying the toolchain option you described. However it seems to download and do loads of stuff for me. Feel a bit cheated. Do you know of a "from scratch" type approach that i could use to understand the full process?
Yeah, I hate that as well. Guess the author figured it was less trouble to just do it all for you. Anyway, I'm not aware of a detailed howto of sorts. I customized the makefile a little, removed ccache and went with it as I remember.

Quote:
Originally posted by spencerbray
Also, what would happen if I pointed /lib at the i386-linux-uclibc/lib dir for the duration of the busybox build. Would this work?
Compiler failure most likely. But try it and see.
 
Old 01-27-2005, 03:01 AM   #5
spencerbray
LQ Newbie
 
Registered: Jan 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Many thanks for you insight.

Spencer
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
2.6.14 kernel + uClibc can't manage memory? Yerp Linux - Software 0 11-13-2005 06:51 PM
Where can i get uClibc-0.2.tgz? cn_chopsticks Linux - Software 0 09-25-2005 06:47 AM
Network setup with uClibc & Busybox lapique Linux - Networking 0 12-13-2004 07:39 AM
bulding a gcc toolchain with uclibc behmjose Programming 1 02-29-2004 10:54 PM
uclibc install_target lukebeales Programming 0 11-25-2003 10:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration