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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-25-2005, 07:08 PM
|
#1
|
LQ Newbie
Registered: Jan 2005
Posts: 7
Rep:
|
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.
|
|
|
01-25-2005, 10:16 PM
|
#2
|
Member
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561
Rep:
|
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.
|
|
|
01-26-2005, 03:50 AM
|
#3
|
LQ Newbie
Registered: Jan 2005
Posts: 7
Original Poster
Rep:
|
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
|
|
|
01-26-2005, 02:41 PM
|
#4
|
Member
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561
Rep:
|
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.
|
|
|
01-27-2005, 03:01 AM
|
#5
|
LQ Newbie
Registered: Jan 2005
Posts: 7
Original Poster
Rep:
|
Many thanks for you insight.
Spencer
|
|
|
All times are GMT -5. The time now is 05:24 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|