Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 08 Aug 2014 22:30:32 +0200
From: Tim Tassonis <stuff@...entral.ch>
To: musl@...ts.openwall.com
Subject: Compiling latest busybox with latest 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@...entral.ch
+41 79 229 36 17

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.