[FAQ] Re: [BusyBox] undefined reference to main
Rob Landley
rob at landley.net
Tue Apr 5 18:49:50 UTC 2005
On Tuesday 05 April 2005 04:51 am, Philip Rakity wrote:
> Using brecis mips compiler tools -- standard busybox 1.0 and snapshot
> --
> but give link error as below but if I add a -lc -lgcc before
> -Wl,--end-group then no error. Does the makefile make an assumption
> about built-in library support ?
Nope, that's an issue with your compiler. Ordinarily, there are default
libraries linked in, including libc and libgcc, that don't need to be
specified on the compiler command line.
Okay, time for a FAQ update.
New entries:
*** What is Busybox?
Busybox is a re-implementation of the standard Linux command line utilities,
optimized for small size and simple implementation.
Busybox uses a space-saving "swiss army knife" design, where a single binary
(with multiple symlinks pointing at it) acts differently depending on which
name (ls, grep, more...) was used to invoke it. Which specific applets are
included in the busybox binary is configurable through a linux-kernel-style
"make menuconfig" interface. Selecting just a single applet can result in a
busybox binary as small as 4k. A full build of busybox with every applet it
supports ("make allyesconfig") is less than a megabyte.
*** How feature-complete is Busybox?
Although busybox does not implement every GNU extension, it is fairly
feature-complete. Busybox aims for full Single Unix Specification (version
3) compliance, although it's not quite there yet in places. (A <a
href="http://www.opengroup.org/onlinepubs/009695399/utilities/">SUSv3
compliance audit</a> would be a good starting project for new contributors.)
The best stress-test is real-world usage. Busybox has been used in a
development environment, to create a Linux distribution capable of rebuilding
itself from source. Busybox was able to fully replace the standard (GNU)
packages coreutils, file, findutils, gawk, grep, inetutils, modutils,
net-tools, procps, sed, shadow, sysklogd, sysvinit, tar, util-linux, and vim.
Due to bugs or missing features, it could not fully replace bash, diffutils,
bzip2, gzip, less, and patch.
For more information on the functional limitations revealed by this sort of
stress-testing, see the "TODO" file in the source distribution. (Another
good starting place for ambitious newbies.)
*** Embedded systems and cross compiling.
Although busybox is commonly used in embedded systems, the busybox mailing
list is not really the best place to ask questions about cross-compiling or
general system creation. Keep in mind that we don't usually release versions
of Busybox that don't build, so if you have problems compiling and linking
busybox on a non-x86 system, try building a vanilla x86 version before
talking to us. Most likely the problem is with your toolchain, headers,
library path...
To learn how to put together your own customized Linux system entirely from
source code, check out the <a href="http://www.linuxfromscratch.org">Linux
From Scratch</a> project. The maintainer of Busybox does maintain a couple
of Linux distributions, <a href="http://buildroot.uclibc.org/">Buildroot</a>
and <a href="http://www.uclibc.org/dists/">Debian/uClibc</a>, which might be
a good basis for an embedded system.
For cross compiling, Dan Kegel's <a
href="http://http://kegel.com/crosstool/">Crosstool</a> seems to be fairly
popular.
-------------------------------------------------
And I'd change "Which Linux kernel versions are supported?" to:
What platforms does busybox run on?
Busybox is aimed at the Linux kernel, version 2.2 or later. While some
functionality is very Linux specific (losetup and insmod are good examples),
a large fraction of the code should run on just about any POSIX compliant
system. It should be fairly easy to port the majority of the code to
support, FreeBSD, Solaris, MacOS X, or even Windows (if you are into that
sort of thing), but only currently only a Linux version is actively
maintained.
Also, "How can I get started using busybox?" would be a good one...
Rob
More information about the busybox
mailing list