[Clfs-dev] [CLFS-EMBEDDED] Musl-libc

Kirk Terrell knjterrell at mybluelight.com
Sat Jul 20 10:16:58 PDT 2013


On 07/19/2013 09:53 AM, Andrew Bradford wrote:
> On Fri, Jul 19, 2013, at 11:19 AM, Kirk Terrell wrote:
>> I am attempting to build a musl flavored clfs embedded. I am using the
>> set of packages from the 2012-09-?? version of the embedded book. I am
>> unable to compile busybox:
>>
>>> networking/lib.a(isrv_identd.o): In function `do_rd':
>>> isrv_identd.c:(.text.do_rd+0x108): undefined reference to `fdprintf'
>>> isrv_identd.c:(.text.do_rd+0x120): undefined reference to `fdprintf'
>>> printutils/lib.a(lpr.o): In function `lpqr_main':
>>> lpr.c:(.text.lpqr_main+0x178): undefined reference to `fdprintf'
>>> lpr.c:(.text.lpqr_main+0x1a4): undefined reference to `fdprintf'
>>> lpr.c:(.text.lpqr_main+0x1f4): undefined reference to `fdprintf'
>>> printutils/lib.a(lpr.o):lpr.c:(.text.lpqr_main+0x298): more undefined references to `fdprintf' follow
>
> I believe fdprintf() is just dprintf() as per busybox source, as a
> #define in platform.h.  musl provides a dprintf() but I've not tried a
> musl build yet, myself.
>
>> prior to building busybox I set C_INCLUDE_PATH=${CLFS}/include -
>> otherwise it couldn't find the header files. I've also tried to build as
>> a static system.
>
> Are you following the instructions for the current book but using old
> packages?  Or some combo like that?
> Did you have this issue only with musl or also with uClibc?
>
>> I did a static compile of hello.c using my tool chain and it worked, but
>> when i changed printf to fdprintf I got the same error message.
>
> If you use dprintf() in stead of fdprintf() does that work?  I believe
> you need to have an open fd to use dprintf().
>
>> I am using gcc-4.6.0; musl-0.9.11 and busybox-1.18.4. I am attempting to
>> build a system based on the mips Malta machine. I've done so succesfully
>> w/ uClibc.
>
> Let me know how musl works for you, I'm very interested.
>
> Thanks,
> Andrew

	You were spot on - I was able to compile busybox after giving the 
additional C flag -Dfdprintf=dprintf, and turning off some of the 
default applets. The most troublesome one was the mount command wouldn't 
compile because of missing rpc/rpc.h header file. I was able to boot a 
QEMU Malta system, but the initscript listed failures due to missing 
mount commands. It looks like the Musl based systems involve a number of 
patches e.g. 
https://github.com/chneukirchen/sabotage/blob/master/KEEP/busybox.patch.

	The Musl libc library weighed in at 1 mb.


	I am building to a fork of your gitHub, which I forked before your July 
updates. So I am using older packages, and I have made changes to 
support no clfs user and automated build of the system outlined in book. 
The fork is at https://github.com/kanj/elfs. I didnot have issues with 
uClibc not finding the required headers.

	It looks like busybox supports dietlibc and newlib, what do you think 
of one of those?




____________________________________________________________
Fast, Secure, NetZero 4G Mobile Broadband. Try it.
http://www.netzero.net/?refcd=NZINTISP0512T4GOUT2



More information about the Clfs-dev mailing list