Bug 9846 - musl libc not installed correctly in target folder
Summary: musl libc not installed correctly in target folder
Status: RESOLVED WORKSFORME
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2017.02.1
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-27 20:03 UTC by Steffe
Modified: 2017-05-07 19:34 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
defconfigs for glibc/musl respectively (2.02 KB, application/x-zip-compressed)
2017-04-27 20:03 UTC, Steffe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffe 2017-04-27 20:03:04 UTC
Created attachment 7051 [details]
defconfigs for glibc/musl respectively

I am the deveveloper of a custom i386 based embedded Linux system, and I am using buildroot to create the system images that goes into it.

I am currently running on the master branch of buildroot as of yesterday 2016-04-26 (6538125 package/pcsc-lite: bump version to 1.8.20) since I wanted to try out the newly added s6 stuff:

However, I usually build my linux system using glibc and the busybox init system. Yesterday I wanted to try out the musl libc to see how it performed compared to glibc. But when changing to musl libc and after a "make clean" "make", which goes through without issues, it appears as musl libc is not installed correctly in the target folder.

When building with glibc as option, I get the following files in my output/target/lib (among a bunch of others):

/lib/libc.so -> libc.so.6*
/lib/libc.so.6 -> libc-2.24.so*
/lib/libc-2.24.so*
/lib/ld-linux.so.2 -> ld-2.24.so*
/lib/ld-2.24.so*

When building with musl, I only get:

/lib/ld-musl-i386.so.1 -> /lib/libc.so
/lib/libc.so -> libc.so.6

So there is a symlink to libc.so.6, but file it points to does not exist which makes my init fail to execute during boot.

When looking in my output/build/musl-1.1.16/lib, I guess I have the missing files:

libc.a
libc.so*

But these seems to never be copied to the target folder correctly,...

If I manually copy the contents of output/build/musl-1.1.16/lib/ to /lib on my target system (and remove the libc.so symlink), my init works as expected, and I can boot it completely.

I have attached my buildroot defconfig for both configurations.

Best Regards
Stefan Nilsson
Comment 1 Thomas Petazzoni 2017-05-07 19:34:54 UTC
Thanks for your report. Unfortunately, I'm not able to reproduce. The musl system produced by your defconfig looks OK to me:

$ ls -l target/lib/libc.so 
-rwxr-xr-x 1 test test 587296 May  7 15:29 target/lib/libc.so

And it boots just fine (tested under Qemu):

Welcome to TEST
test login: 
Welcome to TEST
test login: 

So, a few options:

 1. Something has been fixed since then, but I don't recall any fix related to this being applied recently.

 2. Something is different on your build machine.

 3. You did not clean up the build completely.

I'll mark the bug as WORKSFORME for now. If you manage to reproduce again with the latest Buildroot, could you try to preview a simpler defconfig that exhibits the issue so that we can try to narrow down the issue ?

Keeping the full build log would also be useful.