[BusyBox] Compiling busybox with uClibc

David Douthitt ssrat at mailbag.com
Thu Aug 2 17:15:33 UTC 2001


I'm doing this for the first time (with CVS); I've compiled numerous
times against GNU libc.  What I'm trying to do is link against uClibc
statically and thus get rid of the need for GNU libc during startup.

This is what I see:

# file ./busybox
./busybox: ELF 32-bit LSB executable, Intel 80386, version 1,
dynamically linked (uses shared libs), not stripped
# ls -l ./busybox
-rwxrwxr-x    1 root     1000       593564 Aug  2 17:54 ./busybox
# ./busybox
ksh: ./busybox: No such file or directory
#

I'd at least hoped for an error that some one or another library was
missing.  I also got that "No such file" when I tried to use ldd (when I
had a nondebuggable busybox).

What's going on?  I'm going to try using CFLAGS_EXTRA=-static to bypass
these troubles altogether; but still, I'd like to know why busybox is
acting like Schrodinger's cat :-)  ...does it exist or doesn't it?

Also, insmod.c generated a warning about reaching the end of a void
function:

insmod.c: In function `get_kernel_version':
insmod.c:1321: warning: control reaches end of non-void function

Also, if you don't use ANY shells, then applet.h causes things to fail. 
I used this patch to fix it:

--- applets.h.orig      Thu Aug  2 18:10:42 2001
+++ applets.h   Thu Aug  2 17:47:58 2001
@@ -356,6 +356,7 @@
 #ifdef BB_SETKEYCODES
        APPLET(setkeycodes, setkeycodes_main, _BB_DIR_USR_BIN)
 #endif
+#if defined(BB_MSH) || defined(BB_ASH) || defined(BB_LASH) ||
defined(BB_HUSH)
 #ifdef BB_FEATURE_SH_IS_ASH
        APPLET_NOUSAGE("sh", ash_main, _BB_DIR_BIN)
 #elif defined(BB_FEATURE_SH_IS_HUSH)
@@ -364,6 +365,7 @@
        APPLET_NOUSAGE("sh", lash_main, _BB_DIR_BIN)
 #elif defined(BB_FEATURE_SH_IS_MSH)
        APPLET_NOUSAGE("sh", msh_main, _BB_DIR_BIN)
+#endif
 #endif
 #ifdef BB_SLEEP
        APPLET(sleep, sleep_main, _BB_DIR_BIN)

Also, it turned out that CFLAGS_EXTRA=-static didn't do it; I changed
CC=... to CC=... -static and that worked - but did it really?  Busybox
works, but it added 60+k to the binary - is that about right?

Even if it did, removing the need for 500k in glibc during startup would
be nice...

By the way, I must be the one for "version control" :-) ....here's a
patch...

--- Makefile.orig       Thu Aug  2 18:14:13 2001
+++ Makefile    Thu Aug  2 18:03:40 2001
@@ -18,7 +18,7 @@
 #
 
 PROG      := busybox
-VERSION   := 0.53pre
+VERSION   := 0.60.0
 BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
 export VERSION





More information about the busybox mailing list