[lfs-dev] static libs

Fernando de Oliveira famobr at yahoo.com.br
Sun Mar 8 22:12:45 PDT 2015

I was reporting in another thread created before, but this one is better

On 08-03-2015 23:26, Bruce Dubbs wrote:
> Ken Moffat wrote:
>> On Sat, Mar 07, 2015 at 11:21:03PM +0000, Ken Moffat wrote:
>>> I've just started a 32-bit qemu build.  For most of the packages
>>> where I noticed static libs, I'm adding --disable-static.  Not for
>>> flex or zlib.  For ncurses I'm adding --disable-normal : I suspect
>>> it one or two static ncurses libs might still remain).  And I will
>>> be installing all locales and running the tests, then looking at the
>>> logs and throwing it away ready for the second attempt.
>> Here are my preliminary findings (32-bit, in qemu):
>> 1. acl continues to give me /usr/lib/libacl.a, even with
>> --disable-static.

This, I solved.

>> 2. I have been manually removing (not just renaming)
>> /usr/lib/libbz2.a in my script in normal builds for some time (I
>> have a vague memory that I once botched the move of the .so to
>> .usr/lib (version upgrade, still had old lib version hardcoded) and
>> something tried to link to the static lib (but failed - something on
>> x86_64 trying to link a shared library).

This is bzip2? I'v done the same.

>> 3. I have been manually removing 4 static libs from e2fsprogs:
>> libcom_err.a, libe2p.a, libext2fs.a, libss.a in my normal builds.

Here, I did almost the same, but had a problem, so, two more libraies to
be removed.

>> 4. libtool with --disable-static still installs /usr/lib/libltdl.a.

Not there yet.

>> 5. ncurses with --disable-normal still installs
>> /usr/lib/libncurses++w.a

This, I could remove all *.a

>> 6. libfl.a from flex is used by automake's tests, libfl_pic.a is
>> also installed.

Not there yet.

>> 7. libz.a from zlib is used by binutils tests.

If I have to restart, will remove, and will know the reason for the test

>> I have not bothered to mention static libs from binutils, gcc, glibc.

The same.

>> The test results apart from eudev look unchanged


>> This is with --disable-static in: acl, eudev, expat, gdbm, gettext,
>> gmp, intltool, mpc, mpfr, procps-ng and --enable-shared
>> --disable-static in util-linux.

Will try to remember in util-linux.

> Attached is what I've come up with so far.  I didn't try to run tests,
> but it does remove everything except binutils (2), e2fsprogs(4), gcc(17)
> and glibc(17).


> In some cases, it might just be easier and more direct to just remove
> the files after install.  I was able to remove libncurses++w.a and
> libbz2.a bit I think acl and libtool worked OK, but I'll need to double
> check.

They all did, for me.

> For libltdl.a and libz.a we might want to remove those in 6.73. Cleaning
> Up.

Libz.a, I will reconsider in a second run, but libltdl.a, either I have
removed, or not yet arrived there.

I1ve quickly read you attachments, and some are what I did, but did no
extra sed's.

My first intention is to get a working system. After, being sure of
that, refine the necessary steps.

Now, some of my results.

Form bzip2 to coreutils, all static removed. Methods not so clean as
yours (Ken and Bruce). All available tests run and compared with
Bruce's. Including acl, after coreutils installed.

I've spent some time with e2fsprogs-1.42.1, because there is a problem
with my tools, and I had to build without
             --disable-libblkid      \
             --disable-libuuid       \
             --disable-uuidd         \

Seems there was a problem with ncurses in tools, so I got a message when
building util linux in tools:

 configure: error: ncurses or ncursesw selected, but library not found
(--without-ncurses to disable)

I will finish if I can this build of LFS, then restart again, if I
cannot fix the duplicated porgs and libs of e2fsprogs and util linux.

make install      &&
make install-libs &&

xz -v /usr/lib/{libcom_err,libe2p,libext2fs,libss,libblkid,libuuid}.a    &&
mv -v /usr/lib/{libcom_err,libe2p,libext2fs,libss,libblkid,libuuid}.a.xz \
      /usr/lib/famo-static-libs                         &&

gunzip -v /usr/share/info/libext2fs.info.gz             &&
install-info --dir-file=/usr/share/info/dir \
                        /usr/share/info/libext2fs.info  &&

makeinfo -o  doc/com_err.info ../lib/et/com_err.texinfo &&
install -v -m644 doc/com_err.info /usr/share/info       &&
install-info --dir-file=/usr/share/info/dir \

Spent about hals of todays's time with ncurses; installed by the book
plus commands to remove *.a, wide and non-wide:


INSTALLCOMMANDW="pushd ncursesw-build &&

                 time make DESTDIR= install &&

                 mv -v /usr/lib/libncursesw.so.5* /lib &&

                 ln -sfv ../../lib/libncursesw.so.5 \
INSTALLCOMMAND="pushd ncurses-build &&
                cp -av lib/lib*.so.5* /usr/lib &&
                popd" &&
post_installw () {
  pushd ncursesw-build &&
  install -vdm755 /usr/lib/famo-static-libs &&
  for lib in ncurses ncurses++ form panel menu ; do
      rm -vf                    /usr/lib/lib${lib}.so &&
      echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so &&
      ln -sfv lib${lib}w.a      /usr/lib/lib${lib}.a  &&
      ln -sfv ${lib}w.pc        /usr/lib/pkgconfig/${lib}.pc
  done; unset lib &&

  rm -vf                     /usr/lib/libcursesw.so &&
  echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so &&
  ln -sfv libncurses.so      /usr/lib/libcurses.so  &&
  ln -sfv libncursesw.a      /usr/lib/libcursesw.a  &&
  ln -sfv libncurses.a       /usr/lib/libcurses.a   &&

  for lib in ncurses ncurses++ form panel menu ; do
    xz -v /usr/lib/{lib${lib}w.a,lib${lib}.a} || true &&
    mv -v /usr/lib/{lib${lib}w.a.xz,lib${lib}.a} \
  done; unset lib &&
  mv -v /usr/lib/{libcursesw.a,libcurses.a} \
        /usr/lib/famo-static-libs &&

  mkdir -v -p          /usr/share/doc/${PACKAGE} &&
  cp    -v -R ../doc/* /usr/share/doc/${PACKAGE} &&
} &&

mkdir  ncurses{,w}-build &&


pushd ncursesw-build &&
      $CONFIGUREW &&
      time make -j${MKFLGS} &&
      popd &&

      pushd ncurses-build &&
      $CONFIGURE &&
      time make -j${MKFLGS} sources libs &&
popd &&



Only one failure in coreutils test: skip-duplicates.

Other packages tests, some better, some worse than Bruce's.

$ xzgrep -A9 summary coreutils-8.23-make-k-check-2015.03.09-00h30m01s.log.xz

Bruce: copied from

$ diff -Naur coreutils-8.23-Bruce-summary.log
--- coreutils-8.23-Bruce-summary.log	2015-03-09 01:22:38.320332087 -0300
+++ coreutils-8.23-Fernando-summary.log	2015-03-09 01:22:38.352332088 -0300
@@ -2,8 +2,8 @@
 Testsuite summary for GNU coreutils 8.23
 # TOTAL: 29
-# PASS:  17
-# SKIP:  12
+# PASS:  16
+# SKIP:  13
 # XFAIL: 0
 # FAIL:  0
 # XPASS: 0
@@ -13,11 +13,11 @@
 Testsuite summary for GNU coreutils 8.23
-# TOTAL: 306
-# PASS:  293
-# SKIP:  13
+# TOTAL: 564
+# PASS:  443
+# SKIP:  120
 # XFAIL: 0
-# FAIL:  0
+# FAIL:  1
 # XPASS: 0
 # ERROR: 0


More information about the lfs-dev mailing list