mailing list of musl libc
 help / color / mirror / code / Atom feed
* Compiling latest busybox with latest musl
@ 2014-08-08 20:30 Tim Tassonis
  2014-08-08 20:51 ` Rich Felker
  2014-08-09  6:45 ` u-igbb
  0 siblings, 2 replies; 5+ messages in thread
From: Tim Tassonis @ 2014-08-08 20:30 UTC (permalink / raw)
  To: musl

Hi

Firstly, thanks for musl. I chose it to create fully-working statically
linked binaries for a system without any glibc stuff on it and did not
want to create a whole toolchain first, as required with uClibc.

When I wanted to create s statically linked busybox (1.22.1), I looked
in the wiki and found the page:

http://wiki.musl-libc.org/wiki/Building_Busybox


This put me off a bit, as I did not want to modify my kernel headers
just to compile a static busybox.

But I found a less intrusive way to achieve my goal, maybe you might
want to add this to the next release or document it somewhere. Or of
course tell me that this is absolutely not the way to go....

1. Step: Download, compile and install musl-1.1.14

MUSL_BASE=$HOME/local/musl
KHDR_BASE=/usr
./configurre --prefix=$MUSL_BASE
make
make install
PATH=$MUSL_BASE/bin export PATH

2. Step: Make some headers and program names available for busybox

cd $MUSL_BASE/bin
ln -s `which ar` musl-ar
ln -s `which strip` musl-strip
cd $MUSL_BASE/include
ln -s $KHDR_BASE/include/linux linux
ln -s /tools/include/mtd mtd
if [ -d $KHDR_BASE/include/asm ]
then
	ln -s $KHDR_BASE/include/asm asm
else
	ln -s $KHDR_BASE/include/asm-generic asm
fi
ln -s $KHDR_BASE/include/asm-generic asm-generic

3. Step: Compile busybox

make defconfig
make menuconfig
under build options, i chose:

CONFIG_STATIC=y
CONFIG_CROSS_COMPILER_PREFIX="musl-"

and then
make V=1

The following applets failed to compile:

#CONFIG_IFPLUGD
#CONFIG_INETD


Otherwise everything compiled and I got an almost fully-featured,
statically linked busybox without ever having to change one header,
source or makefile, let alone become root. Size: 911096

Host system was Ubuntu Server 13.10 64 bit
Toolchain was the temporary build system of LFS 7.5:

- gcc 4.8.2
- binutuils 2.24
- Kernel headers of linux-3.13.3

I tried also with the ubuntu kernel headers (3.11.0-26), worked as well.

Kind regards
Tim

-- 
decentral.ch - IT Stuff
Tim Tassonis
Dennlerstasse 36
8047 Zürich

stuff@decentral.ch
+41 79 229 36 17


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-09  6:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-08 20:30 Compiling latest busybox with latest musl Tim Tassonis
2014-08-08 20:51 ` Rich Felker
2014-08-08 21:12   ` Tim Tassonis
2014-08-08 21:15     ` Rich Felker
2014-08-09  6:45 ` u-igbb

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).