mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Tim Tassonis <stuff@decentral.ch>
To: musl@lists.openwall.com
Subject: Compiling latest busybox with latest musl
Date: Fri, 08 Aug 2014 22:30:32 +0200	[thread overview]
Message-ID: <53E53368.3070107@decentral.ch> (raw)

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


             reply	other threads:[~2014-08-08 20:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08 20:30 Tim Tassonis [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53E53368.3070107@decentral.ch \
    --to=stuff@decentral.ch \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).