compiling x86 busybox with uclibc support

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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 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

Quoted text here. Click to load it
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

Quoted text here. Click to load it

hm, sound complicated...

Quoted text here. Click to load it

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

Quoted text here. Click to load it

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)

We've slightly trimmed the long signature. Click to see the full one.
Re: compiling x86 busybox with uclibc support
Quoted text here. Click to load it


What is an "debian etch" ?

Quoted text here. Click to load it

Re: compiling x86 busybox with uclibc support

Quoted text here. Click to load it

Debian GNU/Linux 4.0 usually know by its codename "etch" :)

Sven

--
The main thing to note is that when you choose open source you don't
get a Windows operating system.
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline