uclibc

Chris Buxton cbuxton at menandmice.com
Sat Jan 19 07:42:46 PST 2008


I got the butterfly toolchain to build. Here's what I did:

- I installed all of gettext back in chapter 5.

- I used Robert's symlink suggestion to symlink libssp and libintl into both /lib and /usr/lib. (I wasn't sure what was needed, so I symlinked everything in /tools/lib that started with either of those strings into both targets. I can clean it up later with find.)

- I used Gregory's suggestion to remove the duplicate libraries in the building of libstdc++.

These three things together allowed the butterfly toolchain to build successfully. Although 'make test' turned up lots of "unexpected failures", the book warns of this. The manual tests further down the page all executed perfectly, although there are a few errors in the text of what to expect (wrong executable names).

Chris Buxton
Professional Services
Men & Mice
Address: Noatun 17, IS-105, Reykjavik, Iceland
Phone:   +354 412 1500
Email:   cbuxton at menandmice.com
www.menandmice.com
 
Men & Mice
We bring control and flexibility to network management
 
This e-mail and its attachments may contain confidential and privileged information only intended for the person or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any retention, dissemination, distribution or copy of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify us immediately by reply e-mail and immediately delete this message and all its attachment.

----- Original Message -----
From: "Chris Buxton" <cbuxton at menandmice.com>
To: "Hardened LFS Development List" <hlfs-dev at linuxfromscratch.org>
Sent: Friday, January 18, 2008 11:23:38 PM (GMT-0800) America/Los_Angeles
Subject: Re: uclibc

OK, I think I figured it out. Rather than going into the gettext source tree's tools directory in chapter 5 and building a small portion of the package, I simply built and installed the entire gettext package. During the install, the following was sent to stderr:

libtool: install: warning: relinking `libgettextlib.la'
libtool: install: warning: relinking `libgettextsrc.la'
libtool: install: warning: relinking `libgettextpo.la'

And now ldd shows that /tools/bin/msgfmt, which is now a binary rather than some kind of wrapper, is no longer dependent on the host's libc:

$ ldd /tools/bin/msgfmt 
        libgettextsrc-0.16.1.so => /tools/lib/libgettextsrc-0.16.1.so (0xb7ecd000)
        libgettextlib-0.16.1.so => /tools/lib/libgettextlib-0.16.1.so (0xb7eae000)
        libintl.so.8 => /tools/lib/libintl.so.8 (0xb7ea3000)
        libc.so.0 => /tools/lib/libc.so.0 (0xb7e11000)
        libssp.so.0 => /tools/lib/libssp.so.0 (0xb7e0d000)
        ld-uClibc.so.0 => /tools/lib/ld-uClibc.so.0 (0xb7f05000)

I'm thinking that, in chapter 6, I'll rebuild all of gettext again before building the butterfly toolchain, instead of just libintl. If necessary, I can rebuild it a third time afterward.

Chris Buxton
Professional Services
Men & Mice
Address: Noatun 17, IS-105, Reykjavik, Iceland
Phone:   +354 412 1500
Email:   cbuxton at menandmice.com
www.menandmice.com
 
Men & Mice
We bring control and flexibility to network management
 
This e-mail and its attachments may contain confidential and privileged information only intended for the person or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any retention, dissemination, distribution or copy of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify us immediately by reply e-mail and immediately delete this message and all its attachment.

----- Original Message -----
From: "Robert Connolly" <robert at linuxfromscratch.org>
To: "Hardened LFS Development List" <hlfs-dev at linuxfromscratch.org>
Sent: Thursday, January 17, 2008 5:18:11 PM (GMT-0800) America/Los_Angeles
Subject: Re: uclibc

Please retry installing Gettext (msgfmt) in chapter5 with --disable-shared.

robert

On Thursday January 17 2008 07:46:55 pm Chris Buxton wrote:
> OK, now we're really in the mire. As a reminder for anyone following along,
> I'm working on the 20080108 snapshot of the uClibc/kernel 2.6 book, and I'm
> using package users (not that that should matter for this).
>
> Compiling libstdc++ in the butterfly toolchain apparently requires msgfmt,
> from gettext. But msgfmt as installed is broken; it depends on two missing
> libraries, also from the gettext package:
>
> libgettextsrc-0.16.1.so
> libgettextlib-0.16.1.so
>
> So I went back and rebuilt gettext (the chapter 5 build) and copied those
> two libraries into /tools/lib. Then I ran ldd against the tool that was
> complaining at the end of my butterfly build:
>
> # ldd /tools/bin/.libs/lt-msgfmt
>         libgettextsrc-0.16.1.so => /tools/lib/libgettextsrc-0.16.1.so
> (0xb7f69000) libgettextlib-0.16.1.so => /tools/lib/libgettextlib-0.16.1.so
> (0xb7f4e000) libintl.so.8 => /tools/lib/libintl.so.8 (0xb7f43000)
>         libc.so.0 => /tools/lib/libc.so.0 (0xb7eb1000)
>         libssp.so.0 => /tools/lib/libssp.so.0 (0xb7ead000)
>         libc.so.6 => not found
>         libc.so.6 => not found
>         ld-uClibc.so.0 => /tools/lib/ld-uClibc.so.0 (0xb7f9c000)
>
> It's looking for glibc (libc.so.6). What's happened here? Should these have
> been linked statically against the host's glibc? If so, how do I do that?
> I'll keep working on it, but if anyone has any tips for me, I'd appreciate
> it.
>
> For the record, here is the end of my latest build attempt:
>
> Making all in po
> make[4]: Entering directory
> `/usr/src/butterfly/butterfly-build/i686-pc-linux-uclibc/libstdc++-v3/po'
> msgfmt -o de.mo ../../../../butterfly-toolchain/libstdc++-v3/po/de.po
> /tools/bin/.libs/lt-msgfmt: can't load library 'libgettextsrc-0.16.1.so'
> make[4make[4]: Leaving directory
> `/usr/src/butterfly/butterfly-build/i686-pc-linux-uclibc/libstdc++-v3/po'
> ]: *** [de.mo] Error 16
> make[3]: Leaving directory
> `/usr/src/butterfly/butterfly-build/i686-pc-linux-uclibc/libstdc++-v3'
> make[3]: *** [all-recursive] Error 1
> make[2]: *** [all] Error 2
> make[2]: Leaving directory
> `/usr/src/butterfly/butterfly-build/i686-pc-linux-uclibc/libstdc++-v3'
> make[1]: Leaving directory `/usr/src/butterfly/butterfly-build'
> make[1]: *** [all-target-libstdc++-v3] Error 2
> make: *** [all] Error 2
>
> Chris Buxton
> Professional Services
> Men & Mice
> Address: Noatun 17, IS-105, Reykjavik, Iceland
> Phone:   +354 412 1500
> Email:   cbuxton at menandmice.com
> www.menandmice.com
>
> Men & Mice
> We bring control and flexibility to network management
>
> This e-mail and its attachments may contain confidential and privileged
> information only intended for the person or entity to which it is
> addressed. If the reader of this message is not the intended recipient, you
> are hereby notified that any retention, dissemination, distribution or copy
> of this e-mail is strictly prohibited. If you have received this e-mail in
> error, please notify us immediately by reply e-mail and immediately delete
> this message and all its attachment.
>
> ----- Original Message -----
> From: "Chris Buxton" <cbuxton at menandmice.com>
> To: "Hardened LFS Development List" <hlfs-dev at linuxfromscratch.org>
> Sent: Thursday, January 17, 2008 2:09:59 PM (GMT-0800) America/Los_Angeles
> Subject: Re: uclibc
>
> Hello Gregory,
>
> Thanks for the tip. That seems to have gotten me past that linking error
> and on to the next error in the building of libstdc++-v3. :\
>
> I'll post information about that once any easy problems are answered (like
> the missing /bin/sed - a symlink should solve that).
>
> Chris Buxton
> Professional Services
> Men & Mice
> Address: Noatun 17, IS-105, Reykjavik, Iceland
> Phone:   +354 412 1500
> Email:   cbuxton at menandmice.com
> www.menandmice.com
>
> Men & Mice
> We bring control and flexibility to network management
>
> This e-mail and its attachments may contain confidential and privileged
> information only intended for the person or entity to which it is
> addressed. If the reader of this message is not the intended recipient, you
> are hereby notified that any retention, dissemination, distribution or copy
> of this e-mail is strictly prohibited. If you have received this e-mail in
> error, please notify us immediately by reply e-mail and immediately delete
> this message and all its attachment.
>
> ----- Original Message -----
> From: "Gregory Fleischer (Lists)" <gfleischer.lists at gmail.com>
> To: "Hardened LFS Development List" <hlfs-dev at linuxfromscratch.org>
> Sent: Wednesday, January 16, 2008 9:09:43 PM (GMT-0800) America/Los_Angeles
> Subject: Re: uclibc
>
> On Jan 16, 2008, at 9:05 AM, Chris Buxton wrote:
> > Here is the command that apparently failed (it's a long one):
> >
> >  /usr/src/butterfly/butterfly-build/./gcc/xgcc -shared-libgcc -B/
> > usr/src/butterfly/butterfly-build/./gcc -nostdinc++ -L/usr/src/
> > butterfly/butterfly-build/i686-pc-linux-uclibc/libstdc++-v3/src -L/
> > usr/src/butterfly/butterfly-build/i686-pc-linux-uclibc/libstdc++-v3/
> > src/.libs -B/usr/i686-pc-linux-uclibc/bin/ -B/usr/i686-pc-linux-
> > uclibc/lib/ -isystem /usr/i686-pc-linux-uclibc/include -isystem /
> > usr/i686-pc-linux-uclibc/sys-include -L/usr/src/butterfly/butterfly-
> > build/./ld -shared -nostdlib /usr/lib/gcc/../crti.o /usr/src/
> > butterfly/butterfly-build/./gcc/crtbeginS.o  .libs/
> > bitmap_allocator.o .libs/pool_allocator.o .libs/
> > mt_allocator.o .libs/codecvt.o .libs/compatibility.o .libs/
> > complex_io.o .libs/ctype.o .libs/debug.o .libs/debug_list.o .libs/
> > functexcept.o .libs/globals_locale.o .libs/globals_io.o .libs/
> > ios.o .libs/ios_failure.o .libs/ios_init.o .libs/ios_locale.o .libs/
> > limits.o .libs/list.o .libs/locale.o .libs/locale_init.o .libs/
> > locale_facets.o .libs/localename.o .libs/stdexcept.o
> >   .libs/strstream.o .libs/tree.o .libs/allocator-inst.o .libs/
> > concept-inst.o .libs/fstream-inst.o .libs/ext-inst.o .libs/ios-
> > inst.o .libs/iostream-inst.o .libs/istream-inst.o .libs/
> > istream.o .libs/locale-inst.o .libs/locale-misc-inst.o .libs/misc-
> > inst.o .libs/ostream-inst.o .libs/sstream-inst.o .libs/streambuf-
> > inst.o .libs/streambuf.o .libs/string-inst.o .libs/valarray-
> > inst.o .libs/wlocale-inst.o .libs/wstring-inst.o .libs/
> > atomicity.o .libs/codecvt_members.o .libs/collate_members.o .libs/
> > ctype_members.o .libs/messages_members.o .libs/
> > monetary_members.o .libs/numeric_members.o .libs/
> > time_members.o .libs/basic_file.o .libs/c++locale.o -Wl,--whole-
> > archive ../libmath/.libs/libmath.a ../libsupc++/.libs/libsupc+
> > +convenience.a /usr/lib/libssp_nonshared.a /usr/lib/
> > libssp_nonshared.a /usr/lib/libssp_nonshared.a -Wl,--no-whole-
> > archive  -L/usr/src/butterfly/butterfly-build/i686-pc-linux-uclibc/
> > libstdc++-v3/src -L/usr/src/butterfly/butterfly-build/i686-pc-linux-
> > uclibc/libstdc++-v3/src/.l
> >  ibs -L/usr/src/butterfly/butterfly-build/./ld -lm ../libmath/.libs/
> > libmath.a -lm ../libsupc++/.libs/libsupc++convenience.a -lm -L/usr/
> > src/butterfly/butterfly-build/./gcc -L/usr/lib/gcc/.. -lgcc_s -lc -
> > lc -lgcc_s -lm /usr/lib/libssp_nonshared.a /usr/lib/libssp.so -
> > lgcc_s /lib/libintl.so -lc -lgcc_s   /usr/src/butterfly/butterfly-
> > build/./gcc/crtendS.o /usr/lib/gcc/../crtn.o  -Wl,-O1 -Wl,-z -
> > Wl,relro -Wl,--version-script=libstdc++-symbol.ver -Wl,-soname -
> > Wl,libstdc++.so.6 -o .libs/libstdc++.so.6.0.8
> >
> > And here are the error messages after that:
> >
> > /usr/lib/libssp_nonshared.a(libssp_nonshared_la-ssp-local.o): In
> > function `__stack_chk_fail_local':
> > ../ssp-local.c:48: multiple definition of `__stack_chk_fail_local'
> > /usr/lib/libssp_nonshared.a(libssp_nonshared_la-ssp-local.o):../ssp-
> > local.c:48: first defined here
> > /usr/lib/libssp_nonshared.a(libssp_nonshared_la-ssp-local.o): In
> > function `__stack_chk_fail_local':
> > ../ssp-local.c:48: multiple definition of `__stack_chk_fail_local'
> > /usr/lib/libssp_nonshared.a(libssp_nonshared_la-ssp-local.o):../ssp-
> > local.c:48: first defined here
> > collect2: ld returned 1 exit status
> > make[4]: Leaving directory `/usr/src/butterfly/butterfly-build/i686-
> > pc-linux-uclibc/libstdc++-v3/src'
> > make[4]: *** [libstdc++.la] Error 1
> > make[3]: *** [all-recursive] Error 1
> > make[3]: Leaving directory `/usr/src/butterfly/butterfly-build/i686-
> > pc-linux-uclibc/libstdc++-v3'
> > make[2]: *** [all] Error 2
> > make[2]: Leaving directory `/usr/src/butterfly/butterfly-build/i686-
> > pc-linux-uclibc/libstdc++-v3'
> > make[1]: Leaving directory `/usr/src/butterfly/butterfly-build'
>
> I've seen this error before, and it was related to the fact that
> libssp_nonshared.a is being included multiple when being linked into
> libstdc++.so.  If one examines the command carefully,
> libssp_nonshared.a is listed multiple times as arguments following "-
> Wl,--whole-archive".
>
> When I encountered it, I eventually determined that there was a
> problem with the dependency detection in ltcf-cxx.sh for libstdc++-
> v3.  I was able to workaround this issue by running the following
> commands against the source to "fix" the problem:
>
>       echo 'postdeps="${postdeps//-lssp_nonshared}"' >> ltcf-cxx.sh
>       echo 'postdeps="${postdeps//-lssp}"' >> ltcf-cxx.sh
>       sed -i.orig -e 's@\$(LIBS)@& -lssp_nonshared -lssp@' \
>           ./libstdc++-v3/src/Makefile.in
>
> Hope that helps.
>
> --
> http://linuxfromscratch.org/mailman/listinfo/hlfs-dev
> FAQ: http://www.linuxfromscratch.org/faq/
> Unsubscribe: See the above information page
>
> --
> http://linuxfromscratch.org/mailman/listinfo/hlfs-dev
> FAQ: http://www.linuxfromscratch.org/faq/
> Unsubscribe: See the above information page



-- 
http://linuxfromscratch.org/mailman/listinfo/hlfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page




More information about the hlfs-dev mailing list