source: chapter06/zlib.xml@ 11e9988

6.0
Last change on this file since 11e9988 was 2256873, checked in by Gerard Beekmans <gerard@…>, 20 years ago

Last edit round.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/testing/BOOK@4265 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 3.9 KB
RevLine 
[673b0d8]1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
[752f4e5]6<sect1 id="ch-system-zlib" role="wrap">
[673b0d8]7<title>Zlib-&zlib-version;</title>
8<?dbhtml filename="zlib.html"?>
[24380c7]9
[673b0d8]10<indexterm zone="ch-system-zlib"><primary sortas="a-Zlib">Zlib</primary></indexterm>
11
[a001133]12<sect2 role="package"><title/>
[673b0d8]13<para>The Zlib package contains compression and un-compression routines used by
[5888299]14some programs.</para>
15
[a001133]16<segmentedlist>
17<segtitle>&buildtime;</segtitle>
18<segtitle>&diskspace;</segtitle>
19<seglistitem><seg>0.1 SBU</seg><seg>1.5 MB</seg></seglistitem>
20</segmentedlist>
[673b0d8]21
[a001133]22<segmentedlist>
23<segtitle>Zlib installation depends on</segtitle>
[69993f4]24<seglistitem><seg>Binutils, Coreutils, GCC, Glibc, Make, and Sed</seg></seglistitem>
[a001133]25</segmentedlist>
26</sect2>
[24380c7]27
[a001133]28<sect2 role="installation">
[73aedd1d]29<title>Installation of Zlib</title>
30
[343c80b]31<para>The following patch fixes a Denial of Service vulnerability in
32the Zlib compression library:</para>
[f54c6c0]33
34<screen><userinput>patch -Np1 -i ../zlib-&zlib-version;-security-1.patch</userinput></screen>
35
[ef13657]36<note><para>Zlib is known to build its shared library incorrectly if
[752f4e5]37<envar>CFLAGS</envar> is specified in the environment. If using a
38specified <envar>CFLAGS</envar>
[ef13657]39variable, be sure to add the <parameter>-fPIC</parameter> directive to
[752f4e5]40the <envar>CFLAGS</envar> variable for the duration of the
[ef13657]41configure command below, then remove it afterwards.</para></note>
[73aedd1d]42
[4248b0e]43<para>Prepare Zlib for compilation:</para>
44
45<screen><userinput>./configure --prefix=/usr --shared</userinput></screen>
46
[73aedd1d]47<para>Compile the package:</para>
48
49<screen><userinput>make</userinput></screen>
50
[673b0d8]51<para>To test the results, issue:
[8a5f906]52<userinput>make check</userinput>.</para>
[dfddb12]53
54<para>Install the shared library:</para>
[73aedd1d]55
56<screen><userinput>make install</userinput></screen>
57
[2256873]58<beginpage/>
59
[ef13657]60<para>Build the static library:</para>
[8ad7980]61
[73aedd1d]62<screen><userinput>make clean
63./configure --prefix=/usr
64make</userinput></screen>
65
[ef13657]66<para>To test the results again, issue:
[8a5f906]67<userinput>make check</userinput>.</para>
[73aedd1d]68
[84e4cae]69<para>Install the static library:</para>
[73aedd1d]70
71<screen><userinput>make install</userinput></screen>
72
[ef13657]73<para>Fix the permissions on the static library:</para>
[84e4cae]74
75<screen><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
76
[ef13657]77<para>It is good policy and common practice to place important
78libraries into the <filename class="directory">/lib</filename>
79directory. This is most important in scenarios where <filename
80class="directory">/usr</filename> is on a separate partition.
81Essentially, the run-time components of any libraries that are used by
82programs in <filename class="directory">/bin</filename> or <filename
83class="directory">/sbin</filename> should reside in <filename
84class="directory">/lib</filename> so that they are on the root
85partition and available in the event of <filename
86class="directory">/usr</filename> being inaccessible.</para>
87
88<para>For the above reason, move the run-time components of the shared Zlib
[db9d773c]89into <filename class="directory">/lib</filename>:</para>
[73aedd1d]90
91<screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
92
[69993f4]93<para>Fix the <filename class="symlink">/usr/lib/libz.so</filename>
94symlink:</para>
[73aedd1d]95
96<screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
97
98</sect2>
[24380c7]99
[5888299]100
[c6cb3aa]101<sect2 id="contents-zlib" role="content"><title>Contents of Zlib</title>
[673b0d8]102
[c6cb3aa]103<segmentedlist>
104<segtitle>Installed libraries</segtitle>
105<seglistitem><seg>libz[a,so]</seg></seglistitem>
106</segmentedlist>
[24380c7]107
[2256873]108<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
[3ed279f]109<?dbfo list-presentation="list"?>
[673b0d8]110
[b8a819f]111<varlistentry id="libz">
[2256873]112<term><filename class="libraryfile">libz</filename></term>
[c6cb3aa]113<listitem>
[2256873]114<para>Contains compression and un-compression
115functions used by some programs</para>
116<indexterm zone="ch-system-zlib libz"><primary sortas="c-libz">libz</primary></indexterm>
[c6cb3aa]117</listitem>
118</varlistentry>
119</variablelist>
[673b0d8]120
121</sect2>
122
123</sect1>
[ef13657]124
Note: See TracBrowser for help on using the repository browser.