Remove non-essential static libraries from the installation. Added a new

section in Chapter 6 Introduction, supressed many static libraries in different
packages, and removed the remaining in the Cleaning Up section.



git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10880 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Bruce Dubbs 2015-03-15 23:29:31 +00:00
parent ecd016b289
commit 73b2841ee1
20 changed files with 160 additions and 60 deletions

View File

@ -36,6 +36,20 @@
</listitem> </listitem>
--> -->
<listitem>
<para>2015-03-15</para>
<itemizedlist>
<listitem>
<para>[bdubbs] - Remove non-essential static libraries
from the installation. Added a new section in Chapter 6
Introduction, suppressed many static libraries in different
packages, and removed the remaining in the Cleaning Up section.
Fixes
<ulink url="&lfs-ticket-root;3751">#3751</ulink>.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem> <listitem>
<para>2015-03-11</para> <para>2015-03-11</para>
<itemizedlist> <itemizedlist>

View File

@ -45,15 +45,12 @@
directory:</para> directory:</para>
<screen><userinput remap="pre">sed -i -e 's|/@pkg_name@|&amp;-@pkg_version@|' include/builddefs.in</userinput></screen> <screen><userinput remap="pre">sed -i -e 's|/@pkg_name@|&amp;-@pkg_version@|' include/builddefs.in</userinput></screen>
<!--
<para>Prevent installation of manual pages that were already installed by
Man-Pages package:</para>
<screen><userinput remap="pre">sed -i -e "/SUBDIRS/s|man2||" man/Makefile</userinput></screen>
-->
<para>Prepare Attr for compilation:</para> <para>Prepare Attr for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --bindir=/bin</userinput></screen> <screen><userinput remap="configure">./configure --prefix=/usr \
--bindir=/bin \
--disable-static</userinput></screen>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -40,17 +40,14 @@
<sect2 role="installation"> <sect2 role="installation">
<title>Installation of Bison</title> <title>Installation of Bison</title>
<para>Inhibit static library installation:</para>
<screen><userinput remap="pre">sed -i '/lib_LIBRARIES =/d' Makefile.in</userinput></screen>
<para>Prepare Bison for compilation:</para> <para>Prepare Bison for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --docdir=/usr/share/doc/bison-&bison-version;</userinput></screen> <screen><userinput remap="configure">./configure --prefix=/usr --docdir=/usr/share/doc/bison-&bison-version;</userinput></screen>
<!--
<para>The configure system causes Bison to be built without support for
internationalization of error messages if a <command>bison</command>
program is not already in $PATH. The following addition will correct
this:</para>
<screen><userinput remap="configure">echo '#define YYENABLE_NLS 1' &gt;&gt; lib/config.h</userinput></screen>
-->
<para>Compile the package:</para> <para>Compile the package:</para>
<screen><userinput remap="make">make</userinput></screen> <screen><userinput remap="make">make</userinput></screen>

View File

@ -62,6 +62,7 @@ BLKID_LIBS='-L/tools/lib -lblkid' \
--enable-keymap \ --enable-keymap \
--disable-introspection \ --disable-introspection \
--disable-gudev \ --disable-gudev \
--disable-static \
--disable-gtk-doc-html</userinput></screen> --disable-gtk-doc-html</userinput></screen>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -43,7 +43,7 @@
<para>Prepare Expat for compilation:</para> <para>Prepare Expat for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen> <screen><userinput remap="configure">./configure --prefix=/usr --disable-static</userinput></screen>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -47,7 +47,8 @@
<para>Prepare Flex for compilation:</para> <para>Prepare Flex for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --docdir=/usr/share/doc/flex-&flex-version;</userinput></screen> <screen><userinput remap="configure">./configure --prefix=/usr \
--docdir=/usr/share/doc/flex-&flex-version;</userinput></screen>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -46,7 +46,9 @@
<para>Prepare GDBM for compilation:</para> <para>Prepare GDBM for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --enable-libgdbm-compat</userinput></screen> <screen><userinput remap="configure">./configure --prefix=/usr \
--disable-static \
--enable-libgdbm-compat</userinput></screen>
<variablelist> <variablelist>
<title>The meaning of the configure option:</title> <title>The meaning of the configure option:</title>

View File

@ -45,7 +45,9 @@
<para>Prepare Gettext for compilation:</para> <para>Prepare Gettext for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --docdir=/usr/share/doc/gettext-&gettext-version;</userinput></screen> <screen><userinput remap="configure">./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/gettext-&gettext-version;</userinput></screen>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -54,6 +54,7 @@
<screen><userinput remap="configure">./configure --prefix=/usr \ <screen><userinput remap="configure">./configure --prefix=/usr \
--enable-cxx \ --enable-cxx \
--disable-static \
--docdir=/usr/share/doc/gmp-&gmp-version;</userinput></screen> --docdir=/usr/share/doc/gmp-&gmp-version;</userinput></screen>
<variablelist> <variablelist>

View File

@ -55,4 +55,29 @@
<note><para>The SBU values and required disk space includes <note><para>The SBU values and required disk space includes
test suite data for all applicable packages in Chapter 6.</para></note> test suite data for all applicable packages in Chapter 6.</para></note>
<sect2>
<title>About libraries</title>
<para>In general, the LFS editors discourage building and installing static
libraries. The original purpose for most static libraries has been made
obsolete in a modern Linux system. In addition linking a static library
into a program can be detrimental. If an update to the library is needed
to remove a security problem, all programs that use the static library will
need to be relinked to the new library. Since the use of static libraries
is not always obvious, deciding which programs (and the procedures needed to
do the linking) may not even be known.</para>
<para>In the prcedures in Chapter 6, we remove or disable installation of
most static libraries. In a few cases, especially glibc and gcc, the use
of static libraries remains essential to the general package building
process. Usually this is done by passing a
<option>--disable-static</option> option to <command>configure</command>.
In other cases, alternate means are needed.</para>
<para>For a more complete discussion of libraries, see the discussion
<ulink url="&blfs-root;/view/&short-version;/introduction/libraries.html">
Libraries: Static or shared?</ulink> in the BLFS book.</para>
</sect2>
</sect1> </sect1>

View File

@ -43,6 +43,10 @@
<sect2 role="installation"> <sect2 role="installation">
<title>Installation of Libcap</title> <title>Installation of Libcap</title>
<para>Prevent a static library from being installed:</para>
<screen><userinput remap="pre">sed -i '/install.*STALIBNAME/d' libcap/Makefile</userinput></screen>
<para>Compile the package:</para> <para>Compile the package:</para>
<screen><userinput remap="make">make</userinput></screen> <screen><userinput remap="make">make</userinput></screen>

View File

@ -44,7 +44,9 @@
<para>Prepare MPC for compilation:</para> <para>Prepare MPC for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --docdir=/usr/share/doc/mpc-&mpc-version;</userinput></screen> <screen><userinput remap="configure">./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/mpc-&mpc-version;</userinput></screen>
<para>Compile the package and generate the HTML documentation:</para> <para>Compile the package and generate the HTML documentation:</para>

View File

@ -49,6 +49,7 @@
<para>Prepare MPFR for compilation:</para> <para>Prepare MPFR for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \ <screen><userinput remap="configure">./configure --prefix=/usr \
--disable-static \
--enable-thread-safe \ --enable-thread-safe \
--docdir=/usr/share/doc/mpfr-&mpfr-version;</userinput></screen> --docdir=/usr/share/doc/mpfr-&mpfr-version;</userinput></screen>

View File

@ -41,15 +41,9 @@
<sect2 role="installation"> <sect2 role="installation">
<title>Installation of Ncurses</title> <title>Installation of Ncurses</title>
<!-- FIXME: Uncomment if using a dated ncurses release instead of a numbered <para>Don't install a static library that is not handled by configure:</para>
one.
<para>Since the release of Ncurses-&ncurses-version;, some bugs have been fixed <screen><userinput remap="pre">sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in</userinput></screen>
and features added. The most important news are .......
To get these fixes and features, apply the rollup patch:</para>
<screen><userinput>bzcat ../&ncurses-rollup-patch; | patch -Np1</userinput></screen>
-->
<para>Prepare Ncurses for compilation:</para> <para>Prepare Ncurses for compilation:</para>
@ -57,6 +51,7 @@
--mandir=/usr/share/man \ --mandir=/usr/share/man \
--with-shared \ --with-shared \
--without-debug \ --without-debug \
--without-normal \
--enable-pc-files \ --enable-pc-files \
--enable-widec</userinput></screen> --enable-widec</userinput></screen>
@ -85,6 +80,14 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><parameter>--without-normal</parameter></term>
<listitem>
<para>This switch disables building and installing most static libraries.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
<para>Compile the package:</para> <para>Compile the package:</para>
@ -119,11 +122,8 @@
<screen><userinput remap="install">for lib in ncurses form panel menu ; do <screen><userinput remap="install">for lib in ncurses form panel menu ; do
rm -vf /usr/lib/lib${lib}.so rm -vf /usr/lib/lib${lib}.so
echo "INPUT(-l${lib}w)" &gt; /usr/lib/lib${lib}.so echo "INPUT(-l${lib}w)" &gt; /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 ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc
done done</userinput></screen>
ln -sfv libncurses++w.a /usr/lib/libncurses++.a</userinput></screen>
<para>Finally, make sure that old applications that look for <para>Finally, make sure that old applications that look for
<filename class="libraryfile">-lcurses</filename> at build time are still <filename class="libraryfile">-lcurses</filename> at build time are still
@ -131,9 +131,7 @@ ln -sfv libncurses++w.a /usr/lib/libncurses++.a</userinput></screen>
<screen><userinput remap="install">rm -vf /usr/lib/libcursesw.so <screen><userinput remap="install">rm -vf /usr/lib/libcursesw.so
echo "INPUT(-lncursesw)" &gt; /usr/lib/libcursesw.so echo "INPUT(-lncursesw)" &gt; /usr/lib/libcursesw.so
ln -sfv libncurses.so /usr/lib/libcurses.so ln -sfv libncurses.so /usr/lib/libcurses.so</userinput></screen>
ln -sfv libncursesw.a /usr/lib/libcursesw.a
ln -sfv libncurses.a /usr/lib/libcurses.a</userinput></screen>
<para>If desired, install the Ncurses documentation:</para> <para>If desired, install the Ncurses documentation:</para>
@ -168,14 +166,31 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
<segtitle>Installed directories</segtitle> <segtitle>Installed directories</segtitle>
<seglistitem> <seglistitem>
<seg>captoinfo (link to tic), clear, infocmp, infotocap (link to tic), <seg>
ncursesw5-config, reset (link to tset), tabs, tic, toe, tput, and tset</seg> captoinfo (link to tic),
<seg>libcursesw.{a,so} (symlink and linker script to libncursesw.{a,so}), clear,
libformw.{a,so}, libmenuw.{a,so}, libncurses++w.a, libncursesw.{a,so}, infocmp,
libpanelw.{a,so}, and their non-wide-character counterparts without "w" infotocap (link to tic),
ncursesw5-config,
reset (link to tset),
tabs,
tic,
toe,
tput, and
tset
</seg>
<seg>
libcursesw.so (symlink and linker script to libncursesw.so),
libformw.so,
libmenuw.so,
libncursesw.so,
libpanelw.so, and their non-wide-character counterparts without "w"
in the library names.</seg> in the library names.</seg>
<seg>/usr/share/tabset, /usr/share/terminfo, and <seg>
/usr/share/doc/ncurses-&ncurses-version;</seg> /usr/share/tabset,
/usr/share/terminfo, and
/usr/share/doc/ncurses-&ncurses-version;
</seg>
</seglistitem> </seglistitem>
</segmentedlist> </segmentedlist>

View File

@ -56,7 +56,9 @@ sed -i '/{OLDSUFF}/c:' support/shlib-install</userinput></screen>
<para>Prepare Readline for compilation:</para> <para>Prepare Readline for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --docdir=/usr/share/doc/readline-&readline-version;</userinput></screen> <screen><userinput remap="configure">./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/readline-&readline-version;</userinput></screen>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -35,12 +35,22 @@
instructions for this (see <ulink url="&blfs-root;"/>).</para> instructions for this (see <ulink url="&blfs-root;"/>).</para>
</note> </note>
<screen role="nodump"><userinput>rm -rf /tools</userinput></screen>
<para>If the virtual kernel file systems have been unmounted, either manually <para>If the virtual kernel file systems have been unmounted, either manually
or through a reboot, ensure that the virtual kernel file systems are mounted or through a reboot, ensure that the virtual kernel file systems are mounted
when reentering the chroot. This process was explained in <xref when reentering the chroot. This process was explained in <xref
linkend="ch-system-bindmount"/> and <xref linkend="ch-system-bindmount"/> and <xref
linkend="ch-system-kernfsmount"/>.</para> linkend="ch-system-kernfsmount"/>.</para>
<para>Finally, thre were several static libraries that were not supressed earlier
in the chapter in order to satisfy the regression tests in several packages. These
libraries are from binutils, bzip2, e2fsprogs, flex, libtool, and zlib. If desired,
remove them now:</para>
<screen><userinput>rm /usr/lib/lib{bfd,opcodes}.a
rm /usr/lib/libbz2.a
rm /usr/lib/lib{com_err,e2p,ext2fs,ss}.a
rm /usr/lib/lib{fl,fl_pic}.a
rm /usr/lib/libltdl.a
rm /usr/lib/libz.a</userinput></screen>
</sect1> </sect1>

View File

@ -71,6 +71,7 @@
--disable-setpriv \ --disable-setpriv \
--disable-runuser \ --disable-runuser \
--disable-pylibmount \ --disable-pylibmount \
--disable-static \
--without-python \ --without-python \
--without-systemd \ --without-systemd \
--without-systemdsystemunitdir</userinput></screen> --without-systemdsystemunitdir</userinput></screen>

View File

@ -46,7 +46,10 @@
<para>Prepare Xz for compilation with:</para> <para>Prepare Xz for compilation with:</para>
<screen><userinput remap="configure">./configure --prefix=/usr --docdir=/usr/share/doc/xz-&xz-version;</userinput></screen> <screen><userinput remap="configure">
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/xz-&xz-version;</userinput></screen>
<para>Compile the package:</para> <para>Compile the package:</para>
@ -75,15 +78,37 @@ ln -svf ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so</userinput
<segtitle>Installed directories</segtitle> <segtitle>Installed directories</segtitle>
<seglistitem> <seglistitem>
<seg>lzcat (link to xz), lzcmp (link to xzdiff), lzdiff (link to <seg>
xzdiff), lzegrep (link to xzgrep), lzfgrep (link to xzgrep), lzcat (link to xz),
lzgrep (link to xzgrep), lzless (link to xzless), lzma (link to xz), lzcmp (link to xzdiff),
lzmadec, lzmainfo, lzmore (link to xzmore), lzdiff (link to xzdiff),
unlzma (link to xz), unxz, (link to xz), xz, xzcat (link to xz), lzegrep (link to xzgrep),
xzcmp (link to xzdiff), xzdec, xzdiff, xzegrep (link to xzgrep), lzfgrep (link to xzgrep),
xzfgrep (link to xzgrep), xzgrep, xzless, and xzmore</seg> lzgrep (link to xzgrep),
<seg>liblzma.{a,so}</seg> lzless (link to xzless),
<seg>/usr/include/lzma and /usr/share/doc/xz-&xz-version;</seg> lzma (link to xz),
lzmadec,
lzmainfo,
lzmore (link to xzmore),
unlzma (link to xz),
unxz (link to xz),
xz,
xzcat (link to xz),
xzcmp (link to xzdiff),
xzdec,
xzdiff,
xzegrep (link to xzgrep),
xzfgrep (link to xzgrep),
xzgrep,
xzless, and
xzmore</seg>
<seg>
liblzma.so
</seg>
<seg>
/usr/include/lzma and
/usr/share/doc/xz-&xz-version;
</seg>
</seglistitem> </seglistitem>
</segmentedlist> </segmentedlist>

View File

@ -1,7 +1,7 @@
<!ENTITY version "SVN-20150311"> <!ENTITY version "SVN-20150315">
<!ENTITY short-version "svn"> <!-- Used below in &blfs-book;. Change to x.y for release <!ENTITY short-version "svn"> <!-- Used below in &blfs-book;. Change to x.y for release
but not -rc releases --> but not -rc releases -->
<!ENTITY releasedate "March 11, 2015"> <!ENTITY releasedate "March 15, 2015">
<!ENTITY copyrightdate "1999-2015"><!-- jhalfs needs a literal dash, not &ndash; --> <!ENTITY copyrightdate "1999-2015"><!-- jhalfs needs a literal dash, not &ndash; -->
<!ENTITY milestone "7.8"> <!ENTITY milestone "7.8">
<!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" --> <!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" -->

View File

@ -16,8 +16,8 @@
<surname>Beekmans</surname> <surname>Beekmans</surname>
</author> </author>
<author> <author>
<firstname>Edited by Matthew Burgess</firstname> <firstname>Managing Editor is Bruce</firstname>
<surname>and Bruce Dubbs</surname> <surname>Dubbs</surname>
</author> </author>
</authorgroup> </authorgroup>