Index: chapter04/aboutlibtool.xml =================================================================== --- chapter04/aboutlibtool.xml (nonexistent) +++ chapter04/aboutlibtool.xml (working copy) @@ -0,0 +1,60 @@ + + + %general-entities; +]> + + + + + About Libtool Archives + + Many packages that use autoconf, + automake, and libtool, collectively + referred to as "autotools" (most packages that use a + configure script) will install libtool archives + in /usr/lib (*.la files). In addition + to the method provided by pkg-config, libtool archives + contain the flags needed by the linker when linking against an associated + library. While convenient, this unfortunately creates a permanent dependency + on the installed .la file. + + As build systems have evolved on Linux and other Unix like systems, the + need for libtool archives has been reduced to a few corner cases. Owing to + the lack of need for libtool archives, and the permanent dependence on these + files, they are now removed as part of the LFS/BLFS build process in order to + facilitate an easier upgrade path as packages gradually leave behind the + autotools build system for newer, more robust systems. + + Upgrading packages that had previously used libtool archives, requires + that you remove all references on the system to the removed files, and that + appropriate linker flags are added in place of the removed text for libtool + archives and pkg-config files that will remain on the system. This tends to + result in several .la and .pc files needing modification. For example, when + glib (see BLFS), migrated to the meson build system, the + new installation excluded five commonly used libtool archives. References to + these five .la files needed to be removed from all remaining .la and .pc files + on the system, resulting in edits to nearly 700 existing files. + + + For your convenience, a script is currently in development that is + intended to assist with this process, but be warned that it is very much + experimental. The script will make the necessary edits and place backup + copies in /usr/lib/libtool-backup. + Download the remove-lafile.sh script from + here. + + If you intend to use the script, make sure to do removals one + file at a time, and to review the edited files immediately. There are two + constants defined at the top of the script. BACKUP is the + location of the temporary backups of files that are replaced. + LIBDIRS is the search path for libtool archives. If you + install software into /opt, you + should add any additional lib directories to this list. After reviewing + the edited files, clean out the backup directory, and proceed to the next + file. + + + Index: chapter04/chapter04.xml =================================================================== --- chapter04/chapter04.xml (revision 11333) +++ chapter04/chapter04.xml (working copy) @@ -18,5 +18,6 @@ + Index: chapter06/acl.xml =================================================================== --- chapter06/acl.xml (revision 11333) +++ chapter06/acl.xml (working copy) @@ -95,6 +95,10 @@ mv -v /usr/lib/libacl.so.* /lib ln -sfv ../../lib/$(readlink /usr/lib/libacl.so) /usr/lib/libacl.so + Remove installed libtool archives: + +rm -vf /usr/lib/libacl.la + Index: chapter06/attr.xml =================================================================== --- chapter06/attr.xml (revision 11333) +++ chapter06/attr.xml (working copy) @@ -88,6 +88,10 @@ mv -v /usr/lib/libattr.so.* /lib ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) /usr/lib/libattr.so + Remove installed libtool archives: + +rm -vf /usr/lib/libattr.la + Index: chapter06/binutils.xml =================================================================== --- chapter06/binutils.xml (revision 11333) +++ chapter06/binutils.xml (working copy) @@ -149,6 +149,10 @@ make tooldir=/usr install + Remove installed libtool archives: + +rm -vf /usr/lib/lib{bfd,opcodes}.la + Index: chapter06/createfiles.xml =================================================================== --- chapter06/createfiles.xml (revision 11333) +++ chapter06/createfiles.xml (working copy) @@ -43,7 +43,6 @@ ln -sv /tools/bin/{install,perl} /usr/bin ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib ln -sv /tools/lib/libstdc++.{a,so{,.6}} /usr/lib -sed 's/tools/usr/' /tools/lib/libstdc++.la > /usr/lib/libstdc++.la ln -sv bash /bin/sh ln -sv /tools/bin/{bash,cat,dd,echo,ln,pwd,rm,stty} /bin @@ -50,11 +49,9 @@ ln -sv /tools/bin/{env,install,perl} /usr/bin ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib ln -sv /tools/lib/libstdc++.{a,so{,.6}} /usr/lib -sed 's/tools/usr/' /tools/lib/libstdc++.la > /usr/lib/libstdc++.la for lib in blkid lzma mount uuid do ln -sv /tools/lib/lib$lib.so* /usr/lib - sed 's/tools/usr/' /tools/lib/lib${lib}.la > /usr/lib/lib${lib}.la done ln -svf /tools/include/blkid /usr/include ln -svf /tools/include/libmount /usr/include @@ -166,7 +163,7 @@ - + - /usr/lib/lib{blkid,lzma,mount,uuid}.{a,la,so*} + /usr/lib/lib{blkid,lzma,mount,uuid}.so* These links prevent systemd utilities from acquiring an unnecessary reference to the Index: chapter06/dbus.xml =================================================================== --- chapter06/dbus.xml (revision 11333) +++ chapter06/dbus.xml (working copy) @@ -96,6 +96,10 @@ ln -sfv /etc/machine-id /var/lib/dbus + Remove installed libtool archives: + +rm -vf /usr/lib/libdbus-1.la + Index: chapter06/expat.xml =================================================================== --- chapter06/expat.xml (revision 11333) +++ chapter06/expat.xml (working copy) @@ -66,6 +66,10 @@ install -v -dm755 /usr/share/doc/expat-&expat-version; install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-&expat-version; + Remove installed libtool archives: + +rm -vf /usr/lib/libexpat.la + Index: chapter06/file.xml =================================================================== --- chapter06/file.xml (revision 11333) +++ chapter06/file.xml (working copy) @@ -57,6 +57,10 @@ make install + Remove installed libtool archives: + +rm -vf /usr/lib/libmagic.la + Index: chapter06/flex.xml =================================================================== --- chapter06/flex.xml (revision 11333) +++ chapter06/flex.xml (working copy) @@ -73,6 +73,10 @@ ln -sv flex /usr/bin/lex + Remove installed libtool archives: + +rm -vf /usr/lib/libfl.la + Index: chapter06/gcc.xml =================================================================== --- chapter06/gcc.xml (revision 11333) +++ chapter06/gcc.xml (working copy) @@ -306,6 +306,18 @@ mkdir -pv /usr/share/gdb/auto-load/usr/lib mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib + Remove installed libtool archives: + +LIBS="asan atomic cc1 cilkrts gomp itm lsan mpx mpxwrappers quadmath ssp" +LIBS="${LIBS} ssp_nonshared stdc++ stdc++fs supc++ tsan ubsan" + +for lib in `echo ${LIBS}`; do + rm -vf /usr/lib/lib${lib}.la +done + +rm -vf /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/plugin/libc{c,p}1plugin.la +rm -vf /usr/libexec/gcc/x86_64-pc-linux-gnu/7.2.0/liblto_plugin.la + Index: chapter06/gdbm.xml =================================================================== --- chapter06/gdbm.xml (revision 11333) +++ chapter06/gdbm.xml (working copy) @@ -75,6 +75,10 @@ make install + Remove installed libtool archives: + +rm -vf /usr/lib/libgdbm{,_compat}.la + Index: chapter06/gettext.xml =================================================================== --- chapter06/gettext.xml (revision 11333) +++ chapter06/gettext.xml (working copy) @@ -72,6 +72,12 @@ make install chmod -v 0755 /usr/lib/preloadable_libintl.so + Remove installed libtool archives: + +for lib in asprintf gettext{lib,po,src}; do + rm -vf /usr/lib/lib${lib}.la +done + Index: chapter06/gmp.xml =================================================================== --- chapter06/gmp.xml (revision 11333) +++ chapter06/gmp.xml (working copy) @@ -118,6 +118,10 @@ make install make install-html + Remove installed libtool archives: + +rm -vf /usr/lib/libgmp{,xx}.la + Index: chapter06/kmod.xml =================================================================== --- chapter06/kmod.xml (revision 11333) +++ chapter06/kmod.xml (working copy) @@ -95,6 +95,10 @@ ln -sfv kmod /bin/lsmod + Remove installed libtool archives: + +rm -vf /usr/lib/libkmod.la + Index: chapter06/libffi.xml =================================================================== --- chapter06/libffi.xml (revision 11333) +++ chapter06/libffi.xml (working copy) @@ -69,6 +69,10 @@ make install + Remove installed libtool archives: + +rm -vf /usr/lib/libffi.la + Index: chapter06/libpipeline.xml =================================================================== --- chapter06/libpipeline.xml (revision 11333) +++ chapter06/libpipeline.xml (working copy) @@ -70,6 +70,10 @@ make install + Remove installed libtool archives: + +rm -vf /usr/lib/libpipeline.la + Index: chapter06/libtool.xml =================================================================== --- chapter06/libtool.xml (revision 11333) +++ chapter06/libtool.xml (working copy) @@ -68,6 +68,10 @@ make install + Remove installed libtool archives: + +rm -vf /usr/lib/libltdl.la + Index: chapter06/man-db.xml =================================================================== --- chapter06/man-db.xml (revision 11333) +++ chapter06/man-db.xml (working copy) @@ -114,6 +114,10 @@ sed -i "s:man man:root root:g" /usr/lib/tmpfiles.d/man-db.conf + Remove installed libtool archives: + +rm -vf /usr/lib/man-db/libman{,db}.la + Index: chapter06/mpc.xml =================================================================== --- chapter06/mpc.xml (revision 11333) +++ chapter06/mpc.xml (working copy) @@ -62,6 +62,10 @@ make install make install-html + Remove installed libtool archives: + +rm -vf /usr/lib/libmpc.la + Index: chapter06/mpfr.xml =================================================================== --- chapter06/mpfr.xml (revision 11333) +++ chapter06/mpfr.xml (working copy) @@ -67,6 +67,10 @@ make install make install-html + Remove installed libtool archives: + +rm -vf /usr/lib/libmpfr.la + Index: chapter06/pkgmgt.xml =================================================================== --- chapter06/pkgmgt.xml (revision 11333) +++ chapter06/pkgmgt.xml (working copy) @@ -51,22 +51,37 @@ - If Glibc needs to be upgraded to a newer version, (e.g. from - glibc-2.19 to glibc-2.20, it is safer to rebuild LFS. Though you - may be able to rebuild all the packages in their - dependency order, we do not recommend it. + Always take a backup of the system before upgrading any package. + This is especially important for the toolchain packages (Binutils, + GCC, Glibc, GMP, MPC, and MPFR) as most of the system is dependent on + libraries provided by these pacakges, and errors in these packages + can make an online repair or recovery nearly impossible. + If Glibc needs to be upgraded to a newer version (e.g. from + glibc-2.25 to glibc-2.26), this is also the only time that it is + appropriate to upgrade the kernel API headers. Skipping minor versions + of Glibc is not recommended, and you need to be sure that the newest + version remains ABIs compatible (not API compatible) with the already + installed version. For example, you should use the + --enable-obsolete-rpc flag for Glibc's configure + script if you have applications that still depend on the old RPC + implementation. + + + If a package containing a shared library is updated, and if the - name of the library changes, then all the packages dynamically linked - to the library need to be recompiled to link against the newer library. - (Note that there is no correlation between the package version and the - name of the library.) For example, consider a package foo-1.2.3 that + ABI, or "soversion" of the library changes, then all the packages + dynamically linked to the library need to be recompiled to link against + the newer library. (Note that there is no correlation between a package + version string and the soversion of the library.) + + For example, consider a package foo-1.2.3 that installs a shared library with name - libfoo.so.1. Say you upgrade - the package to a newer version foo-1.2.4 that installs a shared library - with name libfoo.so.2. In this + libfoo.so.1. You then upgrade + foo to version 1.2.4, which installs a shared library with a name of + libfoo.so.2. In this case, all packages that are dynamically linked to libfoo.so.1 need to be recompiled to link against @@ -74,6 +89,7 @@ should not remove the previous libraries until the dependent packages are recompiled. + Index: chapter06/procps.xml =================================================================== --- chapter06/procps.xml (revision 11333) +++ chapter06/procps.xml (working copy) @@ -96,6 +96,10 @@ mv -v /usr/lib/libprocps.so.* /lib ln -sfv ../../lib/$(readlink /usr/lib/libprocps.so) /usr/lib/libprocps.so + Remove installed libtool archives: + +rm -vf /usr/lib/libprocps.la + Index: chapter06/texinfo.xml =================================================================== --- chapter06/texinfo.xml (revision 11333) +++ chapter06/texinfo.xml (working copy) @@ -79,6 +79,10 @@ make TEXMF=/usr/share/texmf install-tex + Remove installed libtool archives: + +rm -vf /usr/lib/texinfo/{MiscXS,XSParagraph}.la + The meaning of the make parameter: Index: chapter06/util-linux.xml =================================================================== --- chapter06/util-linux.xml (revision 11333) +++ chapter06/util-linux.xml (working copy) @@ -123,6 +123,10 @@ make install + Remove installed libtool archives: + +rm -vf /usr/lib/lib{blkid,fdisk,mount,smartcols,uuid}.la + Index: chapter06/xz.xml =================================================================== --- chapter06/xz.xml (revision 11333) +++ chapter06/xz.xml (working copy) @@ -66,6 +66,10 @@ mv -v /usr/lib/liblzma.so.* /lib ln -svf ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so + Remove installed libtool archives: + +rm -vf /usr/lib/liblzma.la + Index: general.ent =================================================================== --- general.ent (revision 11333) +++ general.ent (working copy) @@ -54,3 +54,5 @@ %patches-entities; + +