Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
compiling x86 busybox with uclibc support
- 12-20-2007
- Sven Geggus
December 20, 2007, 2:19 pm

Hi there,
this is supposed to be a FAQ, but unfortunately it is not.
How would I configure busybox to get linked against my custom Version of
uclibc insted of the system glibc?
Unfortunately recent Versions of busybox are no longer statically linkable
against glibc.
Sven
this is supposed to be a FAQ, but unfortunately it is not.
How would I configure busybox to get linked against my custom Version of
uclibc insted of the system glibc?
Unfortunately recent Versions of busybox are no longer statically linkable
against glibc.
Sven
--
.. this message has been created using an outdated OS (UNIX-like) with an
outdated mail- or newsreader (text-only) :-P
.. this message has been created using an outdated OS (UNIX-like) with an
outdated mail- or newsreader (text-only) :-P
We've slightly trimmed the long signature. Click to see the full one.

Re: compiling x86 busybox with uclibc support

Set Makefile CROSS_COMPILE variable to gcc which link with uclibc.
There are at least 3 possibilities to get such gcc.
1) Build custom GNU toolchain
2) Use debian uclibc-toolchain wrapper
3) Create custom gcc wrapper
AFAIK Option 1) is a must if you plan to use floating point.
I use 3) option with below script but it's unreliable (I show it only
for reference)
#!/bin/sh
uclibc=/usr/src/uClibc-0.9.29
gccdir="/usr/lib/gcc-lib/i486-linux/3.3.5/"
gccinc="$/include"
gcclib="$"
lnxinc="/usr/src/linux-2.6.16.y/include/"
linking="yes"
static="no"
busybox="no"
for opt in $* ; do
case $opt in
-c|-S|-E) linking="no" ;;
-static) static="yes" ;;
busybox_unstripped) busybox="yes" ;; # FIXME
esac
done
ldopts=
suffix=
if [ "$linking" == "yes" ] ; then
ldir="$/lib/"
if [ "$static" == "yes" ] ; then
crt1=
if [ "$busybox" == "no" ] ; then
crt1="$/Scrt1.o"
fi
ld_dyn=
ld_libs="-L$ -lc -lgcc"
suffix="$/libc.a $/libgcc.a"
else
crt1=
if [ "$busybox" == "no" ] ; then
crt1="$/crt1.o"
fi
ld_dyn="-Wl,-rpath,$/lib,--dynamic-linker
$/lib/ld-uClibc.so"
ld_libs="-L$ -lc -lgcc"
fi
ldopts="$ld_dyn $crt1 $ld_libs"
fi
incopts="-nostdinc -I$/include -I$lnxinc -isystem $gccinc"
libopts="-nostdlib -nodefaultlibs"
exec gcc $incopts $libopts $ldopts $* $suffix

Re: compiling x86 busybox with uclibc support

hm, sound complicated...

unfortunately Im unable to backport the debian uclibc package for
debian etch.

Hm, this could probable be the way to go. All I need is a static
busybox binary after all.
Sven
--
Threading is a performance hack.
(The Art of Unix Programming by Eric S. Raymond)
Threading is a performance hack.
(The Art of Unix Programming by Eric S. Raymond)
We've slightly trimmed the long signature. Click to see the full one.
Site Timeline
- » [Commercial] Linux System and Device Driver Programming from Professionals
- — Next thread in » Embedded Linux
-
- » Watchdog Timer on Boser HS-7001
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Miernik energii potrzebny, taki domowy
- — The site's Newest Thread. Posted in » Electronics (Polish)
-
- » ESR "больших" конденсаторов
- — The site's Last Updated Thread. Posted in » Electronic Circuits (Russian)
-