From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5787 Path: news.gmane.org!not-for-mail From: Tim Tassonis Newsgroups: gmane.linux.lib.musl.general Subject: Compiling latest busybox with latest musl Date: Fri, 08 Aug 2014 22:30:32 +0200 Message-ID: <53E53368.3070107@decentral.ch> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1407529852 19073 80.91.229.3 (8 Aug 2014 20:30:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Aug 2014 20:30:52 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5792-gllmg-musl=m.gmane.org@lists.openwall.com Fri Aug 08 22:30:46 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XFqoH-0000Wb-M8 for gllmg-musl@plane.gmane.org; Fri, 08 Aug 2014 22:30:45 +0200 Original-Received: (qmail 5411 invoked by uid 550); 8 Aug 2014 20:30:45 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 5403 invoked from network); 8 Aug 2014 20:30:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=decentral.ch; s=rsa1; h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From:Date:Message-ID; bh=em+dO3VdAwQg+RYaxx7bU3uv81v+9tWgcGYLbCOJ4UA=; b=suH0ttAmxKHniS2x6fk1hHbnTl3psizkO6gaL+E/1M5yu1PSbR/1Kc8zei4DypL6lBpUvLA4SzMcoKr6rEam6MG1dCJ7eKN2a1wipv8jjjVUU+oJyGW/D4OEWH3T4spT; User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 Xref: news.gmane.org gmane.linux.lib.musl.general:5787 Archived-At: 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