mailing list of musl libc
 help / color / mirror / code / Atom feed
* CLFS embedded book switches to musl-libc
@ 2013-10-16 19:59 Andrew Bradford
  2013-10-16 20:38 ` John Spencer
  2013-10-22 18:58 ` [Clfs-dev] " Kevyn-Alexandre Paré
  0 siblings, 2 replies; 9+ messages in thread
From: Andrew Bradford @ 2013-10-16 19:59 UTC (permalink / raw)
  To: musl, CLFS Support, CLFS development discussion
  Cc: Thomas Petazzoni, Gregor Richards

As an FYI: the Cross Linux From Scratch embedded book has switched from
uClibc to musl as of today.

http://cross-lfs.org/view/clfs-embedded/

I've done some build testing for arm but welcome more people who are
interested in testing or submitting patches to fix errors.  It's still
early-days for musl in CLFS so there's bound to be plenty of issues to fix.

Many thanks to all of the musl developers!

I also found patches from Gregor Richards's musl-cross and Thomas
Petazzoni's buildroot work very helpful.

Thanks!
Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CLFS embedded book switches to musl-libc
  2013-10-16 19:59 CLFS embedded book switches to musl-libc Andrew Bradford
@ 2013-10-16 20:38 ` John Spencer
  2013-10-16 20:46   ` Andrew Bradford
  2013-10-22 18:58 ` [Clfs-dev] " Kevyn-Alexandre Paré
  1 sibling, 1 reply; 9+ messages in thread
From: John Spencer @ 2013-10-16 20:38 UTC (permalink / raw)
  To: musl

On 10/16/2013 09:59 PM, Andrew Bradford wrote:
> As an FYI: the Cross Linux From Scratch embedded book has switched from
> uClibc to musl as of today.
>
> http://cross-lfs.org/view/clfs-embedded/

nice work!
while looking around i noticed that
http://cross-lfs.org/view/clfs-embedded/x86/final-system/pkgmgt.html
gives some advice regarding GLIBC, which does not hold for musl.
with musl, it's perfectly safe to just drop in a new libc.so.

>
> I've done some build testing for arm but welcome more people who are
> interested in testing or submitting patches to fix errors.  It's still
> early-days for musl in CLFS so there's bound to be plenty of issues to fix.
>
> Many thanks to all of the musl developers!
>
> I also found patches from Gregor Richards's musl-cross and Thomas
> Petazzoni's buildroot work very helpful.
>
> Thanks!
> Andrew
>



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CLFS embedded book switches to musl-libc
  2013-10-16 20:38 ` John Spencer
@ 2013-10-16 20:46   ` Andrew Bradford
  2013-10-16 21:22     ` John Spencer
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Bradford @ 2013-10-16 20:46 UTC (permalink / raw)
  To: musl; +Cc: maillist-musl

On 10/16/13 16:38, John Spencer wrote:
> while looking around i noticed that
> http://cross-lfs.org/view/clfs-embedded/x86/final-system/pkgmgt.html
> gives some advice regarding GLIBC, which does not hold for musl.
> with musl, it's perfectly safe to just drop in a new libc.so.

Thanks!  I wrote a trac ticket for it.

http://trac.cross-lfs.org/ticket/935

-Andrew


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CLFS embedded book switches to musl-libc
  2013-10-16 20:46   ` Andrew Bradford
@ 2013-10-16 21:22     ` John Spencer
  2013-10-17 12:50       ` Andrew Bradford
  0 siblings, 1 reply; 9+ messages in thread
From: John Spencer @ 2013-10-16 21:22 UTC (permalink / raw)
  To: musl; +Cc: Andrew Bradford

On 10/16/2013 10:46 PM, Andrew Bradford wrote:
> On 10/16/13 16:38, John Spencer wrote:
>> while looking around i noticed that
>> http://cross-lfs.org/view/clfs-embedded/x86/final-system/pkgmgt.html
>> gives some advice regarding GLIBC, which does not hold for musl.
>> with musl, it's perfectly safe to just drop in a new libc.so.
>
> Thanks!  I wrote a trac ticket for it.
>
> http://trac.cross-lfs.org/ticket/935
>
> -Andrew
>

this page also seems to require some cleanup:
http://cross-lfs.org/view/clfs-embedded/x86/appendixc/dependencies.html

it mentions bash (not needed, everything works with posix sh (i.e. 
busybox' ash) as well), glibc, coreutils (should be busybox), gawk 
(busybox awk works as well, at least with latest bugfixes from git), 
udev (not mentioned elsewhere, so its probably not even in clfs), 
diffutils (not needed at all, bb's diff command works just as well), 
file (not needed at all), gzip (included in bb...)

another thing i noticed:
http://cross-lfs.org/view/clfs-embedded/x86/beyond-net/libnl.html
libnl is quite bloated, so the guys from openwrt made a lightweight 
replacement called libnl-tiny (also used by sabotage).
http://wiki.musl-libc.org/wiki/Alternative_libraries#Alternative_Libraries_and_Programs
sabotage also has a ready-to-use tarball available on its download 
mirrors, since openwrt's package seems to require a git checkout.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CLFS embedded book switches to musl-libc
  2013-10-16 21:22     ` John Spencer
@ 2013-10-17 12:50       ` Andrew Bradford
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Bradford @ 2013-10-17 12:50 UTC (permalink / raw)
  To: John Spencer; +Cc: musl

On 10/16/13 17:22, John Spencer wrote:
> On 10/16/2013 10:46 PM, Andrew Bradford wrote:
>> On 10/16/13 16:38, John Spencer wrote:
>>> while looking around i noticed that
>>> http://cross-lfs.org/view/clfs-embedded/x86/final-system/pkgmgt.html
>>> gives some advice regarding GLIBC, which does not hold for musl.
>>> with musl, it's perfectly safe to just drop in a new libc.so.
>>
>> Thanks!  I wrote a trac ticket for it.
>>
>> http://trac.cross-lfs.org/ticket/935
>>
> 
> this page also seems to require some cleanup:
> http://cross-lfs.org/view/clfs-embedded/x86/appendixc/dependencies.html

Thanks!  I'll add trac ticket for cleaning it up, too.

> it mentions bash (not needed, everything works with posix sh (i.e.
> busybox' ash) as well), glibc, coreutils (should be busybox), gawk
> (busybox awk works as well, at least with latest bugfixes from git),
> udev (not mentioned elsewhere, so its probably not even in clfs),
> diffutils (not needed at all, bb's diff command works just as well),
> file (not needed at all), gzip (included in bb...)
> 
> another thing i noticed:
> http://cross-lfs.org/view/clfs-embedded/x86/beyond-net/libnl.html
> libnl is quite bloated, so the guys from openwrt made a lightweight
> replacement called libnl-tiny (also used by sabotage).
> http://wiki.musl-libc.org/wiki/Alternative_libraries#Alternative_Libraries_and_Programs
> 
> sabotage also has a ready-to-use tarball available on its download
> mirrors, since openwrt's package seems to require a git checkout.

I might remove libnl and hostapd from the book, both were there to
support building for mips to target wrt54g devices but the wrt portion
of the book was so out of date that it has been removed earlier this
year.  The goal isn't to teach how to build a wireless router, just how
to get a minimal cross built system up and going.

If I don't remove libnl and hostapd I'll definitely check out libnl-tiny.

Thanks,
Andrew


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Clfs-dev] CLFS embedded book switches to musl-libc
  2013-10-16 19:59 CLFS embedded book switches to musl-libc Andrew Bradford
  2013-10-16 20:38 ` John Spencer
@ 2013-10-22 18:58 ` Kevyn-Alexandre Paré
  2013-10-22 21:08   ` Rich Felker
  1 sibling, 1 reply; 9+ messages in thread
From: Kevyn-Alexandre Paré @ 2013-10-22 18:58 UTC (permalink / raw)
  To: CLFS development discussion
  Cc: Thomas Petazzoni, musl, CLFS Support, Gregor Richards

Hi Andrew,

So far so good! Very interesting that you passed to musl and I'm happy
to start playing with it!

Couple of question about Manual:
You refer to glibc [1] should you replace that glibc with musl libc or
glibc(musl) our simply libc?

For the musl installation [2], the make install have an error that
seem to be fix with the next command you propose:

./tools/install.sh -D -m 644 lib/crt1.o
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crt1.o
./tools/install.sh -D -m 644 lib/Scrt1.o
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/Scrt1.o
./tools/install.sh -D -m 644 lib/crti.o
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crti.o
./tools/install.sh -D -m 644 lib/crtn.o
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crtn.o
./tools/install.sh -D -m 644 lib/libc.a
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.a
./tools/install.sh -D -m 755 lib/libc.so
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.so
./tools/install.sh -D -m 644 lib/libm.a
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libm.a
./tools/install.sh -D -m 644 lib/librt.a
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/librt.a
./tools/install.sh -D -m 644 lib/libpthread.a
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libpthread.a
./tools/install.sh -D -m 644 lib/libcrypt.a
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libcrypt.a
./tools/install.sh -D -m 644 lib/libutil.a
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libutil.a
./tools/install.sh -D -m 644 lib/libxnet.a
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libxnet.a
./tools/install.sh -D -m 644 lib/libresolv.a
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libresolv.a
./tools/install.sh -D -m 644 lib/libdl.a
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libdl.a
./tools/install.sh -D -l
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.so
/lib/ld-musl-arm.so.1 || true
ln: failed to create symbolic link `/lib/ld-musl-arm.so.1.tmp.47054':
Permission denied
./tools/install.sh -D -m 644 arch/arm/bits/alltypes.h
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/include/bits/alltypes.h

So when you describe symlink is it releated to this error:

ln -s libc.so ${CLFS}/cross-tools/${CLFS_TARGET}/ld-musl-arm.so.1

Should this be replace by this and be put in the lib folder?:

ln -s ${CLFS}/cross-tools/${CLFS_TARGET}/lib/libc.so
${CLFS}/cross-tools/${CLFS_TARGET}/lib/ld-musl-arm.so.1

Should we not simply create patch for Makefile as something like that?:
diff -Naur Makefile Makefile.new
--- Makefile 2013-09-23 17:01:11.000000000 -0400
+++ Makefile.new 2013-10-22 14:51:10.216785876 -0400
@@ -14,7 +14,6 @@
 prefix = /usr/local/musl
 includedir = $(prefix)/include
 libdir = $(prefix)/lib
-syslibdir = /lib

 SRCS = $(sort $(wildcard src/*/*.c arch/$(ARCH)/src/*.c))
 OBJS = $(SRCS:.c=.o)
@@ -50,7 +49,7 @@
 ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS)
 ALL_TOOLS = tools/musl-gcc

-LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH)$(SUBARCH).so.1
+LDSO_PATHNAME = ld-musl-$(ARCH)$(SUBARCH).so.1

 -include config.mak

@@ -157,7 +156,7 @@
  $(INSTALL) -D -m 644 $< $@

 $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
- $(INSTALL) -D -l $(libdir)/libc.so $@ || true
+ $(INSTALL) -D -l $(libdir)/libc.so $(libdir)/$@ || true

 install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if
$(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)


I'm currently cross compiling busybox if I see something else I will
keep you updated!

Best Regards,

-KA


[1]: http://cross-lfs.org/view/clfs-embedded/arm/introduction/how.html
[2]: http://cross-lfs.org/view/clfs-embedded/arm/cross-tools/libc.html

On Wed, Oct 16, 2013 at 3:59 PM, Andrew Bradford
<andrew@bradfordembedded.com> wrote:
> As an FYI: the Cross Linux From Scratch embedded book has switched from
> uClibc to musl as of today.
>
> http://cross-lfs.org/view/clfs-embedded/
>
> I've done some build testing for arm but welcome more people who are
> interested in testing or submitting patches to fix errors.  It's still
> early-days for musl in CLFS so there's bound to be plenty of issues to fix.
>
> Many thanks to all of the musl developers!
>
> I also found patches from Gregor Richards's musl-cross and Thomas
> Petazzoni's buildroot work very helpful.
>
> Thanks!
> Andrew
> _______________________________________________
> Clfs-dev mailing list
> Clfs-dev@lists.cross-lfs.org
> http://lists.cross-lfs.org/listinfo.cgi/clfs-dev-cross-lfs.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Re: [Clfs-dev] CLFS embedded book switches to musl-libc
  2013-10-22 18:58 ` [Clfs-dev] " Kevyn-Alexandre Paré
@ 2013-10-22 21:08   ` Rich Felker
  2013-10-23 11:07     ` [musl] " Andrew Bradford
  0 siblings, 1 reply; 9+ messages in thread
From: Rich Felker @ 2013-10-22 21:08 UTC (permalink / raw)
  To: musl
  Cc: CLFS development discussion, CLFS Support, Thomas Petazzoni,
	Gregor Richards

On Tue, Oct 22, 2013 at 02:58:24PM -0400, Kevyn-Alexandre Paré wrote:
> Hi Andrew,
> 
> So far so good! Very interesting that you passed to musl and I'm happy
> to start playing with it!
> 
> Couple of question about Manual:
> You refer to glibc [1] should you replace that glibc with musl libc or
> glibc(musl) our simply libc?
> 
> For the musl installation [2], the make install have an error that
> seem to be fix with the next command you propose:
> 
> ../tools/install.sh -D -m 644 lib/crt1.o
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crt1.o
> ../tools/install.sh -D -m 644 lib/Scrt1.o
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/Scrt1.o
> ../tools/install.sh -D -m 644 lib/crti.o
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crti.o
> ../tools/install.sh -D -m 644 lib/crtn.o
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crtn.o
> ../tools/install.sh -D -m 644 lib/libc.a
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.a
> ../tools/install.sh -D -m 755 lib/libc.so
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.so
> ../tools/install.sh -D -m 644 lib/libm.a
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libm.a
> ../tools/install.sh -D -m 644 lib/librt.a
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/librt.a
> ../tools/install.sh -D -m 644 lib/libpthread.a
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libpthread.a
> ../tools/install.sh -D -m 644 lib/libcrypt.a
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libcrypt.a
> ../tools/install.sh -D -m 644 lib/libutil.a
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libutil.a
> ../tools/install.sh -D -m 644 lib/libxnet.a
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libxnet.a
> ../tools/install.sh -D -m 644 lib/libresolv.a
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libresolv.a
> ../tools/install.sh -D -m 644 lib/libdl.a
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libdl.a
> ../tools/install.sh -D -l
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.so
> /lib/ld-musl-arm.so.1 || true
> ln: failed to create symbolic link `/lib/ld-musl-arm.so.1.tmp.47054':
> Permission denied
> ../tools/install.sh -D -m 644 arch/arm/bits/alltypes.h
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/include/bits/alltypes.h

This (attempting to install the dynamic linker symlink in /lib) is
caused by specifying the installation location
/mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/ as part of the
prefix rather than as the DESTDIR at "make install" time. If this is
part of the installation into the new filesystem root that will be
later used as chroot or the root for booting, DESTDIR is the proper
approach. If this is just a temporary musl build for use in
bootstrapping, the current --prefix is fine, but you also need either
--syslibdir or --disable-shared.

Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [musl] Re: [Clfs-dev] CLFS embedded book switches to musl-libc
  2013-10-22 21:08   ` Rich Felker
@ 2013-10-23 11:07     ` Andrew Bradford
  2013-10-23 14:13       ` Rich Felker
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Bradford @ 2013-10-23 11:07 UTC (permalink / raw)
  To: musl
  Cc: Thomas Petazzoni, Gregor Richards, CLFS development discussion,
	CLFS Support

On 10/22/13 17:08, Rich Felker wrote:
> On Tue, Oct 22, 2013 at 02:58:24PM -0400, Kevyn-Alexandre Paré wrote:
>> For the musl installation [2], the make install have an error that
>> seem to be fix with the next command you propose:
>>
>> ../tools/install.sh -D -m 644 lib/crt1.o
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crt1.o
>> ../tools/install.sh -D -m 644 lib/Scrt1.o
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/Scrt1.o
>> ../tools/install.sh -D -m 644 lib/crti.o
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crti.o
>> ../tools/install.sh -D -m 644 lib/crtn.o
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crtn.o
>> ../tools/install.sh -D -m 644 lib/libc.a
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.a
>> ../tools/install.sh -D -m 755 lib/libc.so
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.so
>> ../tools/install.sh -D -m 644 lib/libm.a
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libm.a
>> ../tools/install.sh -D -m 644 lib/librt.a
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/librt.a
>> ../tools/install.sh -D -m 644 lib/libpthread.a
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libpthread.a
>> ../tools/install.sh -D -m 644 lib/libcrypt.a
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libcrypt.a
>> ../tools/install.sh -D -m 644 lib/libutil.a
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libutil.a
>> ../tools/install.sh -D -m 644 lib/libxnet.a
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libxnet.a
>> ../tools/install.sh -D -m 644 lib/libresolv.a
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libresolv.a
>> ../tools/install.sh -D -m 644 lib/libdl.a
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libdl.a
>> ../tools/install.sh -D -l
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.so
>> /lib/ld-musl-arm.so.1 || true
>> ln: failed to create symbolic link `/lib/ld-musl-arm.so.1.tmp.47054':
>> Permission denied
>> ../tools/install.sh -D -m 644 arch/arm/bits/alltypes.h
>> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/include/bits/alltypes.h
> 
> This (attempting to install the dynamic linker symlink in /lib) is
> caused by specifying the installation location
> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/ as part of the
> prefix rather than as the DESTDIR at "make install" time. If this is
> part of the installation into the new filesystem root that will be
> later used as chroot or the root for booting, DESTDIR is the proper
> approach. If this is just a temporary musl build for use in
> bootstrapping, the current --prefix is fine, but you also need either
> --syslibdir or --disable-shared.

Yes, I had run into this issue as well.  I had just missed that
permission denied failure in haste and thus my brute force symlink.

The goal is to build a cross toolchain which is stand alone but from
which the libs are copied into the actual target which will boot.  This
is roughly what buildroot does when using an external toolchain (I believe).

In this case, using --disable-shared does not seem reasonable as I'd
like to have shared libs.  I'll take a look at --syslibdir and DESTDIR
and see if they accomplish what I think I want.  The symlink from ld to
libc.so was my quick work around and produces a system which boots and
runs fine as far as I can tell but which now seems as though it may not
be the best method (besides my symlink command not covering all cases
for the archs used in the CLFS book or supported by musl).

Thanks,
Andrew
_______________________________________________
Clfs-support mailing list
Clfs-support@lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Re: [Clfs-dev] CLFS embedded book switches to musl-libc
  2013-10-23 11:07     ` [musl] " Andrew Bradford
@ 2013-10-23 14:13       ` Rich Felker
  0 siblings, 0 replies; 9+ messages in thread
From: Rich Felker @ 2013-10-23 14:13 UTC (permalink / raw)
  To: musl
  Cc: CLFS development discussion, CLFS Support, Thomas Petazzoni,
	Gregor Richards

On Wed, Oct 23, 2013 at 07:07:24AM -0400, Andrew Bradford wrote:
> On 10/22/13 17:08, Rich Felker wrote:
> > On Tue, Oct 22, 2013 at 02:58:24PM -0400, Kevyn-Alexandre Paré wrote:
> >> For the musl installation [2], the make install have an error that
> >> seem to be fix with the next command you propose:
> >>
> >> ../tools/install.sh -D -m 644 lib/crt1.o
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crt1.o
> >> ../tools/install.sh -D -m 644 lib/Scrt1.o
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/Scrt1.o
> >> ../tools/install.sh -D -m 644 lib/crti.o
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crti.o
> >> ../tools/install.sh -D -m 644 lib/crtn.o
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/crtn.o
> >> ../tools/install.sh -D -m 644 lib/libc.a
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.a
> >> ../tools/install.sh -D -m 755 lib/libc.so
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.so
> >> ../tools/install.sh -D -m 644 lib/libm.a
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libm.a
> >> ../tools/install.sh -D -m 644 lib/librt.a
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/librt.a
> >> ../tools/install.sh -D -m 644 lib/libpthread.a
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libpthread.a
> >> ../tools/install.sh -D -m 644 lib/libcrypt.a
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libcrypt.a
> >> ../tools/install.sh -D -m 644 lib/libutil.a
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libutil.a
> >> ../tools/install.sh -D -m 644 lib/libxnet.a
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libxnet.a
> >> ../tools/install.sh -D -m 644 lib/libresolv.a
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libresolv.a
> >> ../tools/install.sh -D -m 644 lib/libdl.a
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libdl.a
> >> ../tools/install.sh -D -l
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/lib/libc.so
> >> /lib/ld-musl-arm.so.1 || true
> >> ln: failed to create symbolic link `/lib/ld-musl-arm.so.1.tmp.47054':
> >> Permission denied
> >> ../tools/install.sh -D -m 644 arch/arm/bits/alltypes.h
> >> /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/include/bits/alltypes.h
> > 
> > This (attempting to install the dynamic linker symlink in /lib) is
> > caused by specifying the installation location
> > /mnt/clfs/cross-tools/armv7a-unknown-linux-musleabi/ as part of the
> > prefix rather than as the DESTDIR at "make install" time. If this is
> > part of the installation into the new filesystem root that will be
> > later used as chroot or the root for booting, DESTDIR is the proper
> > approach. If this is just a temporary musl build for use in
> > bootstrapping, the current --prefix is fine, but you also need either
> > --syslibdir or --disable-shared.
> 
> Yes, I had run into this issue as well.  I had just missed that
> permission denied failure in haste and thus my brute force symlink.

The failure is ignored during make install precisely because
successful installation of this symlink is not needed for development,
only for running dynamic-linked binaries on the host system (natively,
or with qemu app-level emulation, for example). If you're
cross-compiling, it's generally not needed, but it will be needed on
the final system you're running on, which means the DESTDIR approach
is probably the one you want.

> The goal is to build a cross toolchain which is stand alone but from
> which the libs are copied into the actual target which will boot.  This
> is roughly what buildroot does when using an external toolchain (I believe).
> 
> In this case, using --disable-shared does not seem reasonable as I'd
> like to have shared libs.  I'll take a look at --syslibdir and DESTDIR
> and see if they accomplish what I think I want.  The symlink from ld to
> libc.so was my quick work around and produces a system which boots and
> runs fine as far as I can tell but which now seems as though it may not
> be the best method (besides my symlink command not covering all cases
> for the archs used in the CLFS book or supported by musl).

I think DESTDIR is what you want conceptually, but it only matters for
your usage case if you'll be using the musl-gcc wrapper. If so, you
need to leave --syslibdir matching the location the dynamic linker
will be found at on the final target system (should be /lib), or
you'll end up with binaries whose PT_INTERP headers reference a
pathname from the system you built on which no longer exist at
runtime.

Hope this makes sense.

Rich


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-10-23 14:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-16 19:59 CLFS embedded book switches to musl-libc Andrew Bradford
2013-10-16 20:38 ` John Spencer
2013-10-16 20:46   ` Andrew Bradford
2013-10-16 21:22     ` John Spencer
2013-10-17 12:50       ` Andrew Bradford
2013-10-22 18:58 ` [Clfs-dev] " Kevyn-Alexandre Paré
2013-10-22 21:08   ` Rich Felker
2013-10-23 11:07     ` [musl] " Andrew Bradford
2013-10-23 14:13       ` Rich Felker

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).