Changeset 37e35d2


Ignore:
Timestamp:
06/29/2020 07:55:01 AM (16 months ago)
Author:
Thomas Trepl <thomas@…>
Branches:
multilib-10.1
Children:
c4804e8
Parents:
d4fdde6
Message:

Update to new lfs structure

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

Files:
30 added
32 deleted
58 edited
94 moved

Legend:

Unmodified
Added
Removed
  • Makefile

    rd4fdde6 r37e35d2  
    2727  PDF_OUTPUT      ?= LFS-BOOK.pdf
    2828  NOCHUNKS_OUTPUT ?= LFS-BOOK.html
    29   DUMPDIR         ?= ~/lfs-commands
     29  DUMPDIR         ?= ~/cross-lfs-commands
    3030else
    3131  BASEDIR         ?= ~/lfs-systemd
     
    6060        $(Q)mkdir -p $(BASEDIR)/stylesheets
    6161        $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
    62         $(Q)pushd $(BASEDIR)/ > /dev/null;                     \
    63 #       sed -i -e "s@../stylesheets@stylesheets@g" *.html; \
    64        popd > /dev/null
    6562
    6663        $(Q)mkdir -p $(BASEDIR)/images
     
    176173#       $(Q)xsltproc --nonet --xinclude                    \
    177174#                --stringparam profile.revision $(REV) \
    178 #                --stringparam profile.arch $(ARCH)    \
    179175#                --output $(RENDERTMP)/sysd-wget.xml   \
    180176#                stylesheets/lfs-xsl/profile.xsl       \
     
    194190        $(Q)xsltproc --nonet --xinclude                    \
    195191                --stringparam profile.revision $(REV) \
    196                 --stringparam profile.arch $(ARCH) \
     192                --stringparam profile.arch $(ARCH)    \
    197193                --output $(RENDERTMP)/sysv-md5sum.xml \
    198194                stylesheets/lfs-xsl/profile.xsl       \
     
    212208#      --output $(RENDERTMP)/lfs-html.xml    \
    213209#      --stringparam profile.revision $(REV) \
    214 #      --stringparam profile.arch $(ARCH)    \
    215210#      stylesheets/lfs-xsl/profile.xsl       \
    216211#      $(RENDERTMP)/lfs-full.xml
  • appendices/dependencies.xml

    rd4fdde6 r37e35d2  
    829829      </segmentedlist>
    830830
    831 <!-- Begin Gcc dependency info -->
    832   <bridgehead renderas="sect2" id="gcc-dep">Gcc</bridgehead>
     831<!-- Begin GCC dependency info -->
     832  <bridgehead renderas="sect2" id="gcc-dep">GCC</bridgehead>
    833833
    834834      <segmentedlist>
     
    13041304
    13051305        <seglistitem>
    1306          <seg>Bash, Bison, Coreutils, Flex, GCC, Glibc, Make,
    1307          and Linux API Headers</seg>
     1306         <seg>Bash, Bison, Coreutils, Flex, GCC, Glibc, Make, Libcap,
     1307         Libelf, and Linux API Headers</seg>
    13081308        </seglistitem>
    13091309      </segmentedlist>
     
    13291329
    13301330        <seglistitem>
    1331           <seg>None</seg>
     1331          <seg>Berkeley DB and Iptables</seg>
    13321332        </seglistitem>
    13331333      </segmentedlist>
     
    14651465
    14661466        <seglistitem>
    1467           <seg>Shadow</seg>
     1467          <seg>IProute2 and Shadow</seg>
    14681468        </seglistitem>
    14691469      </segmentedlist>
     
    15001500
    15011501        <seglistitem>
    1502           <seg>Linux Kernel</seg>
     1502          <seg>IProute2 and Linux Kernel</seg>
    15031503        </seglistitem>
    15041504      </segmentedlist>
     
    19491949
    19501950        <seglistitem>
    1951          <seg>Binutils, Coreutils, Gcc, and Python</seg>
     1951         <seg>Binutils, Coreutils, GCC, and Python</seg>
    19521952        </seglistitem>
    19531953      </segmentedlist>
     
    19841984
    19851985        <seglistitem>
    1986          <seg>Binutils, Coreutils, Gcc, Make, and Perl</seg>
     1986         <seg>Binutils, Coreutils, GCC, Make, and Perl</seg>
    19871987        </seglistitem>
    19881988      </segmentedlist>
  • chapter01/askforhelp.xml

    rd4fdde6 r37e35d2  
    3939    <itemizedlist>
    4040      <listitem>
    41         <para>The version of the book being used (in this case
     41        <para>
     42          The version of the book being used (in this case
    4243          <phrase arch="default" revision="sysv">&version;</phrase>
    4344          <phrase arch="ml_32,ml_x32,ml_all" revision="sysv">&version;-multilib</phrase>
    4445          <phrase arch="default" revision="systemd">&versiond;</phrase>
    45           <phrase arch="ml_32,ml_x32,ml_all" revision="systemd">&versiond;-multilib</phrase>)</para>
    46 
     46          <phrase arch="ml_32,ml_x32,ml_all" revision="systemd">&versiond;-multilib</phrase>)
     47        </para>
    4748      </listitem>
    4849      <listitem>
     
    5960      </listitem>
    6061      <listitem>
    61         <para>Note whether you have deviated from the book at all </para>
     62        <para>Note whether you have deviated from the book at all</para>
    6263      </listitem>
    6364    </itemizedlist>
  • chapter01/changelog.xml

    rd4fdde6 r37e35d2  
    1212
    1313  <para>This is version
    14         <phrase arch="default" revision="sysv">&version;</phrase>
    15         <phrase arch="ml_32,ml_x32,ml_all" revision="sysv">&version;-multilib</phrase>
    16         <phrase arch="default" revision="systemd">&versiond;</phrase>
    17         <phrase arch="ml_32,ml_x32,ml_all" revision="systemd">&versiond;-multilib</phrase>
     14    <phrase arch="default" revision="sysv">&version;</phrase>
     15    <phrase arch="ml_32,ml_x32,ml_all" revision="sysv">&version;-multilib</phrase>
     16    <phrase arch="default" revision="systemd">&versiond;</phrase>
     17    <phrase arch="ml_32,ml_x32,ml_all" revision="systemd">&versiond;-multilib</phrase>
    1818  of the Linux From Scratch book, dated
    1919  &releasedate;. If this book is more than six months old, a newer and better
     
    4545    appropriate for the entry or if needed the entire day's listitem.
    4646    -->
     47    <listitem revision="systemd">
     48      <itemizedlist>
     49      <para>2020-06-22</para>
     50        <listitem>
     51          <para>[renodr] - Fix a segfault in systemd-udevd.</para>
     52        </listitem>
     53      </itemizedlist>
     54    </listitem>
     55
     56    <listitem>
     57      <itemizedlist>
     58      <para>2020-06-17</para>
     59        <listitem>
     60          <para>[bdubbs] - Update to meson-0.54.3. Fixes
     61          <ulink url="&lfs-ticket-root;4673">#4673</ulink>.</para>
     62        </listitem>
     63        <listitem>
     64          <para>[bdubbs] - Update to man-pages-5.07. Fixes
     65          <ulink url="&lfs-ticket-root;4669">#4669</ulink>.</para>
     66        </listitem>
     67        <listitem>
     68          <para>[bdubbs] - Update to linux-5.7.2. Fixes
     69          <ulink url="&lfs-ticket-root;4662">#4662</ulink>.</para>
     70        </listitem>
     71        <listitem>
     72          <para>[bdubbs] - Update to iproute2-5.7.0. Fixes
     73          <ulink url="&lfs-ticket-root;4668">#4668</ulink>.</para>
     74        </listitem>
     75        <listitem>
     76          <para>[bdubbs] - Update to file-5.39. Fixes
     77          <ulink url="&lfs-ticket-root;4671">#4671</ulink>.</para>
     78        </listitem>
     79        <listitem>
     80          <para>[bdubbs] - Update to elfutils-0.180. Fixes
     81          <ulink url="&lfs-ticket-root;4670">#4670</ulink>.</para>
     82        </listitem>
     83        <listitem>
     84          <para>[bdubbs] - Update to bison-3.6.4. Fixes
     85          <ulink url="&lfs-ticket-root;4672">#4672</ulink>.</para>
     86        </listitem>
     87      </itemizedlist>
     88    </listitem>
     89
     90    <listitem>
     91      <para>2020-06-16</para>
     92      <itemizedlist>
     93        <listitem>
     94          <para>[bdubbs] - Split Chapter 5 into three separate chapters.
     95          Implement a new method of cross-building the LFS tool chain
     96          and other tools to simplify the method of isolating the
     97          new system from the original host.  This will be the start of
     98          LFS-10.0.</para>
     99        </listitem>
     100      </itemizedlist>
     101    </listitem>
     102
     103    <listitem>
     104      <para>2020-06-03</para>
     105      <itemizedlist>
     106        <listitem revision="systemd">
     107          <para>[renodr] - Fix systemd's build with GCC-10 with a patch instead
     108          of CFLAGS.</para>
     109        </listitem>
     110        <listitem>
     111          <para>[renodr] - Update to perl-5.30.3 (security update). Fixes
     112          <ulink url="&lfs-ticket-root;4664">#4664</ulink>.</para>
     113        </listitem>
     114        <listitem revision="systemd">
     115          <para>[renodr] - Update to dbus-1.12.18 (security update). Fixes
     116          <ulink url="&lfs-ticket-root;4665">#4665</ulink>.</para>
     117        </listitem>
     118        <listitem>
     119          <para>[renodr] - Update to man-db-2.9.2. Fixes
     120          <ulink url="&lfs-ticket-root;4663">#4663</ulink>.</para>
     121        </listitem>
     122        <listitem>
     123          <para>[renodr] - Update to libcap-2.36. Fixes
     124          <ulink url="&lfs-ticket-root;4666">#4666</ulink>.</para>
     125        </listitem>
     126        <listitem>
     127          <para>[renodr] - Update to bison-3.6.3. Fixes
     128          <ulink url="&lfs-ticket-root;4667">#4667</ulink>.</para>
     129        </listitem>
     130      </itemizedlist>
     131    </listitem>
     132
    47133    <listitem>
    48134      <para>2020-05-31</para>
     
    61147      <itemizedlist>
    62148        <listitem>
     149          <para>[xry111] - Move flex earlier in chapter 6, so that binutils
     150          can use it.</para>
     151        </listitem>
     152        <listitem>
     153          <para>[xry111] - Remove bzip2 and flex from chapter 5.</para>
     154        </listitem>
     155        <listitem>
     156          <para>[xry111] - Move zstd earlier in chapter 6, so that file and
     157          GCC can use it.</para>
     158        </listitem>
     159        <listitem>
    63160          <para>[bdubbs] - Run sed and findutils tests as an
    64161          unprivileged user. Fixes
     
    173270          <para>[pierre] - Pass -Wno-format-overflow to systemd to
    174271          prevent an error with GCC 10.</para>
     272        </listitem>
     273      </itemizedlist>
     274    </listitem>
     275
     276    <listitem>
     277      <para>2020-05-09</para>
     278      <itemizedlist>
     279        <listitem>
     280          <para>[pierre] - Patch GCC pass 2 to allow cross-compile
     281          (specific to new cross method).</para>
    175282        </listitem>
    176283      </itemizedlist>
  • chapter01/how.xml

    rd4fdde6 r37e35d2  
    4545  <xref linkend="chapter-final-preps"/> carefully as it explains several
    4646  important issues you need be aware of before beginning to
    47   work your way through <xref linkend="chapter-temporary-tools"/> and beyond.</para>
     47  work your way through <xref linkend="chapter-cross-tools"/> and beyond.</para>
    4848
    49   <para><xref linkend="chapter-temporary-tools"/> explains the
    50   installation of a number of packages that will form the basic
    51   development suite (or toolchain) which is used to build the actual
    52   system in <xref linkend="chapter-building-system"/>. Some of these
    53   packages are needed to resolve circular dependencies&mdash;for example,
    54   to compile a compiler, you need a compiler.</para>
     49  <para><xref linkend="chapter-cross-tools"/>,  explains the installation of
     50  the initial tool chain, (binutils, gcc, and glibc) using cross compilation
     51  techniques to isolate the new tools from the host system.</para>
    5552
    56   <para><xref linkend="chapter-temporary-tools"/> also shows you how to
    57   build a first pass of the toolchain, including Binutils and GCC (first pass
    58   basically means these two core packages will be reinstalled).
    59   The next step is to build Glibc, the C library. Glibc will be compiled by
    60   the toolchain programs built in the first pass. Then, a second pass of the
    61   toolchain will be built. This time, the toolchain will be dynamically linked
    62   against the newly built Glibc. The remaining <xref
    63   linkend="chapter-temporary-tools"/> packages are built using this second
    64   pass toolchain. When this is done, the LFS installation process will no
    65   longer depend on the host distribution, with the exception of the running
    66   kernel. </para>
     53  <para><xref linkend="chapter-temporary-tools"/> shows you how to
     54  cross-compile basic utilities using the just built cross-toolchain.</para>
     55
     56  <para><xref linkend="chapter-chroot-temporary-tools"/> then enters a
     57  "chroot" environment and uses the previously built tools to build
     58  the additional tools needed to build and test the final system.</para>
    6759
    6860  <para>This effort to isolate the new system from the host distribution may
    69   seem excessive. A full technical explanation as to why this is done is provided in
    70   <xref linkend="ch-tools-toolchaintechnotes"/>.</para>
     61  seem excessive. A full technical explanation as to why this is done is
     62  provided in <xref linkend="ch-tools-toolchaintechnotes"/>.</para>
    7163
    72   <para>In <xref linkend="chapter-building-system"/>, the full LFS system is
    73   built. The <command>chroot</command> (change root) program is used to enter
    74   a virtual environment and start a new shell whose root directory will be
    75   set to the LFS partition. This is very similar to rebooting and instructing
    76   the kernel to mount the LFS partition as the root partition. The system
    77   does not actually reboot, but instead uses <command>chroot</command> because
    78   creating a bootable system requires additional work which is not necessary
    79   just yet. The major advantage is that <quote>chrooting</quote> allows you
    80   to continue using the host system while LFS is being built. While waiting
    81   for package compilations to complete, you can continue using your computer as
    82   normal.</para>
     64  <para>In <xref linkend="chapter-building-system"/>, The
     65  full LFS system is built. Another advantage provided by the chroot
     66  environment is that it allows you to continue using the host system
     67  while LFS is being built. While waiting for package compilations to
     68  complete, you can continue using your computer as normal.</para>
    8369
    8470  <para>To finish the installation, the basic system configuration is set up in
  • chapter01/whatsnew.xml

    rd4fdde6 r37e35d2  
    1212  <title>What's new since the last release</title>
    1313
     14  <para>In this version of LFS, there has been a major reorganization
     15  of the book using techniques that avoid changing the host system
     16  and provides a more straight forward build process.</para>
     17
    1418  <para>Below is a list of package updates made since the previous
    1519  release of the book.</para>
     
    8185       <para>Expect-&expect-version;</para>
    8286    </listitem>-->
    83     <!--<listitem>
     87    <listitem>
    8488       <para>File-&file-version;</para>
    85     </listitem>-->
     89    </listitem>
    8690    <!--<listitem>
    8791      <para>Findutils-&findutils-version;</para>
     
    164168    <listitem>
    165169      <para>Linux-&linux-version;</para>
    166     </listitem>
    167     <listitem>
    168       <para>Linux-Firmware-&linux-firmware-version;</para>
    169170    </listitem>
    170171    <!--<listitem>
  • chapter02/creatingfilesystem.xml

    rd4fdde6 r37e35d2  
    5353<screen role="nodump"><userinput>mkfs -v -t ext4 /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>
    5454
    55 <!--
    5655  <para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the name of the LFS
    57   partition (<filename class="devicefile">sda5</filename> in our previous
    58   example).</para>
     56  partition.</para>
    5957
    60   <note>
    61     <para>Some host distributions use custom features in their filesystem
    62     creation tools (E2fsprogs). This can cause problems when booting into your new
    63     LFS in Chapter&nbsp;9, as those features will not be supported by the LFS-installed
    64     E2fsprogs; you will get an error similar to <quote>unsupported filesystem
    65     features, upgrade your e2fsprogs</quote>. To check if your host system
    66     uses custom enhancements, run the following command:</para>
    67 
    68 <screen role="nodump"><userinput>debugfs -R feature /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>
    69 
    70     <para>If the output contains features other than
    71     <option>has_journal</option>, <option>ext_attr</option>,
    72     <option>resize_inode</option>, <option>dir_index</option>,
    73     <option>filetype</option>, <option>sparse_super</option>,
    74     <option>large_file</option> or <option>needs_recovery</option>, then your
    75     host system may have custom enhancements.  In that case, to avoid later
    76     problems, you should compile the stock E2fsprogs package and use the
    77     resulting binaries to re-create the filesystem on your LFS partition:</para>
    78 
    79 <screen role="nodump"><userinput>cd /tmp
    80 tar -xzvf /path/to/sources/e2fsprogs-&e2fsprogs-version;.tar.gz
    81 cd e2fsprogs-&e2fsprogs-version;
    82 mkdir -v build
    83 cd build
    84 ../configure
    85 make #note that we intentionally don't 'make install' here!
    86 ./misc/mke2fs -jv /dev/<replaceable>&lt;xxx&gt;</replaceable>
    87 cd /tmp
    88 rm -rfv e2fsprogs-&e2fsprogs-version;</userinput></screen>
    89   </note>
    90 -->
    9158  <para>If you are using an existing <systemitem class="filesystem">swap
    9259  </systemitem> partition, there is no need to format it. If a new
  • chapter02/creatingpartition.xml

    rd4fdde6 r37e35d2  
    1515  is to use an available empty partition or, if you have enough unpartitioned
    1616  space, to create one.</para>
    17 
    18 <!--
    19 
    20   <para>It is possible to install an LFS system (in fact even multiple LFS
    21   systems) on a partition already occupied by another
    22   operating system and the different systems will co-exist peacefully. The
    23   document <ulink url="&hints-root;lfs_next_to_existing_systems.txt"/>
    24   contains notes on how to implement this. This document was last updated
    25   in 2004. It has not been updated since and it has not been tested with
    26   recent versions of this LFS book. The document is more than likely not
    27   usable as-is and you will need to account for changes made to the LFS
    28   procedures since it was written. This is only recommended for expert LFS
    29   users.</para>
    30 
    31 -->
    3217
    3318  <para>A minimal system requires a partition of around 10 gigabytes (GB).
     
    7863
    7964  <para>Requests for advice on system partitioning are often posted on the LFS mailing
    80   lists.  This is a highly subjective topic.  The default for most distributions
     65  lists. This is a highly subjective topic.  The default for most distributions
    8166  is to use the entire drive with the exception of one small swap partition.  This
    8267  is not optimal for LFS for several reasons.  It reduces flexibility, makes
     
    9075    <para>A root LFS partition (not to be confused with the
    9176    <filename class="directory">/root</filename> directory) of
    92     ten gigabytes is a good compromise for most systems.  It provides enough
     77    twenty gigabytes is a good compromise for most systems.  It provides enough
    9378    space to build LFS and most of BLFS, but is small enough so that multiple
    9479    partitions can be easily created for experimentation.</para> </sect3>
     
    10388    swapping.</para>
    10489
    105     <para>Swapping is never good.  Generally you can tell if a system is
    106     swapping by just listening to disk activity and observing how the system
    107     reacts to commands.  The first reaction to swapping should be to check for
    108     an unreasonable command such as trying to edit a five gigabyte file.  If
    109     swapping becomes a normal occurrence, the best solution is to purchase more
    110     RAM for your system.</para>
    111     </sect3>
     90    <para>If you want to use the hibernation feature (suspend-to-disk) of Linux,
     91    it writes out the contents of RAM to the swap partition before turning off
     92    the machine. In this case the size of the swap partition should be at
     93    least as large as the system's installed RAM.</para>
     94
     95    <para>Swapping is never good. For mechanical hard drives you can generally
     96    tell if a system is swapping by just listening to disk activity and
     97    observing how the system reacts to commands.  For an SSD drive you will not
     98    be able to hear swapping but you can tell how much swap space is being used
     99    by the <command>top</command> or <command>free</command> programs.  Use of
     100    an SSD drive for a swap partition should be avoided if possible.  The first
     101    reaction to swapping should be to check for an unreasonable command such as
     102    trying to edit a five gigabyte file. If swapping becomes a normal
     103    occurrence, the best solution is to purchase more RAM for your
     104    system.</para> </sect3>
    112105
    113106    <sect3>
     
    141134      store kernels and other booting information.  To minimize potential boot
    142135      problems with larger disks, make this the first physical partition on
    143       your first disk drive.  A partition size of 100 megabytes is quite
     136      your first disk drive.  A partition size of 200 megabytes is quite
    144137      adequate.</para></listitem>
    145138
     
    151144      <listitem><para>/usr &ndash; A separate /usr partition is generally used
    152145      if providing a server for a thin client or diskless workstation.  It is
    153       normally not needed for LFS.  A size of five gigabytes will handle most
     146      normally not needed for LFS.  A size of ten gigabytes will handle most
    154147      installations.</para></listitem>
    155148
  • chapter02/hostreqs.xml

    rd4fdde6 r37e35d2  
    245245    [*] x32 ABI for 64-bit mode
    246246</screen>
     247
    247248    <para arch="ml_32,ml_x32,ml_all">The option 'IA32 a.out support' is
    248249      optional. In case your kernel does not have 'x32 ABI for 64-bit mode'
     
    252253      'x32 ABI for 64-bit mode' is enabled, you will run in errors
    253254      latest when building <application>glibc</application> in Chapter 6,
    254       so an upgrade of your host system is required.
     255      so an upgrade of your host system kernel is required.
    255256    </para>
    256257   
  • chapter02/stages.xml

    rd4fdde6 r37e35d2  
    2626    <itemizedlist>
    2727      <listitem>
    28          <para>Procedures done as the root user after Section 2.4 need to
    29          have the LFS environment variable set <emphasis>FOR THE ROOT
    30          USER</emphasis>.</para>
     28        <para>Procedures done as the root user after Section 2.4 need to
     29        have the LFS environment variable set <emphasis>FOR THE ROOT
     30        USER</emphasis>.</para>
    3131      </listitem>
    3232    </itemizedlist>
     
    3434 
    3535  <sect2>
    36   <title>Chapter&nbsp;5</title>
     36  <title>Chapter&nbsp;5&ndash;6</title>
     37
     38    <itemizedlist>
     39      <listitem>
     40        <para>The /mnt/lfs partition must be mounted.</para>
     41      </listitem>
     42
     43      <listitem>
     44        <para>Threse two chapters must be done as user <emphasis>lfs</emphasis>.
     45        A <command>su - lfs</command> needs to be done before any task in these
     46        chapters. Failing to do that, you are at risk of installing packages to the
     47        host, and potentially rendering it unusable.</para>
     48      </listitem>
     49
     50      <listitem>
     51         <para>The procedures in <xref linkend='ch-tools-generalinstructions'/>
     52         are critical.  If there is any
     53         doubt about installing a package, ensure any previously expanded
     54         tarballs are removed, then re-extract the package files, and complete all
     55         instructions in that section.</para>
     56      </listitem>
     57    </itemizedlist>
     58  </sect2>
     59
     60  <sect2>
     61  <title>Chapter&nbsp;7&ndash;10</title>
    3762
    3863    <itemizedlist>
     
    4267
    4368      <listitem>
    44          <para><emphasis>ALL</emphasis> instructions in Chapter&nbsp;5
    45          must be done by user <emphasis>lfs</emphasis>. 
    46          A  <command>su - lfs</command> needs to be done before any
    47          task in Chapter&nbsp;5.</para>
    48       </listitem>
    49 
    50       <listitem>
    51          <para>The procedures in <xref linkend='ch-tools-generalinstructions'/>
    52          are critical.  If there is any
    53          doubt about installing a package, ensure any previously expanded
    54          tarballs are removed, re-extract the package files, and complete all
    55          instructions in that section.</para>
    56       </listitem>
    57     </itemizedlist>
    58   </sect2>
    59 
    60   <sect2>
    61   <title>Chapters&nbsp;6&ndash;8</title>
    62 
    63     <itemizedlist>
    64       <listitem>
    65          <para>The /mnt/lfs partition must be mounted.</para>
     69        <para>A few operations, from <quote>Changing Ownership</quote> to
     70        <quote>Entering the Chroot Environment</quote> must be done as the
     71        root user, with the LFS envirnment variable set for the root user.</para>
    6672      </listitem>
    6773
    6874      <listitem>
    6975         <para> When entering chroot, the LFS environment variable must be set
    70          for root.  The LFS variable is not used otherwise.</para>
     76         for root. The LFS variable is not used afterwards.</para>
    7177      </listitem>
    7278
     
    7581         before or after entering chroot by changing to a host virtual terminal
    7682         and, as root, running the commands in
    77          <xref linkend='ch-system-bindmount'/> and
    78          <xref linkend='ch-system-kernfsmount'/>.</para>
     83         <xref linkend='ch-tools-bindmount'/> and
     84         <xref linkend='ch-tools-kernfsmount'/>.</para>
    7985      </listitem>
    8086    </itemizedlist>
  • chapter03/introduction.xml

    rd4fdde6 r37e35d2  
    5050<screen role="nodump"><userinput>chmod -v a+wt $LFS/sources</userinput></screen>
    5151
    52   <para>An easy way to download all of the packages and patches is by using
    53   <ulink url="../wget-list">wget-list</ulink> as an input to
    54   <command>wget</command>. For example:</para>
     52  <para>There are several ways to optain all the necessary packages and patches
     53  to build LFS:</para>
     54
     55  <itemizedlist>
     56    <listitem>
     57      <para>The files can be downloaded individually as described in the
     58      next two sections.</para>
     59    </listitem>
     60    <listitem>
     61      <para>For stable versions of the book, a tarball of all the needed files
     62      can be downloaded from one of the LFS files mirrors listed at
     63      <ulink url="http://www.linuxfromscratch.org/mirrors.html#files"/>.</para>
     64    </listitem>
     65    <listitem>
     66      <para>The files can be downloaded using <command>wget</command> and
     67      a wget-list as described below.</para>
     68    </listitem>
     69  </itemizedlist>
     70
     71  <para>To download all of the packages and patches by using
     72  <ulink url="../wget-list">wget-list</ulink> as an input to the
     73  <command>wget</command> command, use:</para>
    5574
    5675<screen role="nodump"><userinput>wget --input-file=wget-list --continue --directory-prefix=$LFS/sources</userinput></screen>
     
    6281
    6382<screen role="nodump"><userinput>pushd $LFS/sources
    64 md5sum -c md5sums
     83  md5sum -c md5sums
    6584popd</userinput></screen>
    6685
     86  <para>This check can be used after retrieving the needed files with any of the
     87  methods listed above.</para>
     88
    6789</sect1>
  • chapter03/packages.xml

    rd4fdde6 r37e35d2  
    356356    </varlistentry>
    357357
    358     <varlistentry>
     358    <varlistentry arch="ml_32,ml_x32,ml_all">
    359359      <term>ISL (&isl-version;) - <token>&isl-size;</token>:</term>
    360360      <listitem>
     
    461461
    462462    <varlistentry>
    463       <term>Linux Firmware (&linux-firmware-version;) - <token>&linux-firmware-size;</token>:</term>
    464       <listitem>
    465         <para>Home page: <ulink url="&linux-firmware-home;"/></para>
    466         <para>Download: <ulink url="&linux-firmware-url;"/></para>
    467         <para>MD5 sum: <literal>&linux-firmware-md5;</literal></para>
    468       </listitem>
    469     </varlistentry>
    470 
    471     <varlistentry>
    472463      <term>M4 (&m4-version;) - <token>&m4-size;</token>:</term>
    473464      <listitem>
     
    533524
    534525    <varlistentry>
     526      <term>Ncurses (&ncurses-version;) - <token>&ncurses-size;</token>:</term>
     527      <listitem>
     528        <para>Home page: <ulink url="&ncurses-home;"/></para>
     529        <para>Download: <ulink url="&ncurses-url;"/></para>
     530        <para>MD5 sum: <literal>&ncurses-md5;</literal></para>
     531      </listitem>
     532    </varlistentry>
     533
     534    <varlistentry>
    535535      <term>Ninja (&ninja-version;) - <token>&ninja-size;</token>:</term>
    536536      <listitem>
     
    538538        <para>Download: <ulink url="&ninja-url;"/></para>
    539539        <para>MD5 sum: <literal>&ninja-md5;</literal></para>
    540       </listitem>
    541     </varlistentry>
    542 
    543     <varlistentry>
    544       <term>Ncurses (&ncurses-version;) - <token>&ncurses-size;</token>:</term>
    545       <listitem>
    546         <para>Home page: <ulink url="&ncurses-home;"/></para>
    547         <para>Download: <ulink url="&ncurses-url;"/></para>
    548         <para>MD5 sum: <literal>&ncurses-md5;</literal></para>
    549540      </listitem>
    550541    </varlistentry>
     
    709700        <para>Download: <ulink url="&tcl-url;"/></para>
    710701        <para>MD5 sum: <literal>&tcl-md5;</literal></para>
     702      </listitem>
     703    </varlistentry>
     704
     705    <varlistentry>
     706      <term>Tcl Documentation (&tcl-version;) - <token>&tcl-docs-size;</token>:</term>
     707      <listitem>
     708        <para>Download: <ulink url="&tcl-docs-url;"/></para>
     709        <para>MD5 sum: <literal>&tcl-docs-md5;</literal></para>
    711710      </listitem>
    712711    </varlistentry>
  • chapter03/patches.xml

    rd4fdde6 r37e35d2  
    5151      </listitem>
    5252    </varlistentry>
    53 <!--
    54     <varlistentry>
    55       <term>Flex Fixes Patch - <token>&flex-fixes-patch-size;</token>:</term>
    56       <listitem>
    57         <para>Download: <ulink url="&patches-root;&flex-fixes-patch;"/></para>
    58         <para>MD5 sum: <literal>&flex-fixes-patch-md5;</literal></para>
    59       </listitem>
    60     </varlistentry>
    61 -->
    62 <!--
    63     <varlistentry>
    64       <term>Gccc ASAN Patch - <token>&gcc-asan-patch-size;</token>:</term>
    65       <listitem>
    66         <para>Download: <ulink url="&patches-root;&gcc-asan-patch;"/></para>
    67         <para>MD5 sum: <literal>&gcc-asan-patch-md5;</literal></para>
    68       </listitem>
    69     </varlistentry>
    70 -->
     53
    7154    <varlistentry>
    7255      <term>Glibc FHS Patch - <token>&glibc-fhs-patch-size;</token>:</term>
     
    7659      </listitem>
    7760    </varlistentry>
    78 <!--
     61
    7962    <varlistentry>
    80       <term>Glibc Glob Security Patch - <token>&glibc-glob-patch-size;</token>:</term>
     63      <term>GCC Cross Build Fix Patch - <token>&gcc-cross-patch-size;</token>:</term>
    8164      <listitem>
    82         <para>Download: <ulink url="&patches-root;&glibc-glob-patch;"/></para>
    83         <para>MD5 sum: <literal>&glibc-glob-patch-md5;</literal></para>
     65        <para>Download: <ulink url="&patches-root;&gcc-cross-patch;"/></para>
     66        <para>MD5 sum: <literal>&gcc-cross-patch-md5;</literal></para>
    8467      </listitem>
    8568    </varlistentry>
    86 -->
     69
    8770    <varlistentry>
    8871      <term>Kbd Backspace/Delete Fix Patch - <token>&kbd-backspace-patch-size;</token>:</term>
     
    9275      </listitem>
    9376    </varlistentry>
    94 <!--
    95     <varlistentry>
    96       <term>Ninja Limit Jobs Patch - <token>&ninja-limit-jobs-patch-size;</token>:</term>
    97       <listitem>
    98         <para>Download: <ulink url="&patches-root;&ninja-limit-jobs-patch;"/></para>
    99         <para>MD5 sum: <literal>&ninja-limit-jobs-patch-md5;</literal></para>
    100       </listitem>
    101     </varlistentry>
    102 -->
    103 <!--
    104     <varlistentry>
    105       <term>Readline Upstream Fixes Patch - <token>&readline-fixes-patch-size;</token>:</term>
    106       <listitem>
    107         <para>Download: <ulink url="&patches-root;&readline-fixes-patch;"/></para>
    108         <para>MD5 sum: <literal>&readline-fixes-patch-md5;</literal></para>
    109       </listitem>
    110     </varlistentry>
    111 -->
     77
    11278    <varlistentry revision="sysv">
    11379      <term>Sysvinit Consolidated Patch - <token>&sysvinit-consolidated-patch-size;</token>:</term>
     
    11783      </listitem>
    11884    </varlistentry>
    119 <!--
     85
    12086    <varlistentry revision="systemd">
    121       <term>Systemd Consolidated Patch - <token>&systemd-consolidated-patch-size;</token>:</term>
    122       <listitem>                   
    123         <para>Download: <ulink url="&patches-root;&systemd-consolidated-patch;"/></para>
    124         <para>MD5 sum: <literal>&systemd-consolidated-patch-md5;</literal></para>
     87      <term>Systemd GCC-10 Patch - <token>&systemd-gcc10-patch-size;</token>:</term>
     88      <listitem>
     89        <para>Download: <ulink url="&patches-root;&systemd-gcc10-patch;"/></para>
     90        <para>MD5 sum: <literal>&systemd-gcc10-patch-md5;</literal></para>
    12591      </listitem>
    12692    </varlistentry>
    127 -->
     93
    12894  </variablelist>
    12995
  • chapter04/aboutsbus.xml

    rd4fdde6 r37e35d2  
    2121
    2222  <para>The SBU measure works as follows. The first package to be compiled
    23   from this book is Binutils in <xref linkend="chapter-temporary-tools"/>. The
     23  from this book is binutils in <xref linkend="chapter-cross-tools"/>. The
    2424  time it takes to compile this package is what will be referred to as the
    2525  Standard Build Unit or SBU. All other compile times will be expressed relative
     
    2828  <para>For example, consider a package whose compilation time is 4.5
    2929  SBUs. This means that if a system took 10 minutes to compile and
    30   install the first pass of Binutils, it will take
     30  install the first pass of binutils, it will take
    3131  <emphasis>approximately</emphasis> 45 minutes to build this example package.
    32   Fortunately, most build times are shorter than the one for Binutils.</para>
     32  Fortunately, most build times are shorter than the one for binutils.</para>
    3333
    3434  <para>In general, SBUs are not entirely accurate because they depend on many
     
    4242    make" by either setting an environment variable or telling the
    4343    <command>make</command> program how many processors are available.  For
    44     instance, a Core2Duo can support two simultaneous processes with:</para>
     44    instance, an Intel i5-6500 CPU can support four simultaneous processes with:</para>
    4545
    46     <screen role="nodump"><userinput>export MAKEFLAGS='-j 2'</userinput></screen>
     46    <screen role="nodump"><userinput>export MAKEFLAGS='-j4'</userinput></screen>
    4747
    4848    <para>or just building with:</para>
    4949
    50     <screen role="nodump"><userinput>make -j2</userinput></screen>
     50    <screen role="nodump"><userinput>make -j4</userinput></screen>
    5151
    5252    <para>When multiple processors are used in this way, the SBU units in the
  • chapter04/abouttestsuites.xml

    rd4fdde6 r37e35d2  
    1919
    2020  <para>Some test suites are more important than others. For example,
    21   the test suites for the core toolchain packages&mdash;GCC, Binutils, and
    22   Glibc&mdash;are of the utmost importance due to their central role in a
    23   properly functioning system. The test suites for GCC and Glibc can
     21  the test suites for the core toolchain packages&mdash;GCC, binutils, and
     22  glibc&mdash;are of the utmost importance due to their central role in a
     23  properly functioning system. The test suites for GCC and glibc can
    2424  take a very long time to complete, especially on slower hardware, but
    2525  are strongly recommended.</para>
    2626
    2727  <note>
    28     <para>Experience has shown that there is little to be gained from running
    29     the test suites in <xref linkend="chapter-temporary-tools"/>. There can be
    30     no escaping the fact that the host system always exerts some influence on
    31     the tests in that chapter, often causing inexplicable failures. Because
    32     the tools built in <xref linkend="chapter-temporary-tools"/> are temporary
    33     and eventually discarded, we do not recommend running the test suites in
    34     <xref linkend="chapter-temporary-tools"/> for the average reader. The
    35     instructions for running those test suites are provided for the benefit of
    36     testers and developers, but they are strictly optional.</para>
     28    <para>Running the test suites in <xref linkend="chapter-cross-tools"/>
     29    and <xref linkend="chapter-temporary-tools"/>
     30    is impossible, since the programs are compiled with a cross-compiler,
     31    so are not supposed to be able to run on the build host.</para>
    3732  </note>
    3833
    39   <para>A common issue with running the test suites for Binutils and GCC
     34  <para>A common issue with running the test suites for binutils and GCC
    4035  is running out of pseudo terminals (PTYs). This can result in a high
    4136  number of failing tests. This may happen for several reasons, but the
  • chapter04/addinguser.xml

    rd4fdde6 r37e35d2  
    1212
    1313  <para>When logged in as user <systemitem class="username">root</systemitem>,
    14   making a single mistake can damage or destroy a system. Therefore, we
    15   recommend building the packages in the next chapter as an unprivileged user.
     14  making a single mistake can damage or destroy a system. Therefore,
     15  the packages in the next two chapters are built as an unprivileged user.
    1616  You could use your own user name, but to make it easier to set up a clean
    1717  working environment, create a new user called <systemitem
     
    6363      <term><parameter>lfs</parameter></term>
    6464      <listitem>
    65         <para>This is the actual name for the created group and user.</para>
     65        <para>This is the actual name for the created user.</para>
    6666      </listitem>
    6767    </varlistentry>
     
    7878
    7979  <para>Grant <systemitem class="username">lfs</systemitem> full access to
    80   <filename class="directory">$LFS/tools</filename> by making
     80  all directories under <filename class="directory">$LFS</filename> by making
    8181  <systemitem class="username">lfs</systemitem> the directory owner:</para>
    8282
    83 <screen><userinput>chown -v lfs $LFS/tools</userinput></screen>
     83<screen><userinput>chown -v lfs $LFS/{usr,lib,var,etc,bin,sbin,tools}
     84case $(uname -m) in
     85  x86_64) chown -v lfs $LFS/lib64 ;;
     86esac</userinput></screen>
     87<screen arch="ml_32"  ><userinput>chown -v lfs $LFS&lib-m32;</userinput></screen>
     88<screen arch="ml_x32" ><userinput>chown -v lfs $LFS&lib-mx32;</userinput></screen>
     89<screen arch="ml_all" ><userinput>chown -v lfs $LFS/{lib32,libx32}</userinput></screen>
    8490
    8591  <para>If a separate working directory was created as suggested, give
     
    96102  <para>Next, login as user <systemitem class="username">lfs</systemitem>.
    97103  This can be done via a virtual console, through a display manager, or with
    98   the following substitute user command:</para>
     104  the following substitute/switch user command:</para>
    99105
    100106<screen role="nodump"><userinput>su - lfs</userinput></screen>
  • chapter04/chapter04.xml

    rd4fdde6 r37e35d2  
    1414  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
    1515  <!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutlfs.xml"/>-->
    16   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingtoolsdir.xml"/>
     16  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingminlayout.xml"/>
    1717  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="addinguser.xml"/>
    1818  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="settingenviron.xml"/>
  • chapter04/introduction.xml

    rd4fdde6 r37e35d2  
    1212
    1313  <para>In this chapter, we will perform a few additional tasks to prepare
    14   for building the temporary system. We will create a directory in
     14  for building the temporary system. We will create a set of directories in
    1515  <filename class="directory">$LFS</filename> for the installation of the
    1616  temporary tools, add an unprivileged user to reduce risk,
  • chapter04/settingenviron.xml

    rd4fdde6 r37e35d2  
    4444LC_ALL=POSIX
    4545LFS_TGT=$(uname -m)-lfs-linux-gnu
    46 PATH=/tools/bin:/bin:/usr/bin
     46PATH=/usr/bin
     47if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
     48PATH=$LFS/tools/bin:$PATH
    4749export LFS LC_ALL LFS_TGT PATH</literal>
    4850EOF</userinput></screen>
     
    5557LFS_TGT32=i686-lfs-linux-gnu
    5658LFS_TGTX32=x86_64-lfs-linux-gnux32
    57 PATH=/tools/bin:/bin:/usr/bin
     59PATH=/usr/bin
     60if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
     61PATH=$LFS/tools/bin:$PATH
    5862export LFS LC_ALL LFS_TGT LFS_TGT32 LFS_TGTX32 PATH</literal>
    5963EOF</userinput></screen>
    6064
    6165  <variablelist>
    62     <title>The meaning of the command line options in <filename>.bashrc</filename></title>
     66    <title>The meaning of the settings in <filename>.bashrc</filename></title>
    6367
    6468    <varlistentry>
     
    120124
    121125    <varlistentry>
    122       <term><parameter>PATH=/tools/bin:/bin:/usr/bin</parameter></term>
    123       <listitem>
    124   <para>By putting <filename class="directory">/tools/bin</filename> ahead of the
    125   standard <envar>PATH</envar>, all the programs installed in <xref
    126   linkend="chapter-temporary-tools"/> are picked up by the shell immediately after
    127   their installation. This, combined with turning off hashing, limits the risk
    128   that old programs are used from the host when the same programs are available in
    129   the Chapter 5 environment.</para>
     126      <term><parameter>PATH=/usr/bin</parameter></term>
     127      <listitem>
     128  <para>Many modern linux distributions have merged <filename
     129  class="directory">/bin</filename> and <filename
     130  class="directory">/usr/bin</filename>. When this is the case, the standard
     131  <envar>PATH</envar> variable needs just to be set to <filename
     132  class="directory">/usr/bin/</filename> for the <xref
     133  linkend="chapter-temporary-tools"/> environment. When this is not the
     134  case, the following line adds <filename class="directory">/bin</filename>
     135  to the path.</para>
     136      </listitem>
     137    </varlistentry>
     138
     139    <varlistentry>
     140      <term><parameter>if [ ! -L /bin ]; then PATH=/bin:$PATH; fi</parameter></term>
     141      <listitem>
     142  <para>If <filename class="directory">/bin</filename> is not a symbolic
     143  link, then it has to be added to the <envar>PATH</envar> variable.</para>
     144      </listitem>
     145    </varlistentry>
     146
     147    <varlistentry>
     148      <term><parameter>PATH=$LFS/tools/bin:$PATH</parameter></term>
     149      <listitem>
     150  <para>By putting <filename class="directory">$LFS/tools/bin</filename> ahead of the
     151  standard <envar>PATH</envar>, the cross-compiler installed at the beginning
     152  of <xref linkend="chapter-cross-tools"/> is picked up by the shell
     153  immediately after its installation. This, combined with turning off hashing,
     154  limits the risk that the compiler from the host be used instead of the
     155  cross-compiler.</para>
    130156      </listitem>
    131157    </varlistentry>
     
    135161      <listitem>
    136162        <para>While the above commands have set some variables, in order
    137         to make them visible within any sub-shells, we export them</para>
     163        to make them visible within any sub-shells, we export them.</para>
    138164      </listitem>
    139165    </varlistentry>
    140166
    141167  </variablelist>
     168
     169  <important>
     170
     171     <para>Several commercial distributions add a non-documented instantiation
     172     of <filename>/etc/bash.bashrc</filename> to the initialization of
     173     <command>bash</command>. This file has the potential to modify the
     174     <systemitem class="username">lfs</systemitem>
     175     user's environment in ways that can affect the building of critical LFS
     176     packages. To make sure the <systemitem class="username">lfs</systemitem>
     177     user's envronment is clean, check for the
     178     presence of <filename>/etc/bash.bashrc</filename> and, if present, move it
     179     out of the way.  As the <systemitem class="username">root</systemitem>
     180     user, run:</para>
     181
     182     <screen role="nodump"><userinput>[ ! -e /etc/bash.bashrc ] || mv -v /etc/bash.bashrc /etc/bash.bashrc.NOUSE</userinput></screen>
     183
     184     <para>After use of the <systemitem class="username">lfs</systemitem>
     185     user is finished at the beginning of <xref
     186     linkend="chapter-chroot-temporary-tools"/>, you can restore
     187         <filename>/etc/bash.bashrc</filename> (if desired).</para>
     188
     189     <para>Note that the LFS Bash package we will build in
     190     <xref linkend="ch-system-bash"/> is not configured to load or execute
     191     <filename>/etc/bash.bashrc</filename>, so this file is useless on a
     192     completed LFS system.</para>
     193  </important>
    142194
    143195  <para>Finally, to have the environment fully prepared for building the
  • chapter05/binutils-pass1.xml

    rd4fdde6 r37e35d2  
    2626
    2727    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    28     href="../chapter06/binutils.xml"
     28    href="../chapter08/binutils.xml"
    2929    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    3030
     
    3434
    3535      <seglistitem>
    36         <seg>&binutils-ch5p1-sbu;</seg>
    37         <seg>&binutils-ch5p1-du;</seg>
     36        <seg>&binutils-tmpp1-sbu;</seg>
     37        <seg>&binutils-tmpp1-du;</seg>
    3838      </seglistitem>
    3939    </segmentedlist>
     
    4444    <title>Installation of Cross Binutils</title>
    4545
    46     <note><para>Go back and re-read the notes in the previous section.
    47     Understanding the notes labeled important will save you a lot
     46    <note><para>Go back and re-read the notes in the section titled <xref
     47    linkend="ch-tools-generalinstructions"/>.
     48    Understanding the notes labeled important can save you a lot
    4849    of problems later.</para></note>
    4950
     
    6465      the configuration, up to and including the first install. To achieve
    6566      this easily, wrap the commands in a <command>time</command>
    66       command like this: <userinput>time { ./configure ... &amp;&amp; ...
     67      command like this: <userinput>time { ./configure ... &amp;&amp; make
    6768      &amp;&amp; make install; }</userinput>.</para>
    6869    </note>
    6970
    70     <note><para>The approximate build SBU values and required disk space
    71     in Chapter&nbsp;5 does not include test suite data.</para></note>
    72 
    7371    <para>Now prepare Binutils for compilation:</para>
    7472
    75 <screen arch="default"><userinput remap="configure">../configure --prefix=/tools            \
     73<screen arch="default"><userinput remap="configure">../configure --prefix=$LFS/tools       \
    7674             --with-sysroot=$LFS        \
    77              --with-lib-path=/tools/lib \
    7875             --target=$LFS_TGT          \
    7976             --disable-nls              \
    8077             --disable-werror</userinput></screen>
    81 
    82     <screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">lpath=/tools/lib</userinput>
    83 <userinput remap="configure" arch="ml_32,ml_all">lpath="$lpath:/tools/lib32"</userinput>
    84 <userinput remap="configure" arch="ml_x32,ml_all">lpath="$lpath:/tools/libx32"</userinput>
    85 <userinput remap="configure">../configure --prefix=/tools \
    86              --with-sysroot=$LFS                     \
    87              --with-lib-path=$lpath                  \
    88              --target=$LFS_TGT                       \
    89              --disable-nls                           \
    90              --disable-werror                        \
    91              --enable-64-bit-bfd                     \
     78<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure --prefix=$LFS/tools       \
     79             --with-sysroot=$LFS        \
     80             --target=$LFS_TGT          \
     81             --disable-nls              \
     82             --disable-werror           \
    9283             --enable-multilib</userinput></screen>
    9384
     
    9687
    9788      <varlistentry>
    98         <term><parameter>--prefix=/tools</parameter></term>
     89        <term><parameter>--prefix=$LFS/tools</parameter></term>
    9990        <listitem>
    10091          <para>This tells the configure script to prepare to install the
    101           Binutils programs in the <filename class="directory">/tools</filename>
    102           directory.</para>
     92          binutils programs in the <filename
     93          class="directory">$LFS/tools</filename> directory.</para>
    10394        </listitem>
    10495      </varlistentry>
     
    113104
    114105      <varlistentry>
    115         <term><parameter>--with-lib-path=/tools/lib</parameter></term>
    116         <listitem>
    117           <para>This specifies which library path the linker should be
    118           configured to use.</para>
    119         </listitem>
    120       </varlistentry>
    121 
    122       <varlistentry>
    123106        <term><envar>--target=$LFS_TGT</envar></term>
    124107        <listitem>
     
    126109          variable is slightly different than the value returned by the
    127110          <command>config.guess</command> script, this switch will tell the
    128           <command>configure</command> script to adjust Binutil's build system
     111          <command>configure</command> script to adjust binutil's build system
    129112          for building a cross linker.  </para>
    130113        </listitem>
     
    147130      </varlistentry>
    148131
     132      <varlistentry arch="ml_32,ml_x32,ml_all">
     133        <term><parameter>--enable-multilib</parameter></term>
     134        <listitem>
     135          <para>Enables multilib support.</para>
     136        </listitem>
     137      </varlistentry>
     138
    149139    </variablelist>
    150140
     
    152142
    153143<screen><userinput remap="make">make</userinput></screen>
    154 
    155     <para>Compilation is now complete. Ordinarily we would now run the
    156     test suite, but at this early stage the test suite framework (Tcl,
    157     Expect, and DejaGNU) is not yet in place. The benefits of running the
    158     tests at this point are minimal since the programs from this
    159     first pass will soon be replaced by those from the second.</para>
    160 
    161     <para arch="default">If building on x86_64, create a symlink to ensure the
    162     sanity of the toolchain:</para>
    163 
    164     <para arch="ml_32,ml_x32,ml_all">Create a symlink to ensure the sanity of
    165     the toolchain:</para>
    166 
    167 <screen arch="default"><userinput remap="install">case $(uname -m) in
    168   x86_64) mkdir -v /tools/lib &amp;&amp; ln -sv lib /tools/lib64 ;;
    169 esac</userinput></screen>
    170 
    171 <screen arch="ml_32,ml_x32,ml_all"><userinput remap="install">mkdir -v /tools/lib &amp;&amp;
    172 ln -sv lib /tools/lib64</userinput></screen>
    173144
    174145    <para>Install the package:</para>
  • chapter05/chapter05.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <chapter id="chapter-temporary-tools" xreflabel="Chapter&nbsp;5">
     8<chapter id="chapter-cross-tools" xreflabel="Chapter&nbsp;5">
    99  <?dbhtml dir="chapter05"?>
    1010  <?dbhtml filename="chapter05.html"?>
    1111
    12   <title>Constructing a Temporary System</title>
     12  <title>Compiling a Cross-Toolchain</title>
    1313
    1414  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
    15   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="toolchaintechnotes.xml"/>
    16   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="generalinstructions.xml"/>
    1715  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils-pass1.xml"/>
    1816  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-pass1.xml"/>
     
    2018  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="glibc.xml"/>
    2119  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libstdc++.xml"/>
    22   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils-pass2.xml"/>
    23   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zlib.xml"/>
    24   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-pass2.xml"/>
    25   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tcl.xml"/>
    26   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="expect.xml"/>
    27   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dejagnu.xml"/>
    28   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="m4.xml"/>
    29   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ncurses.xml"/>
    30   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bash.xml"/>
    31   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bison.xml"/>
    32   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="coreutils.xml"/>
    33   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="diffutils.xml"/>
    34   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="file.xml"/>
    35   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
    36   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gawk.xml"/>
    37   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gettext.xml"/>
    38   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grep.xml"/>
    39   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gzip.xml"/>
    40   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="make.xml"/>
    41   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="patch.xml"/>
    42   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="perl.xml"/>
    43   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="python.xml"/>
    44   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sed.xml"/>
    45   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tar.xml"/>
    46   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.xml"/>
    47   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
    48   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xz.xml"/>
    49   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="stripping.xml"/>
    50   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="changingowner.xml"/>
    5120
    5221</chapter>
  • chapter05/gcc-pass1.xml

    rd4fdde6 r37e35d2  
    2626
    2727    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    28     href="../chapter06/gcc.xml"
     28    href="../chapter08/gcc.xml"
    2929    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    3030
     
    3434
    3535      <seglistitem>
    36         <seg>&gcc-ch5p1-sbu;</seg>
    37         <seg>&gcc-ch5p1-du;</seg>
     36        <seg>&gcc-tmpp1-sbu;</seg>
     37        <seg>&gcc-tmpp1-du;</seg>
    3838      </seglistitem>
    3939    </segmentedlist>
     
    4444    <title>Installation of Cross GCC</title>
    4545
    46     <para arch="default">GCC now requires the GMP, MPFR, and MPC packages. As
    47     these packages may not be included in your host distribution, they will be
    48     built with GCC.  Unpack each package into the GCC source directory and
    49     rename the resulting directories so the GCC build procedures will
    50     automatically use them:</para>
    51 
    52     <para arch="ml_32,ml_x32,ml_all">GCC now requires the GMP, ISL, MPFR, and MPC packages.
    53     As these packages may not be included in your host distribution, they will
    54     be built with GCC.  Unpack each package into the GCC source directory and
    55     rename the resulting directories so the GCC build procedures will
    56     automatically use them:</para>
     46    <para>GCC requires the GMP, MPFR and MPC packages. As these packages may
     47    not be included in your host distribution, they will be built with
     48    GCC.  Unpack each package into the GCC source directory and rename the
     49    resulting directories so the GCC build procedures will automatically
     50    use them:</para>
    5751
    5852    <note><para>There are frequent misunderstandings about this chapter.  The
     
    6256    proceed with the instructions below.</para></note>
    6357
    64 <screen arch="default"><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz
     58<screen><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz
    6559mv -v mpfr-&mpfr-version; mpfr
    6660tar -xf ../gmp-&gmp-version;.tar.xz
    6761mv -v gmp-&gmp-version; gmp
    6862tar -xf ../mpc-&mpc-version;.tar.gz
    69 mv -v mpc-&mpc-version; mpc</userinput></screen>
    70 <screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz
    71 mv -v mpfr-&mpfr-version; mpfr
    72 tar -xf ../gmp-&gmp-version;.tar.xz
    73 mv -v gmp-&gmp-version; gmp
    74 tar -xf ../mpc-&mpc-version;.tar.gz
    75 mv -v mpc-&mpc-version; mpc
    76 tar -xf ../isl-&isl-version;.tar.xz
     63mv -v mpc-&mpc-version; mpc</userinput>
     64<userinput remap="pre" arch="ml_32,ml_x32,ml_all">tar -xf ../isl-&isl-version;.tar.xz
    7765mv -v isl-&isl-version; isl</userinput></screen>
    7866
    79     <para>The following command will change the location of GCC's default
    80     dynamic linker to use the one installed in <filename
    81     class="directory">/tools</filename>. It also removes <filename
    82     class="directory">/usr/include</filename> from GCC's include search path.
    83     Issue:</para>
    84 
    85 <screen><userinput remap="pre">for file in gcc/config/{linux,i386/linux{,64}}.h
    86 do
    87   cp -uv $file{,.orig}
    88   sed -e 's@/lib\(64\)\?\(32\)\?\(x32\)\?/ld@/tools&amp;@g' \
    89       -e 's@/usr@/tools@g' $file.orig &gt; $file
    90   touch $file.orig
    91 done
    92 sed -e "/^#define[[:blank:]]*STANDARD_STARTFILE_PREFIX_1/ s;\".*\";\"/tools/lib/\";" \
    93     -e "/^#define[[:blank:]]*STANDARD_STARTFILE_PREFIX_2/ s;\".*\";\"\";" \
    94     -i gcc/gcc.c</userinput></screen>
    95 
    96     <para>In case the above seems hard to follow, let's break it down a bit.
    97     First we copy the files <filename>gcc/config/linux.h</filename>,
    98     <filename>gcc/config/i386/linux.h</filename>, and
    99     <filename>gcc/config/i386/linux64.h</filename> to a file of
    100     the same name but with an added suffix of <quote>.orig</quote>. Then the
    101     first sed expression prepends <quote>/tools</quote> to every instance of
    102     <quote>/lib/ld</quote>, <quote>/lib64/ld</quote> or
    103     <quote>/lib32/ld</quote>, while the second one replaces hard-coded
    104     instances of <quote>/usr</quote>. Next, we add our define statements which
    105     alter the default startfile prefix to the end of the file. Note that the
    106     trailing <quote>/</quote> in <quote>/tools/lib/</quote> is required.
    107     Finally, we use <command>touch</command> to update the timestamp on the
    108     copied files.  When used in conjunction with <command>cp -u</command>, this
    109     prevents unexpected changes to the original files in case the commands are
    110     inadvertently run twice.</para>
    111 
    112     <para arch="default">Finally, on x86_64 hosts, set the default directory
    113     name for 64-bit libraries to <quote>lib</quote>:</para>
     67    <para arch="default">On x86_64 hosts, set the default directory name for
     68    64-bit libraries to <quote>lib</quote>:</para>
    11469
    11570<screen arch="default"><userinput remap="pre">case $(uname -m) in
     
    12075esac</userinput></screen>
    12176
    122 <screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">sed -e '/m64=/s/lib64/lib/'  \
    123     -e '/m32=/s/m32=.*/m32=..\/lib32$(call if_multiarch,:i386-linux-gnu)/' \
    124     -i.orig gcc/config/i386/t-linux64</userinput></screen>
    125 
    126 <!--
    127     <para>GCC doesn't detect stack protection correctly, which causes problems
    128     for the build of Glibc-&glibc-version;, so fix that by issuing the following
    129     command:</para>
    130 
    131 <screen><userinput remap="pre">sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure</userinput></screen>
    132 -->
    133 
    134 <!--
    135     <para>Also fix a problem identified upstream:</para>
    136 
    137 <screen><userinput remap="pre">sed -i 's/if \((code.*))\)/if (\1 \&amp;\&amp; \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c</userinput></screen>
    138 -->
    139 
    140     <!-- Following patch might be obsolete with gcc >= 8.2.1 -->
    141     <!-- see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86724 -->
    142     <!-- Fix applied in ch5-gcc-pass{1,2}, ch6-gcc -->
    143 <!--
    144     <para arch="ml_32,ml_x32,ml_all">Fix an issue with isl-&isl-version;:</para>
    145 
    146 <screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">sed -e "/#include &lt;isl\/schedule_node.h&gt;/ a#include &lt;isl/id.h&gt;\n#include &lt;isl/space.h&gt;" \
    147     -i gcc/graphite.h</userinput></screen>
    148 -->
     77    <para arch="ml_32,ml_x32,ml_all">Change the default directory name for
     78    libraries:</para>
     79
     80<screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \
     81    -e '/m32=/s/m32=.*/m32=..\&lib-m32;$(call if_multiarch,:i386-linux-gnu)/' \
     82    -i.orig gcc/config/i386/t-linux64
     83</userinput></screen>
    14984
    15085    <para>The GCC documentation recommends building GCC
     
    15691    <para>Prepare GCC for compilation:</para>
    15792
    158 <screen><userinput arch="default" remap="configure">mloptions="--disable-multilib"</userinput>
    159 <userinput arch="ml_32,ml_x32,ml_all" remap="configure">mloptions="--enable-multilib --with-multilib-list=m64"</userinput>
    160 <userinput arch="ml_32,ml_all" remap="configure">mloptions="$mloptions,m32"</userinput>
    161 <userinput arch="ml_x32,ml_all" remap="configure">mloptions="$mloptions,mx32"</userinput>
    162 <userinput remap="configure">../configure                                       \
     93<screen arch="default"><userinput remap="configure">../configure                                       \
    16394    --target=$LFS_TGT                              \
    164     --prefix=/tools                                \
     95    --prefix=$LFS/tools                            \
    16596    --with-glibc-version=2.11                      \
    16697    --with-sysroot=$LFS                            \
    16798    --with-newlib                                  \
    16899    --without-headers                              \
    169     --with-local-prefix=/tools                     \
    170     --with-native-system-header-dir=/tools/include \
     100    --enable-initfini-array                        \
    171101    --disable-nls                                  \
    172102    --disable-shared                               \
     103    --disable-multilib                             \
    173104    --disable-decimal-float                        \
    174105    --disable-threads                              \
     
    179110    --disable-libvtv                               \
    180111    --disable-libstdcxx                            \
    181     --enable-languages=c,c++                       \
    182     $mloptions</userinput></screen>
     112    --enable-languages=c,c++</userinput></screen>
     113<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure"
     114    arch="ml_32">mlist=m64,m32</userinput><userinput remap="configure"
     115    arch="ml_x32">mlist=m64,mx32</userinput><userinput remap="configure"
     116    arch="ml_all">mlist=m64,m32,mx32</userinput>
     117<userinput remap="configure">../configure                                       \
     118    --target=$LFS_TGT                              \
     119    --prefix=$LFS/tools                            \
     120    --with-glibc-version=2.11                      \
     121    --with-sysroot=$LFS                            \
     122    --with-newlib                                  \
     123    --without-headers                              \
     124    --enable-initfini-array                        \
     125    --disable-nls                                  \
     126    --disable-shared                               \
     127    --enable-multilib --with-multilib-list=$mlist  \
     128    --disable-decimal-float                        \
     129    --disable-threads                              \
     130    --disable-libatomic                            \
     131    --disable-libgomp                              \
     132    --disable-libquadmath                          \
     133    --disable-libssp                               \
     134    --disable-libvtv                               \
     135    --disable-libstdcxx                            \
     136    --enable-languages=c,c++</userinput></screen>
    183137
    184138    <variablelist>
     
    214168
    215169      <varlistentry>
    216         <term><parameter>--with-local-prefix=/tools</parameter></term>
    217         <listitem>
    218           <para>The local prefix is the location in the system that GCC will search
    219           for locally installed include files. The default is <filename>/usr/local</filename>.
    220           Setting this to <filename>/tools</filename> helps keep the host location of
    221           <filename>/usr/local</filename> out of this GCC's search path.</para>
    222         </listitem>
    223       </varlistentry>
    224 
    225       <varlistentry>
    226         <term><parameter>--with-native-system-header-dir=/tools/include</parameter></term>
    227         <listitem>
    228           <para>By default, GCC searches <filename>/usr/include</filename> for
    229           system headers. In conjunction with the sysroot switch, this would
    230           normally translate to <filename>$LFS/usr/include</filename>. However
    231           the headers that will be installed in the next two sections will go
    232           to <filename>$LFS/tools/include</filename>. This switch ensures that
    233           gcc will find them correctly. In the second pass of GCC, this same
    234           switch will ensure that no headers from the host system are
    235           found.</para>
     170        <term><parameter>--enable-initfini-array</parameter></term>
     171        <listitem>
     172          <para>This switch forces the use of some internal data structures
     173          that are needed but cannot be detected when building a cross
     174          compiler.</para>
    236175        </listitem>
    237176      </varlistentry>
     
    241180        <listitem>
    242181          <para>This switch forces GCC to link its internal libraries
    243           statically. We do this to avoid possible issues with the host
    244           system.</para>
     182          statically. We need this because the shared libraries require glibc,
     183          which is not yet installed on the target system.</para>
     184        </listitem>
     185      </varlistentry>
     186
     187      <varlistentry arch="default">
     188        <term><parameter>--disable-multilib</parameter></term>
     189        <listitem>
     190          <para>On x86_64, LFS does not support a multilib configuration.
     191          This switch is harmless for x86.</para>
     192        </listitem>
     193      </varlistentry>
     194      <varlistentry arch="ml_32,ml_x32,ml_all">
     195        <term><parameter>--enable-multilib --with-multilib-list=...</parameter></term>
     196        <listitem>
     197          <para>LFS canbe used to support multilib. Which they are is
     198          specified in the multilib list.</para>
    245199        </listitem>
    246200      </varlistentry>
     
    248202      <varlistentry>
    249203        <term><parameter>--disable-decimal-float, --disable-threads,
    250               --disable-libatomic, --disable-libgomp, <!--- -disable-libmpx,-->
     204              --disable-libatomic, --disable-libgomp,
    251205        --disable-libquadmath, --disable-libssp, --disable-libvtv,
    252206        --disable-libstdcxx</parameter></term>
    253207        <listitem>
    254208          <para>These switches disable support for the decimal floating point
    255           extension, threading, libatomic, libgomp, <!--libmpx, --> libquadmath, libssp,
     209          extension, threading, libatomic, libgomp, libquadmath, libssp,
    256210          libvtv, and the C++ standard library respectively. These features
    257211          will fail to compile when building a cross-compiler and are not
     
    260214      </varlistentry>
    261215
    262       <varlistentry arch="default">
    263         <term><parameter>--disable-multilib</parameter></term>
    264         <listitem>
    265           <para>On x86_64, LFS does not yet support a multilib configuration.
    266           This switch is harmless for x86.</para>
    267         </listitem>
    268       </varlistentry>
    269 
    270       <varlistentry arch="ml_32,ml_x32,ml_all">
    271         <term><parameter>--enable-multilib,
    272                          --with-multilib-list=m32,m64,mx32</parameter></term>
    273         <listitem>
    274           <para>LFS now supports a multilib configuration. Enable it for the
    275           32bit, the 64-bit, and the mixed mode.</para>
    276         </listitem>
    277       </varlistentry>
    278 
    279216      <varlistentry>
    280217        <term><parameter>--enable-languages=c,c++</parameter></term>
     
    291228<screen><userinput remap="make">make</userinput></screen>
    292229
    293     <para>Compilation is now complete. At this point, the test suite would
    294     normally be run, but, as mentioned before, the test suite framework is
    295     not in place yet. The benefits of running the tests at this point
    296     are minimal since the programs from this first pass will soon be
    297     replaced.</para>
    298 
    299230    <para>Install the package:</para>
    300231
    301 <screen><userinput remap="install">make install</userinput></screen>
    302 <!--
    303     <para>Using <parameter>- -disable-shared</parameter> means that the
    304     <filename>libgcc_eh.a</filename> file isn't created and installed. The
    305     Glibc package depends on this library as it uses
    306     <parameter>-lgcc_eh</parameter> within its build system. This dependency
    307     can be satisfied by creating a symlink to <filename>libgcc.a</filename>,
    308     since that file will end up containing the objects normally contained in
    309     <filename>libgcc_eh.a</filename>:</para>
    310 
    311 <screen><userinput remap="install">ln -sv libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&amp;_eh/'`</userinput></screen>
    312 -->
     232    <screen><userinput remap="install">make install</userinput></screen>
     233
     234    <para>This build of GCC has installed a couple of internal system
     235    headers.  Normally one of them, <filename>limits.h</filename>, would in turn
     236    include the corresponding system <filename>limits.h</filename> header, in
     237    this case, <filename>$LFS/usr/include/limits.h</filename>. However, at the
     238    time of this build of GCC <filename>$LFS/usr/include/limits.h</filename>
     239    does not exist, so the internal header that has just been installed is a
     240    partial, self-contained file and does not include the extended features of
     241    the system header. This is adequate for building glibc, but the full
     242    internal header will be needed later.  Create a full version of the internal
     243    header using a command that is identical to what the GCC build system does
     244    in normal circumstances:</para>
     245
     246<screen><userinput remap="install">cd ..
     247cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
     248  `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/install-tools/include/limits.h</userinput></screen>
    313249  </sect2>
    314250
  • chapter05/glibc.xml

    rd4fdde6 r37e35d2  
    2626
    2727    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    28     href="../chapter06/glibc.xml"
     28    href="../chapter08/glibc.xml"
    2929    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    3030
     
    3434
    3535      <seglistitem>
    36         <seg>&glibc-ch5-sbu;</seg>
    37         <seg>&glibc-ch5-du;</seg>
     36        <seg>&glibc-tmp-sbu;</seg>
     37        <seg>&glibc-tmp-du;</seg>
    3838      </seglistitem>
    3939    </segmentedlist>
     
    4444    <title>Installation of Glibc</title>
    4545
     46    <para arch="default">First, create a symbolic link for LSB compliance. Additionally,
     47    for x86_64, create a compatibility symbolic link required for proper
     48    operation of the dynamic library loader:</para>
     49
     50<screen arch="default"><userinput remap="pre">case $(uname -m) in
     51    i?86)   ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
     52    ;;
     53    x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
     54            ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
     55    ;;
     56esac</userinput></screen>
     57
     58    <para arch="ml_32,ml_x32,ml_all">First, create symbolic links for LSB compliance
     59    and compatibility symbolic links required for proper
     60    operation of the dynamic library loader:</para>
     61
     62<!-- no ld-linux.so.2 here as multilib is based on x86_64, not on i686 -->
     63<screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
     64ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3</userinput></screen>
     65
     66    <para>Some of the Glibc programs use the non-FHS compliant
     67    <filename class="directory">/var/db</filename> directory to store their
     68    runtime data. Apply the following patch to make such programs store their
     69    runtime data in the FHS-compliant locations:</para>
     70
     71<screen><userinput remap="pre">patch -Np1 -i ../glibc-&glibc-version;-fhs-1.patch</userinput></screen>
     72
    4673    <para>The Glibc documentation recommends building Glibc
    4774    in a dedicated build directory:</para>
     
    5380
    5481<screen arch="default"><userinput remap="configure">../configure                             \
    55       --prefix=/tools                    \
     82      --prefix=/usr                      \
    5683      --host=$LFS_TGT                    \
    5784      --build=$(../scripts/config.guess) \
    5885      --enable-kernel=&min-kernel;                \
    59       --with-headers=/tools/include</userinput></screen>
     86      --with-headers=$LFS/usr/include    \
     87      libc_cv_slibdir=/lib</userinput></screen>
    6088<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure                             \
    61       --prefix=/tools                    \
     89      --prefix=/usr                      \
    6290      --host=$LFS_TGT                    \
    6391      --build=$(../scripts/config.guess) \
    6492      --enable-kernel=&min-kernel;                \
     93      --with-headers=$LFS/usr/include    \
    6594      --enable-multi-arch                \
    66       --with-headers=/tools/include</userinput></screen>
     95      --libdir=/usr/lib                  \
     96      --libexecdir=/usr/lib              \
     97      libc_cv_slibdir=/lib</userinput></screen>
    6798<!--
    6899      libc_cv_forced_unwind=yes          \
     
    76107        <listitem>
    77108          <para>The combined effect of these switches is that Glibc's build system
    78           configures itself to cross-compile, using the cross-linker and
    79           cross-compiler in <filename class="directory">/tools</filename>.</para>
     109          configures itself to be cross-compiled, using the cross-linker and
     110          cross-compiler in <filename class="directory">$LFS/tools</filename>.</para>
    80111        </listitem>
    81112      </varlistentry>
     
    90121      </varlistentry>
    91122
    92       <varlistentry arch="ml_32,ml_x32,ml_all">
    93         <term><parameter>--enable-multi-arch</parameter></term>
    94         <listitem>
    95           <para>Enables glibc for multiarch environments.</para>
    96         </listitem>
    97       </varlistentry>
    98 
    99       <varlistentry>
    100         <term><parameter>--with-headers=/tools/include</parameter></term>
    101         <listitem>
    102           <para>This tells Glibc to compile itself against the headers recently
    103           installed to the tools directory, so that it knows exactly what
    104           features the kernel has and can optimize itself accordingly.</para>
    105         </listitem>
    106       </varlistentry>
    107 <!--
    108       <varlistentry>
    109         <term><parameter>libc_cv_forced_unwind=yes</parameter></term>
    110         <listitem>
    111           <para>The linker installed during
    112           <xref linkend="ch-tools-binutils-pass1"/> was cross-compiled and as
    113           such cannot be used until Glibc has been installed.  This means that
    114           the configure test for force-unwind support will fail, as it relies on
    115           a working linker.  The libc_cv_forced_unwind=yes variable is passed in
    116           order to inform <command>configure</command> that force-unwind
    117           support is available without it having to run the test.</para>
    118         </listitem>
    119       </varlistentry>
    120       <varlistentry>
    121         <term><parameter>libc_cv_c_cleanup=yes</parameter></term>
    122         <listitem>
    123           <para>Similarly, we pass libc_cv_c_cleanup=yes through to the
    124           <command>configure</command> script so that the test is skipped and C
    125           cleanup handling support is configured.</para>
    126         </listitem>
    127       </varlistentry>
    128 -->
    129 <!--  <varlistentry>
    130         <term><parameter>libc_cv_ctors_header=yes</parameter></term>
    131         <listitem>
    132           <para>Similarly, we pass libc_cv_ctors_header=yes through to the
    133           <command>configure</command> script so that the test is skipped and
    134           gcc constructor support is configured.</para>
    135         </listitem>
    136       </varlistentry>-->
     123      <varlistentry>
     124        <term><parameter>--with-headers=$LFS/usr/include</parameter></term>
     125        <listitem>
     126          <para>This tells Glibc to compile itself against the headers
     127          recently installed to the $LFS/usr/include directory, so that
     128          it knows exactly what features the kernel has and can optimize
     129          itself accordingly.</para>
     130        </listitem>
     131      </varlistentry>
     132
     133      <varlistentry>
     134        <term><parameter>libc_cv_slibdir=/lib</parameter></term>
     135        <listitem>
     136          <para>This ensures that the library is installed in /lib instead
     137          of the default /lib64 on 64 bit machines.</para>
     138        </listitem>
     139      </varlistentry>
    137140
    138141    </variablelist>
     
    162165    <para>Install the package:</para>
    163166
    164 <screen><userinput remap="install">make install</userinput></screen>
    165 
    166   <caution>
    167     <para>At this point, it is imperative to stop and ensure that the basic
    168     functions (compiling and linking) of the new toolchain are working as
    169     expected. To perform a sanity check, run the following commands:</para>
     167    <warning><para>If <envar>LFS</envar> is not properly set, and despite the
     168    recommendations, you are building as root, the next command will install
     169    the newly built glibc to your host system, which most likely will render it
     170    unusable. So double check that the environment is correctly set for user
     171    <systemitem class="username">lfs</systemitem>.</para></warning>
     172
     173<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
     174
     175    <variablelist>
     176      <title>The meaning of the <command>make install</command> option:</title>
     177
     178      <varlistentry>
     179        <term><parameter>DESTDIR=$LFS</parameter></term>
     180        <listitem>
     181          <para>The <envar>DESTDIR</envar> make variable is used by almost all
     182          packages to define the location where the package should be
     183          installed. If it is not set, it defaults to the root (<filename
     184          class="directory">/</filename>) directory. Here we specify that
     185          the package be installed in <filename class="directory">$LFS
     186          </filename>, which will become the root after <xref linkend=
     187          "ch-tools-chroot"/>.</para>
     188        </listitem>
     189      </varlistentry>
     190
     191    </variablelist>
     192
     193    <caution>
     194      <para>At this point, it is imperative to stop and ensure that the basic
     195      functions (compiling and linking) of the new toolchain are working as
     196      expected. To perform a sanity check, run the following commands:</para>
    170197
    171198<screen><userinput>echo 'int main(){}' &gt; dummy.c
    172199$LFS_TGT-gcc dummy.c
    173 readelf -l a.out | grep ': /tools'</userinput></screen>
    174 
    175     <para>If everything is working correctly, there should be no errors,
    176     and the output of the last command will be of the form:</para>
    177 
    178 <screen><computeroutput>[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
    179 
    180     <para>Note that for 32-bit machines, the interpreter name will be
    181     <filename>/tools/lib/ld-linux.so.2</filename>.</para>
    182 
    183     <para>If the output is not shown as above or there was no output at all,
    184     then something is wrong. Investigate and retrace the steps to find out
    185     where the problem is and correct it. This issue must be resolved before
    186     continuing on.</para>
    187 
    188     <para>Once all is well, clean up the test files:</para>
     200readelf -l a.out | grep '/ld-linux'</userinput></screen>
     201
     202      <para>If everything is working correctly, there should be no errors,
     203      and the output of the last command will be of the form:</para>
     204
     205<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
     206
     207      <para arch="default">Note that for 32-bit machines, the interpreter name will be
     208      <filename>/lib/ld-linux.so.2</filename>.</para>
     209
     210      <para>If the output is not shown as above or there was no output at all,
     211      then something is wrong. Investigate and retrace the steps to find out
     212      where the problem is and correct it. This issue must be resolved before
     213      continuing on.</para>
     214
     215      <para>Once all is well, clean up the test files:</para>
    189216
    190217<screen><userinput>rm -v dummy.c a.out</userinput></screen>
    191218
    192   </caution>
    193 
    194   <note><para>Building Binutils in the section after next will serve as an
    195   additional check that the toolchain has been built properly. If Binutils
    196   fails to build, it is an indication that something has gone wrong with the
    197   previous Binutils, GCC, or Glibc installations.</para></note>
     219    </caution>
     220
     221    <note><para>Building packages in the next chapter will serve as an
     222    additional check that the toolchain has been built properly. If some
     223    package, especially binutils-pass2 or gcc-pass2, fails to build, it is
     224    an indication that something has gone wrong with the
     225    previous Binutils, GCC, or Glibc installations.</para></note>
     226
     227    <para>Now that our cross-toolchain is complete, finalize the installation
     228    of the limits.h header. For doing so, run a utility provided by the GCC
     229    developers:</para>
     230
     231<screen><userinput>$LFS/tools/libexec/gcc/$LFS_TGT/&gcc-version;/install-tools/mkheaders</userinput></screen>
    198232
    199233  </sect2>
    200234
    201   <sect2 arch="ml_32,ml_all" role="installation">
    202     <title>Installation of Glibc 32-bit</title>
    203 
    204     <para>Clean the build directory for redoing glibc for 32-bit:</para>
    205 <screen><userinput remap="pre">mkdir ../build32
    206 cd ../build32</userinput></screen>
    207 
    208     <para>Rebuild glibc for 32-bit:</para>
    209 <screen><userinput remap="configure">echo slibdir=/tools/lib32 &gt; configparms
    210 BUILD_CC="gcc -m32"               \
    211 CC="${LFS_TGT}-gcc -m32"          \
    212 CXX="${LFS_TGT}-g++ -m32"         \
    213 AR="${LFS_TGT}-ar"                \
    214 RANLIB="${LFS_TGT}-ranlib"        \
    215 ../configure --prefix=/tools                    \
    216              --build=$(../scripts/config.guess) \
    217              --host=${LFS_TGT32}                \
    218              --enable-kernel=&min-kernel;             \
    219              --with-headers=/tools/include      \
    220              --with-binutils=/tools/bin         \
    221              --enable-multi-arch                \
    222              --libdir=/tools/lib32              \
    223              --libexecdir=/tools/lib32</userinput></screen>
    224 <!--                      \
    225              libc_cv_forced_unwind=yes          \
    226              libc_cv_c_cleanup=yes</userinput></screen> -->
    227 
    228     <variablelist>
    229       <title>The meaning of the extra configure options:</title>
    230 
    231       <varlistentry>
    232         <term><parameter>--enable-multi-arch</parameter></term>
    233         <listitem>
    234           <para>Enables glibc for multiarch environments.</para>
    235         </listitem>
    236       </varlistentry>
    237 
    238       <varlistentry>
    239         <term><parameter>--libdir=/tools/lib32, --libexecdir=/tools/lib32</parameter></term>
    240         <listitem>
    241           <para>Overrides location for installing 32-bit files.</para>
    242         </listitem>
    243       </varlistentry>
    244 
    245       <varlistentry>
    246         <term><parameter>--with-binutils=/tools/bin</parameter></term>
    247         <listitem>
    248           <para>This tells Glibc to compile itself against the utilities
    249           found within our "tools" heirachy, because otherwise...</para>
    250         </listitem>
    251       </varlistentry>
    252 
    253     </variablelist>
    254 
    255     <para>Now compile the 32-bit version of glibc:</para>
     235  <!-- - - - - - - - - - -->
     236  <!-- Multilib - 32bit  -->
     237  <!-- - - - - - - - - - -->
     238  <sect2 arch="ml_32,ml_all">
     239    <title>Building Glibc - 32bit</title>
     240
     241    <para>Now recompile for m32. The extracted source can be
     242    reused but needs to cleaned before installing the m32
     243    version of Glibc.</para>
     244
     245    <para>Clear the build directory and remove artefacts from
     246    previous build:</para>
     247     
     248<screen><userinput remap="pre">make clean
     249find .. -name "*.a" -delete</userinput></screen>
     250
     251    <para>Configure Glibc for m32 with the following commands:</para>
     252
     253<screen><userinput remap="configure">CC="$LFS_TGT-gcc -m32" \
     254CXX="$LFS_TGT-g++ -m32" \
     255../configure                             \
     256      --prefix=/usr                      \
     257      --host=$LFS_TGT32                  \
     258      --build=$(../scripts/config.guess) \
     259      --enable-kernel=&min-kernel;                \
     260      --with-headers=$LFS/usr/include    \
     261      --enable-multi-arch                \
     262      --libdir=&usr-lib-m32;                \
     263      --libexecdir=&usr-lib-m32;            \
     264      libc_cv_slibdir=&lib-m32;</userinput></screen>
     265
     266    <para>Compile the package:</para>
     267
    256268<screen><userinput remap="make">make</userinput></screen>
    257269
    258     <para>Install 32-bit version of glibc:</para>
    259 <screen><userinput remap="install">make install_root="${PWD}/DESTDIR" install
    260 install -vdm755 /tools/lib32
    261 cp -Rv DESTDIR/tools/lib32/* /tools/lib32
    262 install -vm644 DESTDIR/tools/include/gnu/{lib-names,stubs}-32.h \
    263                /tools/include/gnu/
    264 ln -svf /tools/lib32/ld-linux.so.2 /tools/lib/</userinput></screen>
    265 
    266   </sect2>
    267 
    268   <sect2 arch="ml_x32,ml_all" role="installation">
    269     <title>Installation of Glibc x32-bit</title>
    270 
    271     <para>Create a build directory for redoing glibc for x32-bit:</para>
    272 <screen><userinput remap="pre">mkdir ../build32x
    273 cd ../build32x</userinput></screen>
    274 
    275     <para>Rebuild glibc for x32-bit:</para>
    276 <screen><userinput remap="configure">echo slibdir=/tools/libx32 &gt; configparms
    277 BUILD_CC="gcc -mx32"              \
    278 CC="${LFS_TGT}-gcc -mx32"         \
    279 CXX="${LFS_TGT}-g++ -mx32"        \
    280 AR="${LFS_TGT}-ar"                \
    281 RANLIB="${LFS_TGT}-ranlib"        \
    282 ../configure --prefix=/tools                    \
    283              --build=$(../scripts/config.guess) \
    284              --host=${LFS_TGTX32}               \
    285              --enable-kernel=&min-kernel;             \
    286              --with-headers=/tools/include      \
    287              --with-binutils=/tools/bin         \
    288              --enable-multi-arch                \
    289              --libdir=/tools/libx32             \
    290              --libexecdir=/tools/libx32</userinput></screen>
    291 <!--                      \
    292              libc_cv_forced_unwind=yes          \
    293              libc_cv_c_cleanup=yes</userinput></screen> -->
    294 
    295     <variablelist>
    296       <title>The meaning of the extra configure options:</title>
    297 
    298       <varlistentry>
    299         <term><parameter>--enable-multi-arch</parameter></term>
    300         <listitem>
    301           <para>Enables glibc for multiarch environments.</para>
    302         </listitem>
    303       </varlistentry>
    304 
    305       <varlistentry>
    306         <term><parameter>--libdir=/tools/libx32, --libexecdir=/tools/libx32</parameter></term>
    307         <listitem>
    308           <para>Overrides location for installing x32-bit files.</para>
    309         </listitem>
    310       </varlistentry>
    311 
    312       <varlistentry>
    313         <term><parameter>--with-binutils=/tools/bin</parameter></term>
    314         <listitem>
    315           <para>This tells Glibc to compile itself against the utilities
    316           found within our "tools" heirachy, because otherwise...</para>
    317         </listitem>
    318       </varlistentry>
    319 
    320     </variablelist>
    321 
    322     <para>Now compile the x32-bit version of glibc:</para>
    323 <screen><userinput remap="make">make</userinput></screen>
    324 
    325     <para>Install x32-bit version of glibc:</para>
    326 <screen><userinput remap="install">make install_root="${PWD}/DESTDIR" install
    327 install -vdm755 /tools/libx32
    328 cp -Rv DESTDIR/tools/libx32/* /tools/libx32
    329 install -vm644 DESTDIR/tools/include/gnu/lib-names-x32.h \
    330                /tools/include/gnu/
    331 [ -e DESTDIR/tools/include/gnu/stubs-x32.h ] \
    332   &amp;&amp; install -vm644 DESTDIR/tools/include/gnu/stubs-x32.h /tools/include/gnu/ \
    333   || ln -v /tools/include/gnu/stubs-64.h /tools/include/gnu/stubs-x32.h
    334 ln -svf /tools/libx32/ld-linux-x32.so.2 /tools/lib/</userinput></screen>
    335 <!-- For whatever reason the stubs-x32.h doesn't get created. The 'ln' above is
    336 just a "brute force" workaraound - by copying the stubs-64.h file. -->
    337 
    338   <caution>
    339     <para>At this point, it is imperative to stop and ensure that the basic
    340     functions (compiling and linking) of the new toolchain are working as
    341     expected. To perform a sanity check, run the following commands:</para>
     270    <para>Install the package:</para>
     271
     272<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     273cp -a DESTDIR&lib-m32;/*     $LFS&lib-m32;/
     274cp -a DESTDIR&usr-lib-m32; $LFS/usr/
     275install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
     276               $LFS/usr/include/gnu/
     277ln -svf ..&lib-m32;/ld-linux.so.2 $LFS/lib/ld-linux.so.2</userinput></screen>
     278
     279    <caution>
     280      <para>At this point, it is imperative to stop and ensure that the basic
     281      functions (compiling and linking) of the new toolchain are working as
     282      expected. To perform a sanity check, run the following commands:</para>
    342283
    343284<screen><userinput>echo 'int main(){}' &gt; dummy.c
    344285$LFS_TGT-gcc -m32 dummy.c
    345 readelf -l a.out | grep ': /tools'</userinput></screen>
    346 
    347     <para>If everything is working correctly, there should be no errors,
    348     and the output of the last command will be of the form:</para>
    349 
    350 <screen><computeroutput>[Requesting program interpreter: /tools/lib/ld-linux.so.2]</computeroutput></screen>
    351 
    352     <para>Redo test for x32-ABI:</para>
     286readelf -l a.out | grep '/ld-linux'</userinput></screen>
     287
     288      <para>If everything is working correctly, there should be no errors,
     289      and the output of the last command will be of the form:</para>
     290
     291<screen><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen>
     292
     293      <para>If the output is not shown as above or there was no output at all,
     294      then something is wrong. Investigate and retrace the steps to find out
     295      where the problem is and correct it. This issue must be resolved before
     296      continuing on.</para>
     297
     298      <para>Once all is well, clean up the test files:</para>
     299
     300<screen><userinput>rm -v dummy.c a.out</userinput></screen>
     301
     302    </caution>
     303
     304  </sect2><!-- m32 -->
     305
     306  <!-- - - - - - - - - - -->
     307  <!-- Multilib - x32bit -->
     308  <!-- - - - - - - - - - -->
     309 
     310  <sect2 arch="ml_x32,ml_all">
     311    <title>Building Glibc - x32bit</title>
     312
     313    <para>Now recompile for mx32. The extracted source can be
     314    reused but needs to cleaned before installing the mx32
     315    version of Glibc.</para>
     316
     317    <para>Clear the build directory and remove artefacts from
     318    previous build:</para>
     319     
     320<screen><userinput remap="pre">make clean
     321find .. -name "*.a" -delete</userinput></screen>
     322
     323    <para>Configure Glibc for mx32 with the following commands:</para>
     324
     325<screen><userinput remap="configure">CC="$LFS_TGT-gcc -mx32" \
     326CXX="$LFS_TGT-g++ -mx32" \
     327../configure                             \
     328      --prefix=/usr                      \
     329      --host=$LFS_TGTX32                 \
     330      --build=$(../scripts/config.guess) \
     331      --enable-kernel=&min-kernel;                \
     332      --with-headers=$LFS/usr/include    \
     333      --enable-multi-arch                \
     334      --libdir=&usr-lib-mx32;               \
     335      --libexecdir=&usr-lib-mx32;           \
     336      libc_cv_slibdir=&lib-mx32;</userinput></screen>
     337
     338    <para>Compile the package:</para>
     339
     340<screen><userinput remap="make">make</userinput></screen>
     341
     342    <para>Install the package:</para>
     343
     344<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     345cp -a DESTDIR&lib-mx32;/*     $LFS&lib-mx32;/
     346cp -a DESTDIR&usr-lib-mx32; $LFS/usr/
     347install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-x32.h \
     348               $LFS/usr/include/gnu/
     349ln -svf ..&lib-mx32;/ld-linux-x32.so.2 $LFS/lib/ld-linux-x32.so.2</userinput></screen>
     350
     351    <caution>
     352      <para>At this point, it is imperative to stop and ensure that the basic
     353      functions (compiling and linking) of the new toolchain are working as
     354      expected. To perform a sanity check, run the following commands:</para>
    353355
    354356<screen><userinput>echo 'int main(){}' &gt; dummy.c
    355357$LFS_TGT-gcc -mx32 dummy.c
    356 readelf -l a.out | grep ': /tools'</userinput></screen>
    357 
    358     <para>Output should be like:</para>
    359 
    360 <screen><computeroutput>[Requesting program interpreter: /tools/libx32/ld-linux-x32.so.2]</computeroutput></screen>
    361 
    362     <para>If the output is not shown as above or there was no output at all,
    363     then something is wrong. Investigate and retrace the steps to find out
    364     where the problem is and correct it. This issue must be resolved before
    365     continuing on.</para>
    366 
    367     <para>Once all is well, clean up the test files:</para>
     358readelf -l a.out | grep '/ld-linux-x32'</userinput></screen>
     359
     360      <para>If everything is working correctly, there should be no errors,
     361      and the output of the last command will be of the form:</para>
     362
     363<screen><computeroutput>[Requesting program interpreter: /lib/ld-linux-x32.so.2]</computeroutput></screen>
     364
     365      <para>If the output is not shown as above or there was no output at all,
     366      then something is wrong. Investigate and retrace the steps to find out
     367      where the problem is and correct it. This issue must be resolved before
     368      continuing on.</para>
     369
     370      <para>Once all is well, clean up the test files:</para>
    368371
    369372<screen><userinput>rm -v dummy.c a.out</userinput></screen>
    370373
    371   </caution>
    372   </sect2>
    373  
     374    </caution>
     375
     376  </sect2><!-- mx32 -->
     377
    374378  <sect2 role="content">
    375379    <title/>
  • chapter05/introduction.xml

    rd4fdde6 r37e35d2  
    1111  <title>Introduction</title>
    1212
    13   <para>This chapter shows how to build a minimal Linux system.
    14   This system will contain just enough tools to start constructing the final
    15   LFS system in <xref linkend="chapter-building-system"/> and allow a working
    16   environment with more user convenience than a minimum environment would.</para>
     13  <para>This chapter shows how to build a cross-compiler and its associated
     14  tools. Although here cross-compilation is faked, the principles are
     15  the same as for a real cross-toolchain.</para>
    1716
    18   <para>There are two steps in building this minimal system. The first step
    19   is to build a new and host-independent toolchain (compiler, assembler,
    20   linker, libraries, and a few useful utilities).  The second step uses this
    21   toolchain to build the other essential tools.</para>
    22 
    23   <para>The files compiled in this chapter will be installed under the
     17  <para>The programs compiled in this chapter will be installed under the
    2418  <filename class="directory">$LFS/tools</filename> directory to keep them
    25   separate from the files installed in the next chapter and the host
    26   production directories. Since the packages compiled here are temporary,
    27   we do not want them to pollute the soon-to-be LFS system.</para>
     19  separate from the files installed in the following chapters. The libraries,
     20  on the other hand, are installed into their final place, since they pertain
     21  to the system we want to build.</para>
    2822
    2923</sect1>
  • chapter05/libstdc++.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-tools-libstdcpp" role="wrap">
    9   <?dbhtml filename="gcc-libstdc++.html"?>
     8<sect1 id="ch-tools-libstdcpp-pass1" role="wrap">
     9  <?dbhtml filename="gcc-libstdc++-pass1.html"?>
    1010
    1111  <sect1info condition="script">
     
    1515  </sect1info>
    1616
    17   <title>Libstdc++ from GCC-&gcc-version;</title>
     17  <title>Libstdc++ from GCC-&gcc-version;, Pass 1</title>
    1818
    19   <indexterm zone="ch-tools-libstdcpp">
     19  <indexterm zone="ch-tools-libstdcpp-pass1">
    2020    <primary sortas="a-GCC">GCC</primary>
    21     <secondary>tools, libstdc++</secondary>
     21    <secondary>tools, libstdc++ pass 1</secondary>
    2222  </indexterm>
    2323
     
    2929    (part of GCC is written in C++), but we had to defer its installation
    3030    when we built <xref linkend="ch-tools-gcc-pass1"/>
    31     because it depends on glibc, which was not yet available in /tools.
     31    because it depends on glibc, which was not yet available in the target
     32    directory.
    3233    </para>
    3334
     
    3738
    3839      <seglistitem>
    39         <seg>&libstdcpp-ch5-sbu;</seg>
    40         <seg>&libstdcpp-ch5-du;</seg>
     40        <seg>&libstdcpp-tmpp1-sbu;</seg>
     41        <seg>&libstdcpp-tmpp1-du;</seg>
    4142      </seglistitem>
    4243    </segmentedlist>
     
    5354    </note>
    5455
    55     <para>Create a separate build directory for Libstdc++ and enter it:</para>
     56    <para>Create a separate build directory for libstdc++ and enter it:</para>
    5657
    5758<screen><userinput remap="pre">mkdir -v build
    5859cd       build</userinput></screen>
    5960
    60     <para>Prepare Libstdc++ for compilation:</para>
     61    <para>Prepare libstdc++ for compilation:</para>
    6162
    6263<screen><userinput remap="configure">../libstdc++-v3/configure           \
    6364    --host=$LFS_TGT                 \
    64     --prefix=/tools                 \
     65    --build=$(../config.guess)      \
     66    --prefix=/usr                   \
    6567    --disable-multilib              \
    66     --disable-nls                   \<!--
    67     - -disable-libstdcxx-threads     \-->
     68    --disable-nls                   \
    6869    --disable-libstdcxx-pch         \
    6970    --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
     
    7576        <term><parameter>--host=...</parameter></term>
    7677        <listitem>
    77           <para>Indicates to use the cross compiler we have just built
     78          <para>Specifies the use the cross compiler we have just built
    7879          instead of the one in <filename>/usr/bin</filename>.</para>
    7980        </listitem>
    8081      </varlistentry>
    81         <!--
    82       <varlistentry>
    83         <term><parameter>- -disable-libstdcxx-threads</parameter></term>
     82
     83      <varlistentry arch="ml_32,ml_x32,ml_all">
     84        <term><parameter>--disable-multilib</parameter></term>
    8485        <listitem>
    85           <para>Since gcc-pass1 is built without thread support, the C++
    86           thread library cannot be built either.</para>
     86          <para>Even when building the multilib version, this switch is
     87          given. This is because the additionally built libraries are
     88          not required in this stage and some disk space and compile
     89          time can be saved.</para>
    8790        </listitem>
    8891      </varlistentry>
    89         -->
     92
    9093      <varlistentry>
    9194        <term><parameter>--disable-libstdcxx-pch</parameter></term>
     
    99102        <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
    100103        <listitem>
    101           <para>This is the location where the standard include files are
    102           searched by the C++ compiler. In a normal build, this information
    103           is automatically passed to the Libstdc++ <command>configure</command>
     104          <para>This is the location where the C++ compiler should search for the
     105          standard include files. In a normal build, this information
     106          is automatically passed to the libstdc++ <command>configure</command>
    104107          options from the top level directory. In our case, this information
    105108          must be explicitly given.</para>
     
    115118    <para>Install the library:</para>
    116119
    117 <screen><userinput remap="install">make install</userinput></screen>
     120<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    118121
    119122  </sect2>
  • chapter05/linux-headers.xml

    rd4fdde6 r37e35d2  
    2525    <title/>
    2626
    27     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    28     href="../chapter06/linux-headers.xml"
    29     xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
     27    <para>The Linux API Headers (in linux-&linux-version;.tar.xz) expose the
     28    kernel's API for use by Glibc.</para>
    3029
    3130    <segmentedlist>
     
    3433
    3534      <seglistitem>
    36         <seg>&linux-headers-ch5-sbu;</seg>
    37         <seg>&linux-headers-ch5-du;</seg>
     35        <seg>&linux-headers-tmp-sbu;</seg>
     36        <seg>&linux-headers-tmp-du;</seg>
    3837      </seglistitem>
    3938    </segmentedlist>
     
    6160
    6261<screen><userinput remap="make">make headers
    63 </userinput><userinput remap="install">cp -rv usr/include/* /tools/include</userinput></screen>
     62find usr/include -name '.*' -delete
     63rm usr/include/Makefile
     64</userinput><userinput remap="install">cp -rv usr/include $LFS/usr</userinput></screen>
    6465
    6566  </sect2>
    6667
    67   <sect2 role="content">
    68     <title/>
    69 
    70     <para>Details on this package are located in
    71     <xref linkend="contents-linux-headers" role="."/></para>
     68  <sect2 id="contents-linux-headers" role="content">
     69    <title>Contents of Linux API Headers</title>
     70
     71    <segmentedlist>
     72      <segtitle>Installed headers</segtitle>
     73      <segtitle>Installed directories</segtitle>
     74
     75      <seglistitem>
     76        <seg>/usr/include/asm/*.h, /usr/include/asm-generic/*.h,
     77        /usr/include/drm/*.h, /usr/include/linux/*.h, /usr/include/misc/*.h,
     78        /usr/include/mtd/*.h, /usr/include/rdma/*.h, /usr/include/scsi/*.h,
     79        /usr/include/sound/*.h, /usr/include/video/*.h,
     80        and /usr/include/xen/*.h</seg>
     81        <seg>/usr/include/asm, /usr/include/asm-generic, /usr/include/drm,
     82        /usr/include/linux, /usr/include/misc, /usr/include/mtd,
     83        /usr/include/rdma, /usr/include/scsi, /usr/include/sound,
     84        /usr/include/video, and /usr/include/xen</seg>
     85      </seglistitem>
     86    </segmentedlist>
     87
     88    <variablelist>
     89      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
     90      <?dbfo list-presentation="list"?>
     91      <?dbhtml list-presentation="table"?>
     92
     93      <varlistentry id="asm">
     94        <term><filename class="headerfile">/usr/include/asm/*.h</filename></term>
     95        <listitem>
     96          <para>The Linux API ASM Headers</para>
     97          <indexterm zone="ch-tools-linux-headers asm">
     98            <primary sortas="e-/usr/include/asm/*.h">/usr/include/asm/*.h</primary>
     99          </indexterm>
     100        </listitem>
     101      </varlistentry>
     102
     103     <varlistentry id="asm-generic">
     104        <term><filename class="headerfile">/usr/include/asm-generic/*.h</filename></term>
     105        <listitem>
     106          <para>The Linux API ASM Generic Headers</para>
     107          <indexterm zone="ch-tools-linux-headers asm-generic">
     108            <primary sortas="e-/usr/include/asm-generic/*.h">/usr/include/asm-generic/*.h</primary>
     109          </indexterm>
     110        </listitem>
     111      </varlistentry>
     112
     113      <varlistentry id="drm">
     114        <term><filename class="headerfile">/usr/include/drm/*.h</filename></term>
     115        <listitem>
     116          <para>The Linux API DRM Headers</para>
     117          <indexterm zone="ch-tools-linux-headers drm">
     118            <primary sortas="e-/usr/include/drm/*.h">/usr/include/drm/*.h</primary>
     119          </indexterm>
     120        </listitem>
     121      </varlistentry>
     122
     123      <varlistentry id="linux">
     124        <term><filename class="headerfile">/usr/include/linux/*.h</filename></term>
     125        <listitem>
     126          <para>The Linux API Linux Headers</para>
     127          <indexterm zone="ch-tools-linux-headers linux">
     128            <primary sortas="e-/usr/include/linux/*.h">/usr/include/linux/*.h</primary>
     129          </indexterm>
     130        </listitem>
     131      </varlistentry>
     132
     133      <varlistentry id="misc">
     134        <term><filename class="headerfile">/usr/include/misc/*.h</filename></term>
     135        <listitem>
     136          <para>The Linux API Miscellaneous Headers</para>
     137          <indexterm zone="ch-tools-linux-headers misc">
     138            <primary sortas="e-/usr/include/misc/*.h">/usr/include/misc/*.h</primary>
     139          </indexterm>
     140        </listitem>
     141      </varlistentry>
     142
     143      <varlistentry id="mtd">
     144        <term><filename class="headerfile">/usr/include/mtd/*.h</filename></term>
     145        <listitem>
     146          <para>The Linux API MTD Headers</para>
     147          <indexterm zone="ch-tools-linux-headers mtd">
     148            <primary sortas="e-/usr/include/mtd/*.h">/usr/include/mtd/*.h</primary>
     149          </indexterm>
     150        </listitem>
     151      </varlistentry>
     152
     153      <varlistentry id="rdma">
     154        <term><filename class="headerfile">/usr/include/rdma/*.h</filename></term>
     155        <listitem>
     156          <para>The Linux API RDMA Headers</para>
     157          <indexterm zone="ch-tools-linux-headers rdma">
     158            <primary sortas="e-/usr/include/rdma/*.h">/usr/include/rdma/*.h</primary>
     159         </indexterm>
     160        </listitem>
     161      </varlistentry>
     162
     163      <varlistentry id="scsi">
     164        <term><filename class="headerfile">/usr/include/scsi/*.h</filename></term>
     165        <listitem>
     166          <para>The Linux API SCSI Headers</para>
     167          <indexterm zone="ch-tools-linux-headers scsi">
     168            <primary sortas="e-/usr/include/scsi/*.h">/usr/include/scsi/*.h</primary>
     169          </indexterm>
     170        </listitem>
     171      </varlistentry>
     172
     173      <varlistentry id="sound">
     174        <term><filename class="headerfile">/usr/include/sound/*.h</filename></term>
     175        <listitem>
     176          <para>The Linux API Sound Headers</para>
     177          <indexterm zone="ch-tools-linux-headers sound">
     178           <primary sortas="e-/usr/include/sound/*.h">/usr/include/sound/*.h</primary>
     179          </indexterm>
     180        </listitem>
     181      </varlistentry>
     182
     183      <varlistentry id="video">
     184        <term><filename class="headerfile">/usr/include/video/*.h</filename></term>
     185        <listitem>
     186          <para>The Linux API Video Headers</para>
     187          <indexterm zone="ch-tools-linux-headers video">
     188            <primary sortas="e-/usr/include/video/*.h">/usr/include/video/*.h</primary>
     189          </indexterm>
     190        </listitem>
     191      </varlistentry>
     192
     193      <varlistentry id="xen">
     194        <term><filename class="headerfile">/usr/include/xen/*.h</filename></term>
     195        <listitem>
     196          <para>The Linux API Xen Headers</para>
     197          <indexterm zone="ch-tools-linux-headers xen">
     198            <primary sortas="e-/usr/include/xen/*.h">/usr/include/xen/*.h</primary>
     199          </indexterm>
     200        </listitem>
     201      </varlistentry>
     202
     203    </variablelist>
    72204
    73205  </sect2>
  • chapter06/bash.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-system-bash" role="wrap">
     8<sect1 id="ch-tools-bash" role="wrap">
    99  <?dbhtml filename="bash.html"?>
    1010
     
    1717  <title>Bash-&bash-version;</title>
    1818
    19   <indexterm zone="ch-system-bash">
     19  <indexterm zone="ch-tools-bash">
    2020    <primary sortas="a-Bash">Bash</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Bash package contains the Bourne-Again SHell.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/bash.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2730
    2831    <segmentedlist>
     
    3134
    3235      <seglistitem>
    33         <seg>&bash-ch6-sbu;</seg>
    34         <seg>&bash-ch6-du;</seg>
     36        <seg>&bash-tmp-sbu;</seg>
     37        <seg>&bash-tmp-du;</seg>
    3538      </seglistitem>
    3639    </segmentedlist>
     
    4144    <title>Installation of Bash</title>
    4245
    43     <para>Incorporate some upstream fixes:</para>
    44 
    45 <screen><userinput remap="pre">patch -Np1 -i ../&bash-fixes-patch;</userinput></screen>
    46 
    4746    <para>Prepare Bash for compilation:</para>
    4847
    49 <screen><userinput remap="configure">./configure --prefix=/usr                    \
    50             --docdir=/usr/share/doc/bash-&bash-version; \
    51             --without-bash-malloc            \
    52             --with-installed-readline</userinput></screen>
     48<screen><userinput remap="configure">./configure --prefix=/usr                   \
     49            --build=$(support/config.guess) \
     50            --host=$LFS_TGT                 \
     51            --without-bash-malloc</userinput></screen>
    5352
    5453    <variablelist>
    55       <title>The meaning of the new configure option:</title>
     54      <title>The meaning of the configure options:</title>
    5655
    5756      <varlistentry>
    58         <term><parameter>--with-installed-readline</parameter></term>
     57        <term><parameter>--without-bash-malloc</parameter></term>
    5958        <listitem>
    60           <para>This option tells Bash to use the <filename
    61           class="libraryfile">readline</filename> library that is already
    62           installed on the system rather than using its own readline
    63           version.</para>
     59          <para>This option turns off the use of Bash's memory allocation
     60          (<function>malloc</function>) function which is known to cause
     61          segmentation faults. By turning this option off, Bash will use
     62          the <function>malloc</function> functions from Glibc which are
     63          more stable.</para>
    6464        </listitem>
    6565      </varlistentry>
     
    7171<screen><userinput remap="make">make</userinput></screen>
    7272
    73     <para>Skip down to <quote>Install the
    74     package</quote> if not running the test suite.</para>
     73    <para>Install the package:</para>
    7574
    76     <para>To prepare the tests, ensure that the <systemitem class="username">tester</systemitem> user can write to the sources tree:</para>
     75<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    7776
    78 <screen><userinput remap="test">chown -Rv tester .</userinput></screen>
     77    <para>Move the excutable to where it is expected:</para>
    7978
    80     <para>Now, run the tests as the <systemitem
    81     class="username">tester</systemitem> user:</para>
     79<screen><userinput remap="install">mv $LFS/usr/bin/bash $LFS/bin/bash</userinput></screen>
    8280
    83 <screen><userinput remap="test">su tester &lt;&lt; EOF
    84 PATH=$PATH make tests &lt; $(tty)
    85 EOF</userinput></screen>
     81    <para>Make a link for the programs that use <command>sh</command> for
     82    a shell:</para>
    8683
    87     <para>The <systemitem class="username">tester</systemitem>
    88     user does not have enough permissions for all the tests to pass. This shows
    89     up in some <quote>diff</quote> output in four test results. Portions of the
    90     run-execscript, run-lastpipe, run-read, and run-test programs
    91     are known to fail in the LFS chroot environment, but pass if the tests
    92     are run in a full system.</para>
    93 
    94     <para>Install the package and move the main executable to
    95     <filename class='directory'>/bin</filename>:</para>
    96 
    97 <screen><userinput remap="install">make install
    98 mv -vf /usr/bin/bash /bin</userinput></screen>
    99 
    100     <para>Run the newly compiled <command>bash</command> program (replacing the one that is
    101     currently being executed):</para>
    102 
    103 <screen role="nodump"><userinput>exec /bin/bash --login +h</userinput></screen>
    104 
    105     <note>
    106       <para>The parameters used make the <command>bash</command>
    107       process an interactive login shell and continue to disable hashing so
    108       that new programs are found as they become available.</para>
    109     </note>
     84<screen><userinput remap="install">ln -sv bash $LFS/bin/sh</userinput></screen>
    11085
    11186  </sect2>
    11287
    113   <sect2 id="contents-bash" role="content">
    114     <title>Contents of Bash</title>
     88  <sect2 role="content">
     89    <title/>
    11590
    116     <segmentedlist>
    117       <segtitle>Installed programs</segtitle>
    118       <segtitle>Installed directory</segtitle>
    119 
    120       <seglistitem>
    121         <seg>bash, bashbug, and sh (link to bash)</seg>
    122         <seg>/usr/include/bash, /usr/lib/bash, and
    123         /usr/share/doc/bash-&bash-version;</seg>
    124       </seglistitem>
    125     </segmentedlist>
    126 
    127     <variablelist>
    128       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    129       <?dbfo list-presentation="list"?>
    130       <?dbhtml list-presentation="table"?>
    131 
    132       <varlistentry id="bash">
    133         <term><command>bash</command></term>
    134         <listitem>
    135           <para>A widely-used command interpreter; it performs many types of
    136           expansions and substitutions on a given command line before executing
    137           it, thus making this interpreter a powerful tool</para>
    138           <indexterm zone="ch-system-bash bash">
    139             <primary sortas="b-bash">bash</primary>
    140           </indexterm>
    141         </listitem>
    142       </varlistentry>
    143 
    144       <varlistentry id="bashbug">
    145         <term><command>bashbug</command></term>
    146         <listitem>
    147           <para>A shell script to help the user compose and mail standard
    148           formatted bug reports concerning <command>bash</command></para>
    149           <indexterm zone="ch-system-bash bashbug">
    150             <primary sortas="b-bashbug">bashbug</primary>
    151           </indexterm>
    152         </listitem>
    153       </varlistentry>
    154 
    155       <varlistentry id="sh">
    156         <term><command>sh</command></term>
    157         <listitem>
    158           <para>A symlink to the <command>bash</command> program; when invoked
    159           as <command>sh</command>, <command>bash</command> tries to mimic the
    160           startup behavior of historical versions of <command>sh</command> as
    161           closely as possible, while conforming to the POSIX standard as
    162           well</para>
    163           <indexterm zone="ch-system-bash sh">
    164             <primary sortas="b-sh">sh</primary>
    165           </indexterm>
    166         </listitem>
    167       </varlistentry>
    168 
    169     </variablelist>
     91    <para>Details on this package are located in
     92    <xref linkend="contents-bash" role="."/></para>
    17093
    17194  </sect2>
  • chapter06/chapter06.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <chapter id="chapter-building-system" xreflabel="Chapter&nbsp;6">
     8<chapter id="chapter-temporary-tools" xreflabel="Chapter&nbsp;6">
    99  <?dbhtml dir="chapter06"?>
    1010  <?dbhtml filename="chapter06.html"?>
    1111
    12   <title>Installing Basic System Software</title>
     12  <title>Cross Compiling Temporary Tools</title>
    1313
    1414  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
    15   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kernfs.xml"/>
    16   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pkgmgt.xml"/>
    17   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chroot.xml"/>
    18   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingdirs.xml"/>
    19   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="createfiles.xml"/>
    20   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="linux-headers.xml"/>
    21   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="man-pages.xml"/>
    22   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="glibc.xml"/>
    23   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="adjusting.xml"/>
    24 
    25   <!-- arch="ml_32,ml_x32,ml_all" only -->
    26   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="glibc-32.xml"/>
    27 
     15  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="m4.xml"/>
     16  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ncurses.xml"/>
     17  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bash.xml"/>
     18  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="coreutils.xml"/>
     19  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="diffutils.xml"/>
     20  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="file.xml"/>
     21  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
     22  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gawk.xml"/>
     23  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grep.xml"/>
     24  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gzip.xml"/>
    2825  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zlib.xml"/>
    29   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bzip2.xml"/>
    30   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xz.xml"/>
    31   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zstd.xml"/>
    32   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="file.xml"/>
    33   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="readline.xml"/>
    34   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="m4.xml"/>
    35   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bc.xml"/>
    36   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="flex.xml"/>
    37   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils.xml"/>
    38   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gmp.xml"/>
    39   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpfr.xml"/>
    40   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpc.xml"/>
    41   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="isl.xml"/>
    42   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="attr.xml"/>
    43   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="acl.xml"/>
    44   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libcap.xml"/>
    45   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="shadow.xml"/>
    46   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc.xml"/>
    47   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pkgconfig.xml"/>
    48   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ncurses.xml"/>
    49   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sed.xml"/>
    50   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="psmisc.xml"/>
    51   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="iana-etc.xml"/>
    52   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gettext.xml"/>
    53   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bison.xml"/>
    54   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grep.xml"/>
    55   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bash.xml"/>
    56   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libtool.xml"/>
    57   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gdbm.xml"/>
    58   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gperf.xml"/>
    59   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="expat.xml"/>
    60   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="inetutils.xml"/>
    61   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="perl.xml"/>
    62   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xml-parser.xml"/>
    63   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="intltool.xml"/>
    64   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="autoconf.xml"/>
    65   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="automake.xml"/>
    66   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kmod.xml"/>
    67   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libelf.xml"/>
    68   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libffi.xml"/>
    69   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="openssl.xml"/>
    70   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="python.xml"/>
    71   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ninja.xml"/>
    72   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="meson.xml"/>
    73   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="coreutils.xml"/>
    74   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="check.xml"/>
    75   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="diffutils.xml"/>
    76   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gawk.xml"/>
    77   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
    78   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="groff.xml"/>
    79   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grub.xml"/>
    80   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="less.xml"/>
    81   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gzip.xml"/>
    82   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="iproute2.xml"/>
    83   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kbd.xml"/>
    84   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libpipeline.xml"/>
    8526  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="make.xml"/>
    8627  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="patch.xml"/>
    87   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="man-db.xml"/>
     28  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sed.xml"/>
    8829  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tar.xml"/>
    89   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.xml"/>
    90   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="vim.xml"/>
    91 
    92   <!-- systemd only -->
    93   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="systemd.xml"/>
    94   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dbus.xml"/>
    95 
    96   <!-- sysv only -->
    97   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="eudev.xml"/>
    98 
    99   <!-- Both sysv on systemd builds -->
    100   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="procps.xml"/>
    101   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
    102 
    103   <!-- Both sysv and systemd builds -->
    104   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="e2fsprogs.xml"/>
    105 
    106   <!-- sysv only -->
    107   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysklogd.xml"/>
    108   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysvinit.xml"/>
    109 
    110   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="linux-firmware.xml"/>
    111   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutdebug.xml"/>
    112   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="strippingagain.xml"/>
    113   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="revisedchroot.xml"/>
     30  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xz.xml"/>
     31  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils-pass2.xml"/>
     32  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-pass2.xml"/>
    11433
    11534</chapter>
  • chapter06/coreutils.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-system-coreutils" role="wrap">
     8<sect1 id="ch-tools-coreutils" role="wrap">
    99  <?dbhtml filename="coreutils.html"?>
    1010
     
    1717  <title>Coreutils-&coreutils-version;</title>
    1818
    19   <indexterm zone="ch-system-coreutils">
     19  <indexterm zone="ch-tools-coreutils">
    2020    <primary sortas="a-Coreutils">Coreutils</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Coreutils package contains utilities for showing and setting the
    27     basic system characteristics.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/coreutils.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2830
    2931    <segmentedlist>
     
    3234
    3335      <seglistitem>
    34         <seg>&coreutils-ch6-sbu;</seg>
    35         <seg>&coreutils-ch6-du;</seg>
     36        <seg>&coreutils-tmp-sbu;</seg>
     37        <seg>&coreutils-tmp-du;</seg>
    3638      </seglistitem>
    3739    </segmentedlist>
     
    4244    <title>Installation of Coreutils</title>
    4345
    44     <para>POSIX requires that programs from Coreutils recognize character
    45     boundaries correctly even in multibyte locales. The following patch fixes
    46     this non-compliance and other internationalization-related bugs.</para>
     46    <para>Prepare Coreutils for compilation:</para>
    4747
    48 <screen><userinput remap="pre">patch -Np1 -i ../&coreutils-i18n-patch;</userinput></screen>
    49 
    50     <note>
    51       <para>In the past, many bugs were found in this patch. When reporting new
    52       bugs to Coreutils maintainers, please check first if they are reproducible
    53       without this patch.</para>
    54     </note>
    55 
    56    <!-- this has been fixed in upstream gnulib, when a new version of
    57    coreutils is released, please check #4055 to see if the change has been
    58    picked up in this package -->
    59    <para>Suppress a test which on some machines can loop forever:</para>
    60 
    61 <screen><userinput remap="pre">sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk</userinput></screen>
    62 
    63     <para>Now prepare Coreutils for compilation:</para>
    64 
    65 <screen><userinput remap="configure">autoreconf -fiv
    66 FORCE_UNSAFE_CONFIGURE=1 ./configure \
    67             --prefix=/usr            \
     48<screen><userinput remap="configure">./configure --prefix=/usr                     \
     49            --host=$LFS_TGT                   \
     50            --build=$(build-aux/config.guess) \
     51            --enable-install-program=hostname \
    6852            --enable-no-install-program=kill,uptime</userinput></screen>
    6953
     
    7256
    7357      <varlistentry>
    74         <term><command>autoreconf</command></term>
     58        <term><envar>--enable-install-program=hostname</envar></term>
    7559        <listitem>
    76           <para>This command updates generated configuration files
    77           consistent with the latest version of automake.
    78           </para>
    79         </listitem>
    80       </varlistentry>
    81 
    82       <varlistentry>
    83         <term><envar>FORCE_UNSAFE_CONFIGURE=1</envar></term>
    84         <listitem>
    85           <para>This environment variable allows the package to be
    86           built as the root user.
    87           </para>
    88         </listitem>
    89       </varlistentry>
    90 
    91       <varlistentry>
    92         <term><parameter>--enable-no-install-program=kill,uptime</parameter></term>
    93         <listitem>
    94           <para>The purpose of this switch is to prevent Coreutils from
    95           installing binaries that will be installed by other packages later.
    96           </para>
     60          <para>This enables the <command>hostname</command> binary to be built
     61          and installed &ndash; it is disabled by default but is required by the
     62          Perl test suite.</para>
    9763        </listitem>
    9864      </varlistentry>
     
    10369<screen><userinput remap="make">make</userinput></screen>
    10470
    105     <para>Skip down to <quote>Install the
    106     package</quote> if not running the test suite.</para>
    107 
    108     <para>Now the test suite is ready to be run. First, run the tests that are
    109     meant to be run as user <systemitem class="username">root</systemitem>:</para>
    110 
    111 <screen><userinput remap="test">make NON_ROOT_USERNAME=tester check-root</userinput></screen>
    112 
    113     <para>We're going to run the remainder of the tests as the
    114     <systemitem class="username">tester</systemitem> user. Certain tests,
    115     however, require that the user be a member of more than one group. So that
    116     these tests are not skipped we'll add a temporary group and make the
    117     user <systemitem class="username">tester</systemitem> a part of it:</para>
    118 
    119 <screen><userinput remap="test">echo "dummy:x:102:tester" &gt;&gt; /etc/group</userinput></screen>
    120 
    121     <para>Fix some of the permissions so that the non-root user can compile and
    122     run the tests:</para>
    123 
    124 <screen><userinput remap="test">chown -Rv tester . </userinput></screen>
    125 
    126     <para>Now run the tests. Make sure the PATH in the <userinput>su</userinput>
    127     environment includes /tools/bin.</para>
    128 
    129 <screen><userinput remap="test">su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen>
    130 <!--
    131     <para>The test program test-getlogin is known to fail in a
    132     partially built system environment like the chroot environment here, but
    133     passes if run at the end of this chapter.  The test program tty.sh is
    134     also known to fail.</para>
    135 -->
    136 
    137     <para>Remove the temporary group:</para>
    138 
    139 <screen><userinput remap="test">sed -i '/dummy/d' /etc/group</userinput></screen>
    14071    <para>Install the package:</para>
    14172
    142 <screen><userinput remap="install">make install</userinput></screen>
     73<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
     74<!--
     75    <para>The above command refuses to install <filename>su</filename>
     76    because the program cannot be installed setuid root as a non-privileged
     77    user. By manually installing it, we can use it for running tests in the
     78    final system as a non-privileged user. Install it with:</para>
    14379
    144     <para>Move programs to the locations specified by the FHS:</para>
     80<screen><userinput remap="install">cp -v src/su /tools/bin</userinput></screen>
     81-->
     82    <para>Move programs to their final expected locations. Although this is
     83    not necessary in this temporary environment, we must do so because some
     84    programs harcode executable locations:</para>
    14585
    146 <screen><userinput remap="install">mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
    147 mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
    148 mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
    149 mv -v /usr/bin/chroot /usr/sbin
    150 mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
    151 sed -i s/\"1\"/\"8\"/1 /usr/share/man/man8/chroot.8</userinput></screen>
    152 
    153     <para revision="sysv">Some of the scripts in the LFS-Bootscripts package
    154     depend on <command>head</command>, <command>nice</command>,
    155     <command>sleep</command>, and <command>touch</command>.  As <filename
    156     class="directory">/usr</filename> may not be available during the early and
    157     late stages of booting, those binaries need to be on the root partition to
    158     maintain FHS compliance:</para>
    159 
    160 <screen><userinput remap="install">mv -v /usr/bin/{head,nice,sleep,touch} /bin</userinput></screen>
     86<screen><userinput remap="install">mv -v $LFS/usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} $LFS/bin
     87mv -v $LFS/usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm}        $LFS/bin
     88mv -v $LFS/usr/bin/{rmdir,stty,sync,true,uname}               $LFS/bin
     89mv -v $LFS/usr/bin/{head,nice,sleep,touch}                    $LFS/bin
     90mv -v $LFS/usr/bin/chroot                                     $LFS/usr/sbin
     91mkdir -pv $LFS/usr/share/man/man8
     92mv -v $LFS/usr/share/man/man1/chroot.1                        $LFS/usr/share/man/man8/chroot.8
     93sed -i 's/"1"/"8"/'                                           $LFS/usr/share/man/man8/chroot.8</userinput></screen>
    16194
    16295  </sect2>
    16396
    164   <sect2 id="contents-coreutils" role="content">
    165     <title>Contents of Coreutils</title>
     97  <sect2 role="content">
     98    <title/>
    16699
    167     <segmentedlist>
    168       <segtitle>Installed programs</segtitle>
    169       <segtitle>Installed library</segtitle>
    170       <segtitle>Installed directory</segtitle>
    171 
    172       <seglistitem>
    173         <seg>[, b2sum, base32, base64, basename, basenc, cat, chcon, chgrp, chmod, chown,
    174         chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors,
    175         dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups,
    176         head, hostid, id, install, join, link, ln, logname, ls, md5sum, mkdir,
    177         mkfifo, mknod, mktemp, mv, nice, nl, nohup, nproc, numfmt, od, paste,
    178         pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, realpath, rm,
    179         rmdir, runcon, seq, sha1sum, sha224sum, sha256sum, sha384sum,
    180         sha512sum, shred, shuf, sleep, sort, split, stat, stdbuf, stty, sum,
    181         sync, tac, tail, tee, test, timeout, touch, tr, true, truncate, tsort,
    182         tty, uname, unexpand, uniq, unlink, users, vdir, wc, who, whoami, and
    183         yes</seg>
    184         <seg>libstdbuf.so (in /usr/libexec/coreutils)</seg>
    185         <seg>/usr/libexec/coreutils</seg>
    186       </seglistitem>
    187     </segmentedlist>
    188 
    189     <variablelist>
    190       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    191       <?dbfo list-presentation="list"?>
    192       <?dbhtml list-presentation="table"?>
    193 
    194       <varlistentry id="base32">
    195         <term><command>base32</command></term>
    196         <listitem>
    197           <para>Encodes and decodes data according to the base32 specification
    198           (RFC 4648)</para>
    199           <indexterm zone="ch-system-coreutils base64">
    200             <primary sortas="b-base64">base64</primary>
    201           </indexterm>
    202         </listitem>
    203       </varlistentry>
    204 
    205       <varlistentry id="base64">
    206         <term><command>base64</command></term>
    207         <listitem>
    208           <para>Encodes and decodes data according to the base64 specification
    209           (RFC 4648)</para>
    210           <indexterm zone="ch-system-coreutils base64">
    211             <primary sortas="b-base64">base64</primary>
    212           </indexterm>
    213         </listitem>
    214       </varlistentry>
    215 
    216       <varlistentry id="b2sum">
    217         <term><command>b2sum</command></term>
    218         <listitem>
    219           <para>Prints or checks BLAKE2 (512-bit) checksums</para>
    220           <indexterm zone="ch-system-coreutils b2sum">
    221             <primary sortas="b-b2sum">b2sum</primary>
    222           </indexterm>
    223         </listitem>
    224       </varlistentry>
    225 
    226       <varlistentry id="basename">
    227         <term><command>basename</command></term>
    228         <listitem>
    229           <para>Strips any path and a given suffix from a file name</para>
    230           <indexterm zone="ch-system-coreutils basename">
    231             <primary sortas="b-basename">basename</primary>
    232           </indexterm>
    233         </listitem>
    234       </varlistentry>
    235 
    236       <varlistentry id="basenc">
    237         <term><command>basenc</command></term>
    238         <listitem>
    239           <para>Encodes or decodes data using various algorithms</para>
    240           <indexterm zone="ch-system-coreutils basenc">
    241             <primary sortas="b-basenc">basenc</primary>
    242           </indexterm>
    243         </listitem>
    244       </varlistentry>
    245 
    246       <varlistentry id="cat">
    247         <term><command>cat</command></term>
    248         <listitem>
    249           <para>Concatenates files to standard output</para>
    250           <indexterm zone="ch-system-coreutils cat">
    251             <primary sortas="b-cat">cat</primary>
    252           </indexterm>
    253         </listitem>
    254       </varlistentry>
    255 
    256       <varlistentry id="chcon">
    257         <term><command>chcon</command></term>
    258         <listitem>
    259           <para>Changes security context for files and directories</para>
    260           <indexterm zone="ch-system-coreutils chcon">
    261             <primary sortas="b-chcon">chcon</primary>
    262           </indexterm>
    263         </listitem>
    264       </varlistentry>
    265 
    266       <varlistentry id="chgrp">
    267         <term><command>chgrp</command></term>
    268         <listitem>
    269           <para>Changes the group ownership of files and directories</para>
    270           <indexterm zone="ch-system-coreutils chgrp">
    271             <primary sortas="b-chgrp">chgrp</primary>
    272           </indexterm>
    273         </listitem>
    274       </varlistentry>
    275 
    276       <varlistentry id="chmod">
    277         <term><command>chmod</command></term>
    278         <listitem>
    279           <para>Changes the permissions of each file to the given mode; the mode
    280           can be either a symbolic representation of the changes to make or an
    281           octal number representing the new permissions</para>
    282           <indexterm zone="ch-system-coreutils chmod">
    283             <primary sortas="b-chmod">chmod</primary>
    284           </indexterm>
    285         </listitem>
    286       </varlistentry>
    287 
    288       <varlistentry id="chown">
    289         <term><command>chown</command></term>
    290         <listitem>
    291           <para>Changes the user and/or group ownership of files and
    292           directories</para>
    293           <indexterm zone="ch-system-coreutils chown">
    294             <primary sortas="b-chown">chown</primary>
    295           </indexterm>
    296         </listitem>
    297       </varlistentry>
    298 
    299       <varlistentry id="chroot">
    300         <term><command>chroot</command></term>
    301         <listitem>
    302           <para>Runs a command with the specified directory as the
    303           <filename class="directory">/</filename> directory</para>
    304           <indexterm zone="ch-system-coreutils chroot">
    305             <primary sortas="b-chroot">chroot</primary>
    306           </indexterm>
    307         </listitem>
    308       </varlistentry>
    309 
    310       <varlistentry id="cksum">
    311         <term><command>cksum</command></term>
    312         <listitem>
    313           <para>Prints the Cyclic Redundancy Check (CRC) checksum and the byte
    314           counts of each specified file</para>
    315           <indexterm zone="ch-system-coreutils cksum">
    316             <primary sortas="b-cksum">cksum</primary>
    317           </indexterm>
    318         </listitem>
    319       </varlistentry>
    320 
    321       <varlistentry id="comm">
    322         <term><command>comm</command></term>
    323         <listitem>
    324           <para>Compares two sorted files, outputting in three columns the lines
    325           that are unique and the lines that are common</para>
    326           <indexterm zone="ch-system-coreutils comm">
    327             <primary sortas="b-comm">comm</primary>
    328           </indexterm>
    329         </listitem>
    330       </varlistentry>
    331 
    332       <varlistentry id="cp">
    333         <term><command>cp</command></term>
    334         <listitem>
    335           <para>Copies files</para>
    336           <indexterm zone="ch-system-coreutils cp">
    337             <primary sortas="b-cp">cp</primary>
    338           </indexterm>
    339         </listitem>
    340       </varlistentry>
    341 
    342       <varlistentry id="csplit">
    343         <term><command>csplit</command></term>
    344         <listitem>
    345           <para>Splits a given file into several new files, separating them
    346           according to given patterns or line numbers and outputting the byte
    347           count of each new file</para>
    348           <indexterm zone="ch-system-coreutils csplit">
    349             <primary sortas="b-csplit">csplit</primary>
    350           </indexterm>
    351         </listitem>
    352       </varlistentry>
    353 
    354       <varlistentry id="cut">
    355         <term><command>cut</command></term>
    356         <listitem>
    357           <para>Prints sections of lines, selecting the parts according to given
    358           fields or positions</para>
    359           <indexterm zone="ch-system-coreutils cut">
    360             <primary sortas="b-cut">cut</primary>
    361           </indexterm>
    362         </listitem>
    363       </varlistentry>
    364 
    365       <varlistentry id="date">
    366         <term><command>date</command></term>
    367         <listitem>
    368           <para>Displays the current time in the given format, or sets the
    369           system date</para>
    370           <indexterm zone="ch-system-coreutils date">
    371             <primary sortas="b-date">date</primary>
    372           </indexterm>
    373         </listitem>
    374       </varlistentry>
    375 
    376       <varlistentry id="dd">
    377         <term><command>dd</command> </term>
    378         <listitem>
    379           <para>Copies a file using the given block size and count, while
    380           optionally performing conversions on it</para>
    381           <indexterm zone="ch-system-coreutils dd">
    382             <primary sortas="b-dd">dd</primary>
    383           </indexterm>
    384         </listitem>
    385       </varlistentry>
    386 
    387       <varlistentry id="df">
    388         <term><command>df</command></term>
    389         <listitem>
    390           <para>Reports the amount of disk space available (and used) on all
    391           mounted file systems, or only on the file systems holding the selected
    392           files</para>
    393           <indexterm zone="ch-system-coreutils df">
    394             <primary sortas="b-df">df</primary>
    395           </indexterm>
    396         </listitem>
    397       </varlistentry>
    398 
    399       <varlistentry id="dir">
    400         <term><command>dir</command></term>
    401         <listitem>
    402           <para>Lists the contents of each given directory (the same as
    403           the <command>ls</command> command)</para>
    404           <indexterm zone="ch-system-coreutils dir">
    405             <primary sortas="b-dir">dir</primary>
    406           </indexterm>
    407         </listitem>
    408       </varlistentry>
    409 
    410       <varlistentry id="dircolors">
    411         <term><command>dircolors</command></term>
    412         <listitem>
    413           <para>Outputs commands to set the <envar>LS_COLOR</envar>
    414           environment variable to change the color scheme used by
    415           <command>ls</command></para>
    416           <indexterm zone="ch-system-coreutils dircolors">
    417             <primary sortas="b-dircolors">dircolors</primary>
    418           </indexterm>
    419         </listitem>
    420       </varlistentry>
    421 
    422       <varlistentry id="dirname">
    423         <term><command>dirname</command></term>
    424         <listitem>
    425           <para>Strips the non-directory suffix from a file name</para>
    426           <indexterm zone="ch-system-coreutils dirname">
    427             <primary sortas="b-dirname">dirname</primary>
    428           </indexterm>
    429         </listitem>
    430       </varlistentry>
    431 
    432       <varlistentry id="du">
    433         <term><command>du</command></term>
    434         <listitem>
    435           <para>Reports the amount of disk space used by the current directory,
    436           by each of the given directories (including all subdirectories) or by
    437           each of the given files</para>
    438           <indexterm zone="ch-system-coreutils du">
    439             <primary sortas="b-du">du</primary>
    440           </indexterm>
    441         </listitem>
    442       </varlistentry>
    443 
    444       <varlistentry id="echo">
    445         <term><command>echo</command></term>
    446         <listitem>
    447           <para>Displays the given strings</para>
    448           <indexterm zone="ch-system-coreutils echo">
    449             <primary sortas="b-echo">echo</primary>
    450           </indexterm>
    451         </listitem>
    452       </varlistentry>
    453 
    454       <varlistentry id="env">
    455         <term><command>env</command></term>
    456         <listitem>
    457           <para>Runs a command in a modified environment</para>
    458           <indexterm zone="ch-system-coreutils env">
    459             <primary sortas="b-env">env</primary>
    460           </indexterm>
    461         </listitem>
    462       </varlistentry>
    463 
    464       <varlistentry id="expand">
    465         <term><command>expand</command></term>
    466         <listitem>
    467           <para>Converts tabs to spaces</para>
    468           <indexterm zone="ch-system-coreutils expand">
    469             <primary sortas="b-expand">expand</primary>
    470           </indexterm>
    471         </listitem>
    472       </varlistentry>
    473 
    474       <varlistentry id="expr">
    475         <term><command>expr</command></term>
    476         <listitem>
    477           <para>Evaluates expressions</para>
    478           <indexterm zone="ch-system-coreutils expr">
    479             <primary sortas="b-expr">expr</primary>
    480           </indexterm>
    481         </listitem>
    482       </varlistentry>
    483 
    484       <varlistentry id="factor">
    485         <term><command>factor</command></term>
    486         <listitem>
    487           <para>Prints the prime factors of all specified integer numbers</para>
    488           <indexterm zone="ch-system-coreutils factor">
    489             <primary sortas="b-factor">factor</primary>
    490           </indexterm>
    491         </listitem>
    492       </varlistentry>
    493 
    494       <varlistentry id="false">
    495         <term><command>false</command></term>
    496         <listitem>
    497           <para>Does nothing, unsuccessfully; it always exits with a status code
    498           indicating failure</para>
    499           <indexterm zone="ch-system-coreutils false">
    500             <primary sortas="b-false">false</primary>
    501           </indexterm>
    502         </listitem>
    503       </varlistentry>
    504 
    505       <varlistentry id="fmt">
    506         <term><command>fmt</command></term>
    507         <listitem>
    508           <para>Reformats the paragraphs in the given files</para>
    509           <indexterm zone="ch-system-coreutils fmt">
    510             <primary sortas="b-fmt">fmt</primary>
    511           </indexterm>
    512         </listitem>
    513       </varlistentry>
    514 
    515       <varlistentry id="fold">
    516         <term><command>fold</command></term>
    517         <listitem>
    518           <para>Wraps the lines in the given files</para>
    519           <indexterm zone="ch-system-coreutils fold">
    520             <primary sortas="b-fold">fold</primary>
    521           </indexterm>
    522         </listitem>
    523       </varlistentry>
    524 
    525       <varlistentry id="groups">
    526         <term><command>groups</command></term>
    527         <listitem>
    528           <para>Reports a user's group memberships</para>
    529           <indexterm zone="ch-system-coreutils groups">
    530             <primary sortas="b-groups">groups</primary>
    531           </indexterm>
    532         </listitem>
    533       </varlistentry>
    534 
    535       <varlistentry id="head">
    536         <term><command>head</command></term>
    537         <listitem>
    538           <para>Prints the first ten lines (or the given number of lines)
    539           of each given file</para>
    540           <indexterm zone="ch-system-coreutils head">
    541             <primary sortas="b-head">head</primary>
    542           </indexterm>
    543         </listitem>
    544       </varlistentry>
    545 
    546       <varlistentry id="hostid">
    547         <term><command>hostid</command></term>
    548         <listitem>
    549           <para>Reports the numeric identifier (in hexadecimal) of the host</para>
    550           <indexterm zone="ch-system-coreutils hostid">
    551             <primary sortas="b-hostid">hostid</primary>
    552           </indexterm>
    553         </listitem>
    554       </varlistentry>
    555 
    556       <varlistentry id="id">
    557         <term><command>id</command></term>
    558         <listitem>
    559           <para>Reports the effective user ID, group ID, and group memberships
    560           of the current user or specified user</para>
    561           <indexterm zone="ch-system-coreutils id">
    562             <primary sortas="b-id">id</primary>
    563           </indexterm>
    564         </listitem>
    565       </varlistentry>
    566 
    567       <varlistentry id="install">
    568         <term><command>install</command> </term>
    569         <listitem>
    570           <para>Copies files while setting their permission modes and, if
    571           possible, their owner and group</para>
    572           <indexterm zone="ch-system-coreutils install">
    573             <primary sortas="b-install">install</primary>
    574           </indexterm>
    575         </listitem>
    576       </varlistentry>
    577 
    578       <varlistentry id="join">
    579         <term><command>join</command></term>
    580         <listitem>
    581           <para>Joins the lines that have identical join fields from two
    582           separate files</para>
    583           <indexterm zone="ch-system-coreutils join">
    584             <primary sortas="b-join">join</primary>
    585           </indexterm>
    586         </listitem>
    587       </varlistentry>
    588 
    589       <varlistentry id="link">
    590         <term><command>link</command></term>
    591         <listitem>
    592           <para>Creates a hard link with the given name to a file</para>
    593           <indexterm zone="ch-system-coreutils link">
    594             <primary sortas="b-link">link</primary>
    595           </indexterm>
    596         </listitem>
    597       </varlistentry>
    598 
    599       <varlistentry id="ln">
    600         <term><command>ln</command></term>
    601         <listitem>
    602           <para>Makes hard links or soft (symbolic) links between files</para>
    603           <indexterm zone="ch-system-coreutils ln">
    604             <primary sortas="b-ln">ln</primary>
    605           </indexterm>
    606         </listitem>
    607       </varlistentry>
    608 
    609       <varlistentry id="logname">
    610         <term><command>logname</command></term>
    611         <listitem>
    612           <para>Reports the current user's login name</para>
    613           <indexterm zone="ch-system-coreutils logname">
    614             <primary sortas="b-logname">logname</primary>
    615           </indexterm>
    616         </listitem>
    617       </varlistentry>
    618 
    619       <varlistentry id="ls">
    620         <term><command>ls</command></term>
    621         <listitem>
    622           <para>Lists the contents of each given directory</para>
    623           <indexterm zone="ch-system-coreutils ls">
    624             <primary sortas="b-ls">ls</primary>
    625           </indexterm>
    626         </listitem>
    627       </varlistentry>
    628 
    629       <varlistentry id="md5sum">
    630         <term><command>md5sum</command></term>
    631         <listitem>
    632           <para>Reports or checks Message Digest 5 (MD5) checksums</para>
    633           <indexterm zone="ch-system-coreutils md5sum">
    634             <primary sortas="b-md5sum">md5sum</primary>
    635           </indexterm>
    636         </listitem>
    637       </varlistentry>
    638 
    639       <varlistentry id="mkdir">
    640         <term><command>mkdir</command></term>
    641         <listitem>
    642           <para>Creates directories with the given names</para>
    643           <indexterm zone="ch-system-coreutils mkdir">
    644             <primary sortas="b-mkdir">mkdir</primary>
    645           </indexterm>
    646         </listitem>
    647       </varlistentry>
    648 
    649       <varlistentry id="mkfifo">
    650         <term><command>mkfifo</command></term>
    651         <listitem>
    652           <para>Creates First-In, First-Outs (FIFOs), a "named
    653           pipe" in UNIX parlance, with the given names</para>
    654           <indexterm zone="ch-system-coreutils mkfifo">
    655             <primary sortas="b-mkfifo">mkfifo</primary>
    656           </indexterm>
    657         </listitem>
    658       </varlistentry>
    659 
    660       <varlistentry id="mknod">
    661         <term><command>mknod</command></term>
    662         <listitem>
    663           <para>Creates device nodes with the given names; a device node is a
    664           character special file, a block special file, or a FIFO</para>
    665           <indexterm zone="ch-system-coreutils mknod">
    666             <primary sortas="b-mknod">mknod</primary>
    667           </indexterm>
    668         </listitem>
    669       </varlistentry>
    670 
    671       <varlistentry id="mktemp">
    672         <term><command>mktemp</command></term>
    673         <listitem>
    674           <para>Creates temporary files in a secure manner; it is used in scripts</para>
    675         <indexterm zone="ch-system-coreutils mktemp">
    676           <primary sortas="b-mktemp">mktemp</primary>
    677         </indexterm>
    678        </listitem>
    679      </varlistentry>
    680 
    681       <varlistentry id="mv">
    682         <term><command>mv</command></term>
    683         <listitem>
    684           <para>Moves or renames files or directories</para>
    685           <indexterm zone="ch-system-coreutils mv">
    686             <primary sortas="b-mv">mv</primary>
    687           </indexterm>
    688         </listitem>
    689       </varlistentry>
    690 
    691       <varlistentry id="nice">
    692         <term><command>nice</command></term>
    693         <listitem>
    694           <para>Runs a program with modified scheduling priority</para>
    695           <indexterm zone="ch-system-coreutils nice">
    696             <primary sortas="b-nice">nice</primary>
    697           </indexterm>
    698         </listitem>
    699       </varlistentry>
    700 
    701       <varlistentry id="nl">
    702         <term><command>nl</command></term>
    703         <listitem>
    704           <para>Numbers the lines from the given files</para>
    705           <indexterm zone="ch-system-coreutils nl">
    706             <primary sortas="b-nl">nl</primary>
    707           </indexterm>
    708         </listitem>
    709       </varlistentry>
    710 
    711       <varlistentry id="nohup">
    712         <term><command>nohup</command></term>
    713         <listitem>
    714           <para>Runs a command immune to hangups, with its output redirected to
    715           a log file</para>
    716           <indexterm zone="ch-system-coreutils nohup">
    717             <primary sortas="b-nohup">nohup</primary>
    718           </indexterm>
    719         </listitem>
    720       </varlistentry>
    721 
    722       <varlistentry id="nproc">
    723         <term><command>nproc</command></term>
    724         <listitem>
    725           <para>Prints the number of processing units available to a
    726           process</para>
    727           <indexterm zone="ch-system-coreutils nproc">
    728             <primary sortas="b-nproc">nproc</primary>
    729           </indexterm>
    730         </listitem>
    731       </varlistentry>
    732 
    733       <varlistentry id="numfmt">
    734         <term><command>numfmt</command></term>
    735         <listitem>
    736           <para>Converts numbers to or from human-readable strings</para>
    737           <indexterm zone="ch-system-coreutils numfmt">
    738             <primary sortas="b-numfmt">numfmt</primary>
    739           </indexterm>
    740         </listitem>
    741       </varlistentry>
    742 
    743       <varlistentry id="od">
    744         <term><command>od</command></term>
    745         <listitem>
    746           <para>Dumps files in octal and other formats</para>
    747           <indexterm zone="ch-system-coreutils od">
    748             <primary sortas="b-od">od</primary>
    749           </indexterm>
    750         </listitem>
    751       </varlistentry>
    752 
    753       <varlistentry id="paste">
    754         <term><command>paste</command></term>
    755         <listitem>
    756           <para>Merges the given files, joining sequentially corresponding lines
    757           side by side, separated by tab characters</para>
    758           <indexterm zone="ch-system-coreutils paste">
    759             <primary sortas="b-paste">paste</primary>
    760           </indexterm>
    761         </listitem>
    762       </varlistentry>
    763 
    764       <varlistentry id="pathchk">
    765         <term><command>pathchk</command></term>
    766         <listitem>
    767           <para>Checks if file names are valid or portable</para>
    768           <indexterm zone="ch-system-coreutils pathchk">
    769             <primary sortas="b-pathchk">pathchk</primary>
    770           </indexterm>
    771         </listitem>
    772       </varlistentry>
    773 
    774       <varlistentry id="pinky">
    775         <term><command>pinky</command></term>
    776         <listitem>
    777           <para>Is a lightweight finger client; it reports some information
    778           about the given users</para>
    779           <indexterm zone="ch-system-coreutils pinky">
    780             <primary sortas="b-pinky">pinky</primary>
    781           </indexterm>
    782         </listitem>
    783       </varlistentry>
    784 
    785       <varlistentry id="pr">
    786         <term><command>pr</command></term>
    787         <listitem>
    788           <para>Paginates and columnates files for printing</para>
    789           <indexterm zone="ch-system-coreutils pr">
    790             <primary sortas="b-pr">pr</primary>
    791           </indexterm>
    792         </listitem>
    793       </varlistentry>
    794 
    795       <varlistentry id="printenv">
    796         <term><command>printenv</command></term>
    797         <listitem>
    798           <para>Prints the environment</para>
    799           <indexterm zone="ch-system-coreutils printenv">
    800             <primary sortas="b-printenv">printenv</primary>
    801           </indexterm>
    802         </listitem>
    803       </varlistentry>
    804 
    805       <varlistentry id="printf">
    806         <term><command>printf</command></term>
    807         <listitem>
    808           <para>Prints the given arguments according to the given format, much
    809           like the C printf function</para>
    810           <indexterm zone="ch-system-coreutils printf">
    811             <primary sortas="b-printf">printf</primary>
    812           </indexterm>
    813         </listitem>
    814       </varlistentry>
    815 
    816       <varlistentry id="ptx">
    817         <term><command>ptx</command></term>
    818         <listitem>
    819           <para>Produces a permuted index from the contents of the given files,
    820           with each keyword in its context</para>
    821           <indexterm zone="ch-system-coreutils ptx">
    822             <primary sortas="b-ptx">ptx</primary>
    823           </indexterm>
    824         </listitem>
    825       </varlistentry>
    826 
    827       <varlistentry id="pwd">
    828         <term><command>pwd</command></term>
    829         <listitem>
    830           <para>Reports the name of the current working directory</para>
    831           <indexterm zone="ch-system-coreutils pwd">
    832             <primary sortas="b-pwd">pwd</primary>
    833           </indexterm>
    834         </listitem>
    835       </varlistentry>
    836 
    837       <varlistentry id="readlink">
    838         <term><command>readlink</command></term>
    839         <listitem>
    840           <para>Reports the value of the given symbolic link</para>
    841           <indexterm zone="ch-system-coreutils readlink">
    842             <primary sortas="b-readlink">readlink</primary>
    843           </indexterm>
    844         </listitem>
    845       </varlistentry>
    846 
    847       <varlistentry id="realpath">
    848         <term><command>realpath</command></term>
    849         <listitem>
    850           <para>Prints the resolved path</para>
    851           <indexterm zone="ch-system-coreutils realpath">
    852             <primary sortas="b-realpath">realpath</primary>
    853           </indexterm>
    854         </listitem>
    855       </varlistentry>
    856 
    857       <varlistentry id="rm">
    858         <term><command>rm</command></term>
    859         <listitem>
    860           <para>Removes files or directories</para>
    861           <indexterm zone="ch-system-coreutils rm">
    862             <primary sortas="b-rm">rm</primary>
    863           </indexterm>
    864         </listitem>
    865       </varlistentry>
    866 
    867       <varlistentry id="rmdir">
    868         <term><command>rmdir</command></term>
    869         <listitem>
    870           <para>Removes directories if they are empty</para>
    871           <indexterm zone="ch-system-coreutils rmdir">
    872             <primary sortas="b-rmdir">rmdir</primary>
    873           </indexterm>
    874         </listitem>
    875       </varlistentry>
    876 
    877       <varlistentry id="runcon">
    878         <term><command>runcon</command></term>
    879         <listitem>
    880           <para>Runs a command with specified security context</para>
    881           <indexterm zone="ch-system-coreutils runcon">
    882             <primary sortas="b-runcon">runcon</primary>
    883           </indexterm>
    884         </listitem>
    885       </varlistentry>
    886 
    887       <varlistentry id="seq">
    888         <term><command>seq</command></term>
    889         <listitem>
    890           <para>Prints a sequence of numbers within a given range and with a
    891           given increment</para>
    892           <indexterm zone="ch-system-coreutils seq">
    893             <primary sortas="b-seq">seq</primary>
    894           </indexterm>
    895         </listitem>
    896       </varlistentry>
    897 
    898       <varlistentry id="sha1sum">
    899         <term><command>sha1sum</command></term>
    900         <listitem>
    901           <para>Prints or checks 160-bit Secure Hash Algorithm 1 (SHA1)
    902           checksums</para>
    903           <indexterm zone="ch-system-coreutils sha1sum">
    904             <primary sortas="b-sha1sum">sha1sum</primary>
    905           </indexterm>
    906         </listitem>
    907       </varlistentry>
    908 
    909       <varlistentry id="sha224sum">
    910         <term><command>sha224sum</command></term>
    911         <listitem>
    912           <para>Prints or checks 224-bit Secure Hash Algorithm checksums</para>
    913           <indexterm zone="ch-system-coreutils sha224sum">
    914             <primary sortas="b-sha224sum">sha224sum</primary>
    915           </indexterm>
    916         </listitem>
    917       </varlistentry>
    918 
    919       <varlistentry id="sha256sum">
    920         <term><command>sha256sum</command></term>
    921         <listitem>
    922           <para>Prints or checks 256-bit Secure Hash Algorithm checksums</para>
    923           <indexterm zone="ch-system-coreutils sha256sum">
    924             <primary sortas="b-sha256sum">sha256sum</primary>
    925           </indexterm>
    926         </listitem>
    927       </varlistentry>
    928 
    929       <varlistentry id="sha384sum">
    930         <term><command>sha384sum</command></term>
    931         <listitem>
    932           <para>Prints or checks 384-bit Secure Hash Algorithm checksums</para>
    933           <indexterm zone="ch-system-coreutils sha384sum">
    934             <primary sortas="b-sha384sum">sha384sum</primary>
    935           </indexterm>
    936         </listitem>
    937       </varlistentry>
    938 
    939       <varlistentry id="sha512sum">
    940         <term><command>sha512sum</command></term>
    941         <listitem>
    942           <para>Prints or checks 512-bit Secure Hash Algorithm checksums</para>
    943           <indexterm zone="ch-system-coreutils sha512sum">
    944             <primary sortas="b-sha512sum">sha512sum</primary>
    945           </indexterm>
    946         </listitem>
    947       </varlistentry>
    948 
    949       <varlistentry id="shred">
    950         <term><command>shred</command></term>
    951         <listitem>
    952           <para>Overwrites the given files repeatedly with complex patterns,
    953           making it difficult to recover the data</para>
    954           <indexterm zone="ch-system-coreutils shred">
    955             <primary sortas="b-shred">shred</primary>
    956           </indexterm>
    957         </listitem>
    958       </varlistentry>
    959 
    960       <varlistentry id="shuf">
    961         <term><command>shuf</command></term>
    962         <listitem>
    963           <para>Shuffles lines of text</para>
    964           <indexterm zone="ch-system-coreutils shuf">
    965             <primary sortas="b-shuf">shuf</primary>
    966           </indexterm>
    967         </listitem>
    968       </varlistentry>
    969 
    970       <varlistentry id="sleep">
    971         <term><command>sleep</command></term>
    972         <listitem>
    973           <para>Pauses for the given amount of time</para>
    974           <indexterm zone="ch-system-coreutils sleep">
    975             <primary sortas="b-sleep">sleep</primary>
    976           </indexterm>
    977         </listitem>
    978       </varlistentry>
    979 
    980       <varlistentry id="sort">
    981         <term><command>sort</command></term>
    982         <listitem>
    983           <para>Sorts the lines from the given files</para>
    984           <indexterm zone="ch-system-coreutils sort">
    985             <primary sortas="b-sort">sort</primary>
    986           </indexterm>
    987         </listitem>
    988       </varlistentry>
    989 
    990       <varlistentry id="split">
    991         <term><command>split</command></term>
    992         <listitem>
    993           <para>Splits the given file into pieces, by size or by number of
    994           lines</para>
    995           <indexterm zone="ch-system-coreutils split">
    996             <primary sortas="b-split">split</primary>
    997           </indexterm>
    998         </listitem>
    999       </varlistentry>
    1000 
    1001       <varlistentry id="stat">
    1002         <term><command>stat</command></term>
    1003         <listitem>
    1004           <para>Displays file or filesystem status</para>
    1005           <indexterm zone="ch-system-coreutils stat">
    1006             <primary sortas="b-stat">stat</primary>
    1007           </indexterm>
    1008         </listitem>
    1009       </varlistentry>
    1010 
    1011       <varlistentry id="stdbuf">
    1012         <term><command>stdbuf</command></term>
    1013         <listitem>
    1014           <para>Runs commands with altered buffering operations for its standard
    1015           streams</para>
    1016           <indexterm zone="ch-system-coreutils stdbuf">
    1017             <primary sortas="b-stdbuf">stdbuf</primary>
    1018           </indexterm>
    1019         </listitem>
    1020       </varlistentry>
    1021 
    1022       <varlistentry id="stty">
    1023         <term><command>stty</command></term>
    1024         <listitem>
    1025           <para>Sets or reports terminal line settings</para>
    1026           <indexterm zone="ch-system-coreutils stty">
    1027             <primary sortas="b-stty">stty</primary>
    1028           </indexterm>
    1029         </listitem>
    1030       </varlistentry>
    1031 
    1032       <varlistentry id="sum">
    1033         <term><command>sum</command></term>
    1034         <listitem>
    1035           <para>Prints checksum and block counts for each given file</para>
    1036           <indexterm zone="ch-system-coreutils sum">
    1037             <primary sortas="b-sum">sum</primary>
    1038           </indexterm>
    1039         </listitem>
    1040       </varlistentry>
    1041 
    1042       <varlistentry id="sync">
    1043         <term><command>sync</command></term>
    1044         <listitem>
    1045           <para>Flushes file system buffers; it forces changed blocks to disk
    1046           and updates the super block</para>
    1047           <indexterm zone="ch-system-coreutils sync">
    1048             <primary sortas="b-sync">sync</primary>
    1049           </indexterm>
    1050         </listitem>
    1051       </varlistentry>
    1052 
    1053       <varlistentry id="tac">
    1054         <term><command>tac</command></term>
    1055         <listitem>
    1056           <para>Concatenates the given files in reverse</para>
    1057           <indexterm zone="ch-system-coreutils tac">
    1058             <primary sortas="b-tac">tac</primary>
    1059           </indexterm>
    1060         </listitem>
    1061       </varlistentry>
    1062 
    1063       <varlistentry id="tail">
    1064         <term><command>tail</command></term>
    1065         <listitem>
    1066           <para>Prints the last ten lines (or the given number of lines) of each
    1067           given file</para>
    1068           <indexterm zone="ch-system-coreutils tail">
    1069             <primary sortas="b-tail">tail</primary>
    1070           </indexterm>
    1071         </listitem>
    1072       </varlistentry>
    1073 
    1074       <varlistentry id="tee">
    1075         <term><command>tee</command></term>
    1076         <listitem>
    1077           <para>Reads from standard input while writing both to standard output
    1078           and to the given files</para>
    1079           <indexterm zone="ch-system-coreutils tee">
    1080             <primary sortas="b-tee">tee</primary>
    1081           </indexterm>
    1082         </listitem>
    1083       </varlistentry>
    1084 
    1085       <varlistentry id="test">
    1086         <term><command>test</command></term>
    1087         <listitem>
    1088           <para>Compares values and checks file types</para>
    1089           <indexterm zone="ch-system-coreutils test">
    1090             <primary sortas="b-test">test</primary>
    1091           </indexterm>
    1092         </listitem>
    1093       </varlistentry>
    1094 
    1095       <varlistentry id="timeout">
    1096         <term><command>timeout</command></term>
    1097         <listitem>
    1098           <para>Runs a command with a time limit</para>
    1099           <indexterm zone="ch-system-coreutils timeout">
    1100             <primary sortas="b-timeout">timeout</primary>
    1101           </indexterm>
    1102         </listitem>
    1103       </varlistentry>
    1104 
    1105       <varlistentry id="touch">
    1106         <term><command>touch</command></term>
    1107         <listitem>
    1108           <para>Changes file timestamps, setting the access and modification
    1109           times of the given files to the current time; files that do not exist
    1110           are created with zero length</para>
    1111           <indexterm zone="ch-system-coreutils touch">
    1112             <primary sortas="b-touch">touch</primary>
    1113           </indexterm>
    1114         </listitem>
    1115       </varlistentry>
    1116 
    1117       <varlistentry id="tr">
    1118         <term><command>tr</command></term>
    1119         <listitem>
    1120           <para>Translates, squeezes, and deletes the given characters from
    1121           standard input</para>
    1122           <indexterm zone="ch-system-coreutils tr">
    1123             <primary sortas="b-tr">tr</primary>
    1124           </indexterm>
    1125         </listitem>
    1126       </varlistentry>
    1127 
    1128       <varlistentry id="true">
    1129         <term><command>true</command></term>
    1130         <listitem>
    1131           <para>Does nothing, successfully; it always exits with a status code
    1132           indicating success</para>
    1133           <indexterm zone="ch-system-coreutils true">
    1134             <primary sortas="b-true">true</primary>
    1135           </indexterm>
    1136         </listitem>
    1137       </varlistentry>
    1138 
    1139       <varlistentry id="truncate">
    1140         <term><command>truncate</command></term>
    1141         <listitem>
    1142           <para>Shrinks or expands a file to the specified size</para>
    1143           <indexterm zone="ch-system-coreutils truncate">
    1144             <primary sortas="b-truncate">truncate</primary>
    1145           </indexterm>
    1146         </listitem>
    1147       </varlistentry>
    1148 
    1149       <varlistentry id="tsort">
    1150         <term><command>tsort</command></term>
    1151         <listitem>
    1152           <para>Performs a topological sort; it writes a completely ordered list
    1153           according to the partial ordering in a given file</para>
    1154           <indexterm zone="ch-system-coreutils tsort">
    1155             <primary sortas="b-tsort">tsort</primary>
    1156           </indexterm>
    1157         </listitem>
    1158       </varlistentry>
    1159 
    1160       <varlistentry id="tty">
    1161         <term><command>tty</command></term>
    1162         <listitem>
    1163           <para>Reports the file name of the terminal connected to standard
    1164           input</para>
    1165           <indexterm zone="ch-system-coreutils tty">
    1166             <primary sortas="b-tty">tty</primary>
    1167           </indexterm>
    1168         </listitem>
    1169       </varlistentry>
    1170 
    1171       <varlistentry id="uname">
    1172         <term><command>uname</command></term>
    1173         <listitem>
    1174           <para>Reports system information</para>
    1175           <indexterm zone="ch-system-coreutils uname">
    1176             <primary sortas="b-uname">uname</primary>
    1177           </indexterm>
    1178         </listitem>
    1179       </varlistentry>
    1180 
    1181       <varlistentry id="unexpand">
    1182         <term><command>unexpand</command></term>
    1183         <listitem>
    1184           <para>Converts spaces to tabs</para>
    1185           <indexterm zone="ch-system-coreutils unexpand">
    1186             <primary sortas="b-unexpand">unexpand</primary>
    1187           </indexterm>
    1188         </listitem>
    1189       </varlistentry>
    1190 
    1191       <varlistentry id="uniq">
    1192         <term><command>uniq</command></term>
    1193         <listitem>
    1194           <para>Discards all but one of successive identical lines</para>
    1195           <indexterm zone="ch-system-coreutils uniq">
    1196             <primary sortas="b-uniq">uniq</primary>
    1197           </indexterm>
    1198         </listitem>
    1199       </varlistentry>
    1200 
    1201       <varlistentry id="unlink">
    1202         <term><command>unlink</command></term>
    1203         <listitem>
    1204           <para>Removes the given file</para>
    1205           <indexterm zone="ch-system-coreutils unlink">
    1206             <primary sortas="b-unlink">unlink</primary>
    1207           </indexterm>
    1208         </listitem>
    1209       </varlistentry>
    1210 
    1211       <varlistentry id="users">
    1212         <term><command>users</command></term>
    1213         <listitem>
    1214           <para>Reports the names of the users currently logged on</para>
    1215           <indexterm zone="ch-system-coreutils users">
    1216             <primary sortas="b-users">users</primary>
    1217           </indexterm>
    1218         </listitem>
    1219       </varlistentry>
    1220 
    1221       <varlistentry id="vdir">
    1222         <term><command>vdir</command></term>
    1223         <listitem>
    1224           <para>Is the same as <command>ls -l</command></para>
    1225           <indexterm zone="ch-system-coreutils vdir">
    1226             <primary sortas="b-vdir">vdir</primary>
    1227           </indexterm>
    1228         </listitem>
    1229       </varlistentry>
    1230 
    1231       <varlistentry id="wc">
    1232         <term><command>wc</command></term>
    1233         <listitem>
    1234           <para>Reports the number of lines, words, and bytes for each given
    1235           file, as well as a total line when more than one file is given</para>
    1236           <indexterm zone="ch-system-coreutils wc">
    1237             <primary sortas="b-wc">wc</primary>
    1238           </indexterm>
    1239         </listitem>
    1240       </varlistentry>
    1241 
    1242       <varlistentry id="who">
    1243         <term><command>who</command></term>
    1244         <listitem>
    1245           <para>Reports who is logged on</para>
    1246           <indexterm zone="ch-system-coreutils who">
    1247             <primary sortas="b-who">who</primary>
    1248           </indexterm>
    1249         </listitem>
    1250       </varlistentry>
    1251 
    1252       <varlistentry id="whoami">
    1253         <term><command>whoami</command></term>
    1254         <listitem>
    1255           <para>Reports the user name associated with the current effective
    1256           user ID</para>
    1257           <indexterm zone="ch-system-coreutils whoami">
    1258             <primary sortas="b-whoami">whoami</primary>
    1259           </indexterm>
    1260         </listitem>
    1261       </varlistentry>
    1262 
    1263       <varlistentry id="yes">
    1264         <term><command>yes</command></term>
    1265         <listitem>
    1266           <para>Repeatedly outputs <quote>y</quote> or a given string until
    1267           killed</para>
    1268           <indexterm zone="ch-system-coreutils yes">
    1269             <primary sortas="b-yes">yes</primary>
    1270           </indexterm>
    1271         </listitem>
    1272       </varlistentry>
    1273 
    1274       <varlistentry id="libstdbuf">
    1275         <term><filename class="libraryfile">libstdbuf</filename></term>
    1276         <listitem>
    1277           <para>Library used by <command>stdbuf</command></para>
    1278           <indexterm zone="ch-system-coreutils libstdbuf">
    1279             <primary sortas="c-libstdbuf">libstdbuf</primary>
    1280           </indexterm>
    1281         </listitem>
    1282       </varlistentry>
    1283 
    1284     </variablelist>
     100    <para>Details on this package are located in
     101    <xref linkend="contents-coreutils" role="."/></para>
    1285102
    1286103  </sect2>
  • chapter06/diffutils.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-system-diffutils" role="wrap">
     8<sect1 id="ch-tools-diffutils" role="wrap">
    99  <?dbhtml filename="diffutils.html"?>
    1010
     
    1717  <title>Diffutils-&diffutils-version;</title>
    1818
    19   <indexterm zone="ch-system-diffutils">
     19  <indexterm zone="ch-tools-diffutils">
    2020    <primary sortas="a-Diffutils">Diffutils</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Diffutils package contains programs that show the differences
    27     between files or directories.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/diffutils.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2830
    2931    <segmentedlist>
     
    3234
    3335      <seglistitem>
    34         <seg>&diffutils-ch6-sbu;</seg>
    35         <seg>&diffutils-ch6-du;</seg>
     36        <seg>&diffutils-tmp-sbu;</seg>
     37        <seg>&diffutils-tmp-du;</seg>
    3638      </seglistitem>
    3739    </segmentedlist>
     
    4446    <para>Prepare Diffutils for compilation:</para>
    4547
    46 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     48<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT</userinput></screen>
    4749
    4850    <para>Compile the package:</para>
     
    5052<screen><userinput remap="make">make</userinput></screen>
    5153
    52     <para>To test the results, issue:</para>
    53 
    54 <screen><userinput remap="test">make check</userinput></screen>
    55 
    5654    <para>Install the package:</para>
    5755
    58 <screen><userinput remap="install">make install</userinput></screen>
     56<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    5957
    6058  </sect2>
    6159
     60  <sect2 role="content">
     61    <title/>
    6262
    63   <sect2 id="contents-diffutils" role="content">
    64     <title>Contents of Diffutils</title>
    65 
    66     <segmentedlist>
    67       <segtitle>Installed programs</segtitle>
    68 
    69       <seglistitem>
    70         <seg>cmp, diff, diff3, and sdiff</seg>
    71       </seglistitem>
    72     </segmentedlist>
    73 
    74     <variablelist>
    75       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    76       <?dbfo list-presentation="list"?>
    77       <?dbhtml list-presentation="table"?>
    78 
    79       <varlistentry id="cmp">
    80         <term><command>cmp</command></term>
    81         <listitem>
    82           <para>Compares two files and reports whether or in which bytes they
    83           differ</para>
    84           <indexterm zone="ch-system-diffutils cmp">
    85             <primary sortas="b-cmp">cmp</primary>
    86           </indexterm>
    87         </listitem>
    88       </varlistentry>
    89 
    90       <varlistentry id="diff">
    91         <term><command>diff</command></term>
    92         <listitem>
    93           <para>Compares two files or directories and reports which lines in
    94           the files differ</para>
    95           <indexterm zone="ch-system-diffutils diff">
    96             <primary sortas="b-diff">diff</primary>
    97           </indexterm>
    98         </listitem>
    99       </varlistentry>
    100 
    101       <varlistentry id="diff3">
    102         <term><command>diff3</command></term>
    103         <listitem>
    104             <para>Compares three files line by line</para>
    105             <indexterm zone="ch-system-diffutils diff3">
    106               <primary sortas="b-diff3">diff3</primary>
    107             </indexterm>
    108         </listitem>
    109       </varlistentry>
    110 
    111       <varlistentry id="sdiff">
    112         <term><command>sdiff</command></term>
    113         <listitem>
    114           <para>Merges two files and interactively outputs the results</para>
    115           <indexterm zone="ch-system-diffutils sdiff">
    116             <primary sortas="b-sdiff">sdiff</primary>
    117           </indexterm>
    118         </listitem>
    119       </varlistentry>
    120 
    121     </variablelist>
     63    <para>Details on this package are located in
     64    <xref linkend="contents-diffutils" role="."/></para>
    12265
    12366  </sect2>
  • chapter06/file.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-system-file" role="wrap">
     8<sect1 id="ch-tools-file" role="wrap">
    99  <?dbhtml filename="file.html"?>
    1010
     
    1717  <title>File-&file-version;</title>
    1818
    19   <indexterm zone="ch-system-file">
     19  <indexterm zone="ch-tools-file">
    2020    <primary sortas="a-File">File</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The File package contains a utility for determining the type of a given
    27     file or files.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/file.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2830
    2931    <segmentedlist>
     
    3234
    3335      <seglistitem>
    34         <seg>&file-ch6-sbu;</seg>
    35         <seg>&file-ch6-du;</seg>
     36        <seg>&file-tmp-sbu;</seg>
     37        <seg>&file-tmp-du;</seg>
    3638      </seglistitem>
    3739    </segmentedlist>
     
    4446    <para>Prepare File for compilation:</para>
    4547
    46 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     48<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT</userinput></screen>
    4749
    48     <para>Compile the package:</para>
    49 
    50 <screen><userinput remap="make">make</userinput></screen>
    51 
    52     <para>To test the results, issue:</para>
    53 
    54 <screen><userinput remap="test">make check</userinput></screen>
    55 
    56     <para>Install the package:</para>
    57 
    58 <screen><userinput remap="install">make install</userinput></screen>
    59 
    60   </sect2>
    61 
    62   <!-- ~~~~~~~~~~~~~~~~~~~~ ABI 32 ~~~~~~~~~~~~~~~~~~~~ -->
    63  
    64   <sect2 arch="ml_32,ml_all" role="installation">
    65     <title>Installation of File - 32-bit</title>
    66 
    67     <para>Clean previous build:</para>
    68 
    69 <screen><userinput remap="pre">make distclean</userinput></screen>
    70 
    71     <para>Prepare File for compilation:</para>
    72 
    73 <screen><userinput remap="configure">CC="gcc -m32" ./configure \
    74     --prefix=/usr         \
    75     --libdir=/usr/lib32   \
    76     --host=i686-pc-linux-gnu</userinput></screen>
    77 
     50<!-- devs: if using - -build here, the build system wants to compile
     51     the signature file with "file" on the build system, but stops if it is not
     52     the same version. One possibility would be to build "file" on the build
     53     system first, but it is simpler to have the system think it is not
     54     cross-compiling, and use the just built "file". -->
    7855    <para>Compile the package:</para>
    7956
     
    8259    <para>Install the package:</para>
    8360
    84 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
    85 cp -Rv DESTDIR/usr/lib32/* /usr/lib32
    86 rm -rf DESTDIR</userinput></screen>
     61<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    8762
    8863  </sect2>
    8964
    90   <!-- ~~~~~~~~~~~~~~~~~~~~ ABI x32 ~~~~~~~~~~~~~~~~~~~~ -->
    91  
    92   <sect2 arch="ml_x32,ml_all" role="installation">
    93     <title>Installation of File - x32-bit</title>
    94 
    95     <para>Clean previous build:</para>
    96 
    97 <screen><userinput remap="pre">make distclean</userinput></screen>
    98 
    99     <para>Prepare File for compilation:</para>
    100 
    101 <screen><userinput remap="configure">CC="gcc -mx32" ./configure \
    102     --prefix=/usr          \
    103     --libdir=/usr/libx32   \
    104     --host=x86_64-pc-linux-gnux32</userinput></screen>
    105 
    106     <para>Compile the package:</para>
    107 
    108 <screen><userinput remap="make">make</userinput></screen>
    109 
    110     <para>Install the package:</para>
    111 
    112 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
    113 cp -Rv DESTDIR/usr/libx32/* /usr/libx32
    114 rm -rf DESTDIR</userinput></screen>
    115 
    116   </sect2>
    117 
    118   <sect2 id="contents-file" role="content">
    119     <title>Contents of File</title>
    120 
    121     <segmentedlist>
    122       <segtitle>Installed programs</segtitle>
    123       <segtitle>Installed library</segtitle>
    124 
    125       <seglistitem>
    126         <seg>file</seg>
    127         <seg>libmagic.so</seg>
    128       </seglistitem>
    129     </segmentedlist>
    130 
    131     <variablelist>
    132       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    133       <?dbfo list-presentation="list"?>
    134       <?dbhtml list-presentation="table"?>
    135 
    136       <varlistentry id="file">
    137         <term><command>file</command></term>
    138         <listitem>
    139           <para>Tries to classify each given file; it does this by performing
    140           several tests&mdash;file system tests, magic number tests, and language
    141           tests</para>
    142           <indexterm zone="ch-system-file file">
    143             <primary sortas="b-file">file</primary>
    144           </indexterm>
    145         </listitem>
    146       </varlistentry>
    147 
    148       <varlistentry id="libmagic">
    149         <term><filename class="libraryfile">libmagic</filename></term>
    150         <listitem>
    151           <para>Contains routines for magic number recognition, used by the
    152           <command>file</command> program</para>
    153           <indexterm zone="ch-system-file libmagic">
    154             <primary sortas="c-libmagic">libmagic</primary>
    155           </indexterm>
    156         </listitem>
    157       </varlistentry>
    158 
    159     </variablelist>
     65  <sect2 role="content">
     66    <title/>
     67    <para>Details on this package are located in <xref linkend="contents-file" role="."/></para>
    16068
    16169  </sect2>
  • chapter06/findutils.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-system-findutils" role="wrap">
     8<sect1 id="ch-tools-findutils" role="wrap">
    99  <?dbhtml filename="findutils.html"?>
    1010
     
    1717  <title>Findutils-&findutils-version;</title>
    1818
    19   <indexterm zone="ch-system-findutils">
     19  <indexterm zone="ch-tools-findutils">
    2020    <primary sortas="a-Findutils">Findutils</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Findutils package contains programs to find files. These programs
    27     are provided to recursively search through a directory tree and to
    28     create, maintain, and search a database (often faster than the recursive
    29     find, but unreliable if the database has not been recently updated).</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/findutils.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    3030
    3131    <segmentedlist>
     
    3434
    3535      <seglistitem>
    36         <seg>&findutils-ch6-sbu;</seg>
    37         <seg>&findutils-ch6-du;</seg>
     36        <seg>&findutils-tmp-sbu;</seg>
     37        <seg>&findutils-tmp-du;</seg>
    3838      </seglistitem>
    3939    </segmentedlist>
     
    4646    <para>Prepare Findutils for compilation:</para>
    4747
    48 <screen><userinput remap="configure">./configure --prefix=/usr --localstatedir=/var/lib/locate</userinput></screen>
    49 
    50     <variablelist>
    51       <title>The meaning of the configure options:</title>
    52 
    53       <varlistentry>
    54         <term><parameter>--localstatedir</parameter></term>
    55         <listitem>
    56           <para>This option changes the location of the <command>locate</command>
    57           database to be in <filename class="directory">/var/lib/locate</filename>,
    58           which is FHS-compliant.</para>
    59         </listitem>
    60       </varlistentry>
    61 
    62     </variablelist>
     48<screen><userinput remap="configure">./configure --prefix=/usr   \
     49            --host=$LFS_TGT \
     50            --build=$(build-aux/config.guess)</userinput></screen>
    6351
    6452    <para>Compile the package:</para>
     
    6654<screen><userinput remap="make">make</userinput></screen>
    6755
    68     <para>To test the results, issue:</para>
    69 
    70 <screen><userinput remap="test">chown -Rv tester .
    71 su tester -c "PATH=$PATH make check"</userinput></screen>
    72 
    7356    <para>Install the package:</para>
    7457
    75 <screen><userinput remap="install">make install</userinput></screen>
     58<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    7659
    77     <para revision="sysv">Some of the scripts in the LFS-Bootscripts package
    78     depend on <command>find</command>.  As <filename
    79     class="directory">/usr</filename> may not be available during the early
    80     stages of booting, this program needs to be on the root partition.  The
    81     <command>updatedb</command> script also needs to be modified to correct an
    82     explicit path:</para>
     60    <para>Move the excutable to its final expected location:</para>
    8361
    84     <para revision="systemd"> Some packages in BLFS and beyond expect the
    85     <command>find</command> program in <filename
    86     class="directory">/bin</filename>, so make sure it's placed there:</para>
    87 
    88 <screen><userinput remap="install">mv -v /usr/bin/find /bin
    89 sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb</userinput></screen>
     62<screen><userinput remap="install">mv -v $LFS/usr/bin/find $LFS/bin
     63sed -i 's|find:=${BINDIR}|find:=/bin|' $LFS/usr/bin/updatedb</userinput></screen>
    9064
    9165  </sect2>
    9266
    93   <sect2 id="contents-findutils" role="content">
    94     <title>Contents of Findutils</title>
     67  <sect2 role="content">
     68    <title/>
    9569
    96     <segmentedlist>
    97       <segtitle>Installed programs</segtitle>
    98       <segtitle>Installed directory</segtitle>
    99 
    100       <seglistitem>
    101         <seg>find, locate, updatedb, and xargs</seg>
    102         <seg>/var/lib/locate</seg>
    103       </seglistitem>
    104 
    105     </segmentedlist>
    106 
    107     <variablelist>
    108       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    109       <?dbfo list-presentation="list"?>
    110       <?dbhtml list-presentation="table"?>
    111 
    112       <varlistentry id="find">
    113         <term><command>find</command></term>
    114         <listitem>
    115           <para>Searches given directory trees for files matching the specified
    116           criteria</para>
    117           <indexterm zone="ch-system-findutils find">
    118             <primary sortas="b-find">find</primary>
    119           </indexterm>
    120         </listitem>
    121       </varlistentry>
    122 
    123       <varlistentry id="locate">
    124         <term><command>locate</command></term>
    125         <listitem>
    126           <para>Searches through a database of file names and reports the names
    127           that contain a given string or match a given pattern</para>
    128           <indexterm zone="ch-system-findutils locate">
    129             <primary sortas="b-locate">locate</primary>
    130           </indexterm>
    131         </listitem>
    132       </varlistentry>
    133 
    134       <varlistentry id="updatedb">
    135       <term><command>updatedb</command></term>
    136         <listitem>
    137           <para>Updates the <command>locate</command> database; it scans the
    138           entire file system (including other file systems that are currently
    139           mounted, unless told not to) and puts every file name it finds into
    140           the database</para>
    141           <indexterm zone="ch-system-findutils updatedb">
    142             <primary sortas="b-updatedb">updatedb</primary>
    143           </indexterm>
    144         </listitem>
    145       </varlistentry>
    146 
    147       <varlistentry id="xargs">
    148         <term><command>xargs</command></term>
    149         <listitem>
    150           <para>Can be used to apply a given command to a list of files</para>
    151           <indexterm zone="ch-system-findutils xargs">
    152             <primary sortas="b-xargs">xargs</primary>
    153           </indexterm>
    154         </listitem>
    155       </varlistentry>
    156 
    157     </variablelist>
     70    <para>Details on this package are located in
     71    <xref linkend="contents-findutils" role="."/></para>
    15872
    15973  </sect2>
  • chapter06/gawk.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-system-gawk" role="wrap">
     8<sect1 id="ch-tools-gawk" role="wrap">
    99  <?dbhtml filename="gawk.html"?>
    1010
     
    1717  <title>Gawk-&gawk-version;</title>
    1818
    19   <indexterm zone="ch-system-gawk">
     19  <indexterm zone="ch-tools-gawk">
    2020    <primary sortas="a-Gawk">Gawk</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Gawk package contains programs for manipulating text files.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/gawk.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2730
    2831    <segmentedlist>
     
    3134
    3235      <seglistitem>
    33         <seg>&gawk-ch6-sbu;</seg>
    34         <seg>&gawk-ch6-du;</seg>
     36        <seg>&gawk-tmp-sbu;</seg>
     37        <seg>&gawk-tmp-du;</seg>
    3538      </seglistitem>
    3639    </segmentedlist>
     
    4750    <para>Prepare Gawk for compilation:</para>
    4851
    49 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     52<screen><userinput remap="configure">./configure --prefix=/usr   \
     53            --host=$LFS_TGT \
     54            --build=$(./config.guess)</userinput></screen>
    5055
    5156    <para>Compile the package:</para>
     
    5358<screen><userinput remap="make">make</userinput></screen>
    5459
    55     <para>To test the results, issue:</para>
    56 
    57 <screen><userinput remap="test">make check</userinput></screen>
    58 
    5960    <para>Install the package:</para>
    6061
    61 <screen><userinput remap="install">make install</userinput></screen>
    62 
    63     <para>If desired, install the documentation:</para>
    64 
    65 <screen><userinput remap="install">mkdir -v /usr/share/doc/gawk-&gawk-version;
    66 cp    -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-&gawk-version;</userinput></screen>
     62<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    6763
    6864  </sect2>
    6965
    70   <sect2 id="contents-gawk" role="content">
    71     <title>Contents of Gawk</title>
     66  <sect2 role="content">
     67    <title/>
    7268
    73     <segmentedlist>
    74       <segtitle>Installed programs</segtitle>
    75       <segtitle>Installed libraries</segtitle>
    76       <segtitle>Installed directories</segtitle>
    77 
    78       <seglistitem>
    79         <seg>awk (link to gawk), gawk, and awk-&gawk-version;</seg>
    80         <seg>filefuncs.so, fnmatch.so, fork.so, inplace.so, intdiv.so, ordchr.so,
    81         readdir.so, readfile.so, revoutput.so, revtwoway.so, rwarray.so,
    82         and time.so (all in /usr/lib/gawk)</seg>
    83         <seg>/usr/lib/gawk, /usr/libexec/awk, /usr/share/awk, and
    84         /usr/share/doc/gawk-&gawk-version;</seg>
    85       </seglistitem>
    86     </segmentedlist>
    87 
    88     <variablelist>
    89       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    90       <?dbfo list-presentation="list"?>
    91       <?dbhtml list-presentation="table"?>
    92 
    93       <varlistentry id="awk">
    94         <term><command>awk</command></term>
    95         <listitem>
    96           <para>A link to <command>gawk</command></para>
    97           <indexterm zone="ch-system-gawk awk">
    98             <primary sortas="b-awk">awk</primary>
    99           </indexterm>
    100         </listitem>
    101       </varlistentry>
    102 
    103       <varlistentry id="gawk">
    104         <term><command>gawk</command></term>
    105         <listitem>
    106           <para>A program for manipulating text files; it is the GNU
    107           implementation of <command>awk</command></para>
    108           <indexterm zone="ch-system-gawk gawk">
    109             <primary sortas="b-gawk">gawk</primary>
    110           </indexterm>
    111         </listitem>
    112       </varlistentry>
    113 
    114       <varlistentry id="gawk-version">
    115         <term><command>gawk-&gawk-version;</command></term>
    116         <listitem>
    117           <para>A hard link to <command>gawk</command></para>
    118           <indexterm zone="ch-system-gawk gawk-version">
    119             <primary sortas="b-gawk-&gawk-version;">gawk-&gawk-version;</primary>
    120           </indexterm>
    121         </listitem>
    122       </varlistentry>
    123 
    124     </variablelist>
     69    <para>Details on this package are located in
     70    <xref linkend="contents-gawk" role="."/></para>
    12571
    12672  </sect2>
  • chapter06/grep.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-system-grep" role="wrap">
     8<sect1 id="ch-tools-grep" role="wrap">
    99  <?dbhtml filename="grep.html"?>
    1010
     
    1717  <title>Grep-&grep-version;</title>
    1818
    19   <indexterm zone="ch-system-grep">
     19  <indexterm zone="ch-tools-grep">
    2020    <primary sortas="a-Grep">Grep</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Grep package contains programs for searching through files.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/grep.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2730
    2831    <segmentedlist>
     
    3134
    3235      <seglistitem>
    33         <seg>&grep-ch6-sbu;</seg>
    34         <seg>&grep-ch6-du;</seg>
     36        <seg>&grep-tmp-sbu;</seg>
     37        <seg>&grep-tmp-du;</seg>
    3538      </seglistitem>
    3639    </segmentedlist>
     
    4346    <para>Prepare Grep for compilation:</para>
    4447
    45 <screen><userinput remap="configure">./configure --prefix=/usr --bindir=/bin</userinput></screen>
     48<screen><userinput remap="configure">./configure --prefix=/usr   \
     49            --host=$LFS_TGT \
     50            --bindir=/bin</userinput></screen>
    4651
    4752    <para>Compile the package:</para>
     
    4954<screen><userinput remap="make">make</userinput></screen>
    5055
    51     <para>To test the results, issue:</para>
    52 
    53 <screen><userinput remap="test">make check</userinput></screen>
    54 
    5556    <para>Install the package:</para>
    5657
    57 <screen><userinput remap="install">make install</userinput></screen>
     58<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    5859
    5960  </sect2>
    6061
    61   <sect2 id="contents-grep" role="content">
    62     <title>Contents of Grep</title>
     62  <sect2 role="content">
     63    <title/>
    6364
    64     <segmentedlist>
    65       <segtitle>Installed programs</segtitle>
    66 
    67       <seglistitem>
    68         <seg>egrep, fgrep, and grep</seg>
    69       </seglistitem>
    70     </segmentedlist>
    71 
    72     <variablelist>
    73       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    74       <?dbfo list-presentation="list"?>
    75       <?dbhtml list-presentation="table"?>
    76 
    77       <varlistentry id="egrep">
    78         <term><command>egrep</command></term>
    79         <listitem>
    80           <para>Prints lines matching an extended regular expression</para>
    81           <indexterm zone="ch-system-grep egrep">
    82             <primary sortas="b-egrep">egrep</primary>
    83           </indexterm>
    84         </listitem>
    85       </varlistentry>
    86 
    87       <varlistentry id="fgrep">
    88         <term><command>fgrep</command></term>
    89         <listitem>
    90           <para>Prints lines matching a list of fixed strings</para>
    91           <indexterm zone="ch-system-grep fgrep">
    92             <primary sortas="b-fgrep">fgrep</primary>
    93           </indexterm>
    94         </listitem>
    95       </varlistentry>
    96 
    97       <varlistentry id="grep">
    98         <term><command>grep</command></term>
    99         <listitem>
    100           <para>Prints lines matching a basic regular expression</para>
    101           <indexterm zone="ch-system-grep grep">
    102             <primary sortas="b-grep">grep</primary>
    103           </indexterm>
    104         </listitem>
    105       </varlistentry>
    106 
    107     </variablelist>
     65    <para>Details on this package are located in
     66    <xref linkend="contents-grep" role="."/></para>
    10867
    10968  </sect2>
  • chapter06/gzip.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-system-gzip" role="wrap">
     8<sect1 id="ch-tools-gzip" role="wrap">
    99  <?dbhtml filename="gzip.html"?>
    1010
     
    1717  <title>Gzip-&gzip-version;</title>
    1818
    19   <indexterm zone="ch-system-gzip">
     19  <indexterm zone="ch-tools-gzip">
    2020    <primary sortas="a-Gzip">Gzip</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Gzip package contains programs for compressing and decompressing
    27     files.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/gzip.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2830
    2931    <segmentedlist>
     
    3234
    3335      <seglistitem>
    34         <seg>&gzip-ch6-sbu;</seg>
    35         <seg>&gzip-ch6-du;</seg>
     36        <seg>&gzip-tmp-sbu;</seg>
     37        <seg>&gzip-tmp-du;</seg>
    3638      </seglistitem>
    3739    </segmentedlist>
     
    4446    <para>Prepare Gzip for compilation:</para>
    4547
    46 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     48<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT</userinput></screen>
    4749
    4850    <para>Compile the package:</para>
     
    5052<screen><userinput remap="make">make</userinput></screen>
    5153
    52     <para>To test the results, issue:</para>
    53 
    54 <screen><userinput remap="test">make check</userinput></screen>
    55 
    56     <para>Two tests are known to fail in the LFS environment:
    57     help-version and zmore.</para>
    58 
    5954    <para>Install the package:</para>
    6055
    61 <screen><userinput remap="install">make install</userinput></screen>
     56<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    6257
    63     <para>Move a program that needs to be on the root filesystem:</para>
     58    <para>Move the excutable to its final expected location:</para>
    6459
    65 <screen><userinput remap="install">mv -v /usr/bin/gzip /bin</userinput></screen>
     60<screen><userinput remap="install">mv -v $LFS/usr/bin/gzip $LFS/bin</userinput></screen>
    6661
    6762  </sect2>
    6863
    69   <sect2 id="contents-gzip" role="content">
    70     <title>Contents of Gzip</title>
     64  <sect2 role="content">
     65    <title/>
    7166
    72     <segmentedlist>
    73       <segtitle>Installed programs</segtitle>
    74 
    75       <seglistitem>
    76         <seg>gunzip, gzexe, gzip, uncompress (hard link with gunzip), zcat, zcmp,
    77         zdiff, zegrep, zfgrep, zforce, zgrep, zless, zmore, and znew</seg>
    78       </seglistitem>
    79     </segmentedlist>
    80 
    81     <variablelist>
    82       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    83       <?dbfo list-presentation="list"?>
    84       <?dbhtml list-presentation="table"?>
    85 
    86       <varlistentry id="gunzip">
    87         <term><command>gunzip</command></term>
    88         <listitem>
    89           <para>Decompresses gzipped files</para>
    90           <indexterm zone="ch-system-gzip gunzip">
    91             <primary sortas="b-gunzip">gunzip</primary>
    92           </indexterm>
    93         </listitem>
    94       </varlistentry>
    95 
    96       <varlistentry id="gzexe">
    97         <term><command>gzexe</command></term>
    98         <listitem>
    99           <para>Creates self-decompressing executable files</para>
    100           <indexterm zone="ch-system-gzip gzexe">
    101             <primary sortas="b-gzexe">gzexe</primary>
    102           </indexterm>
    103         </listitem>
    104       </varlistentry>
    105 
    106       <varlistentry id="gzip">
    107         <term><command>gzip</command></term>
    108         <listitem>
    109           <para>Compresses the given files using Lempel-Ziv (LZ77) coding</para>
    110           <indexterm zone="ch-system-gzip gzip">
    111             <primary sortas="b-gzip">gzip</primary>
    112           </indexterm>
    113         </listitem>
    114       </varlistentry>
    115 
    116       <varlistentry id="uncompress">
    117         <term><command>uncompress</command></term>
    118         <listitem>
    119           <para>Decompresses compressed files</para>
    120           <indexterm zone="ch-system-gzip uncompress">
    121             <primary sortas="b-uncompress">uncompress</primary>
    122           </indexterm>
    123         </listitem>
    124       </varlistentry>
    125 
    126       <varlistentry id="zcat">
    127         <term><command>zcat</command></term>
    128         <listitem>
    129           <para>Decompresses the given gzipped files to standard output</para>
    130           <indexterm zone="ch-system-gzip zcat">
    131             <primary sortas="b-zcat">zcat</primary>
    132           </indexterm>
    133         </listitem>
    134       </varlistentry>
    135 
    136       <varlistentry id="zcmp">
    137         <term><command>zcmp</command></term>
    138         <listitem>
    139           <para>Runs <command>cmp</command> on gzipped files</para>
    140           <indexterm zone="ch-system-gzip zcmp">
    141             <primary sortas="b-zcmp">zcmp</primary>
    142           </indexterm>
    143         </listitem>
    144       </varlistentry>
    145 
    146       <varlistentry id="zdiff">
    147         <term><command>zdiff</command></term>
    148         <listitem>
    149           <para>Runs <command>diff</command> on gzipped files</para>
    150           <indexterm zone="ch-system-gzip zdiff">
    151             <primary sortas="b-zdiff">zdiff</primary>
    152           </indexterm>
    153         </listitem>
    154       </varlistentry>
    155 
    156       <varlistentry id="zegrep">
    157         <term><command>zegrep</command></term>
    158         <listitem>
    159           <para>Runs <command>egrep</command> on gzipped files</para>
    160           <indexterm zone="ch-system-gzip zegrep">
    161             <primary sortas="b-zegrep">zegrep</primary>
    162           </indexterm>
    163         </listitem>
    164       </varlistentry>
    165 
    166       <varlistentry id="zfgrep">
    167         <term><command>zfgrep</command></term>
    168         <listitem>
    169           <para>Runs <command>fgrep</command> on gzipped files</para>
    170           <indexterm zone="ch-system-gzip zfgrep">
    171             <primary sortas="b-zfgrep">zfgrep</primary>
    172           </indexterm>
    173         </listitem>
    174       </varlistentry>
    175 
    176       <varlistentry id="zforce">
    177         <term><command>zforce</command></term>
    178         <listitem>
    179           <para>Forces a <filename class="extension">.gz</filename> extension on
    180           all given files that are gzipped files, so that <command>gzip</command>
    181           will not compress them again; this can be useful when file names were
    182           truncated during a file transfer</para>
    183           <indexterm zone="ch-system-gzip zforce">
    184             <primary sortas="b-zforce">zforce</primary>
    185           </indexterm>
    186         </listitem>
    187       </varlistentry>
    188 
    189       <varlistentry id="zgrep">
    190         <term><command>zgrep</command></term>
    191         <listitem>
    192           <para>Runs <command>grep</command> on gzipped files</para>
    193           <indexterm zone="ch-system-gzip zgrep">
    194             <primary sortas="b-zgrep">zgrep</primary>
    195           </indexterm>
    196         </listitem>
    197       </varlistentry>
    198 
    199       <varlistentry id="zless">
    200         <term><command>zless</command></term>
    201         <listitem>
    202           <para>Runs <command>less</command> on gzipped files</para>
    203           <indexterm zone="ch-system-gzip zless">
    204             <primary sortas="b-zless">zless</primary>
    205           </indexterm>
    206         </listitem>
    207       </varlistentry>
    208 
    209       <varlistentry id="zmore">
    210         <term><command>zmore</command></term>
    211         <listitem>
    212           <para>Runs <command>more</command> on gzipped files</para>
    213           <indexterm zone="ch-system-gzip zmore">
    214             <primary sortas="b-zmore">zmore</primary>
    215           </indexterm>
    216         </listitem>
    217       </varlistentry>
    218 
    219       <varlistentry id="znew">
    220         <term><command>znew</command></term>
    221         <listitem>
    222           <para>Re-compresses files from <command>compress</command> format to
    223           <command>gzip</command> format&mdash;<filename
    224           class="extension">.Z</filename> to <filename
    225           class="extension">.gz</filename></para>
    226           <indexterm zone="ch-system-gzip znew">
    227             <primary sortas="b-znew">znew</primary>
    228           </indexterm>
    229         </listitem>
    230       </varlistentry>
    231 
    232     </variablelist>
     67    <para>Details on this package are located in
     68    <xref linkend="contents-gzip" role="."/></para>
    23369
    23470  </sect2>
  • chapter06/introduction.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-system-introduction">
     8<sect1 id="ch-tools-introduction-cross">
    99  <?dbhtml filename="introduction.html"?>
    1010
    1111  <title>Introduction</title>
    1212
    13   <para>In this chapter, we enter the building site and start constructing the
    14   LFS system in earnest. That is, we chroot into the temporary mini Linux system,
    15   make a few final preparations, and then begin installing the packages.</para>
     13  <para>This chapter shows how to cross-compile basic utilities using
     14  the just built cross-toolchain. Those utilities are installed into
     15  their final location, but cannot be used yet. Basic tasks still rely on
     16  the host's tools. Nevertheless, the installed libraries are used when
     17  linking.</para>
    1618
    17   <para>The installation of this software is straightforward. Although in many
    18   cases the installation instructions could be made shorter and more generic,
    19   we have opted to provide the full instructions for every package to minimize
    20   the possibilities for mistakes.  The key to learning what makes a Linux system
    21   work is to know what each package is used for and why you (or the system)
    22   may need it.</para>
     19  <para>Using the utilities will be possible in next chapter after entering
     20  the <quote>chroot</quote> environment. But all the packages built in the
     21  present chapter need to be built before we do that. Therefore we cannot be
     22  independent of the host system yet.</para>
    2323
    24   <para>We do not recommend using optimizations.  They can make
    25   a program run slightly faster, but they may also cause compilation
    26   difficulties and problems when running the program.  If a package refuses to
    27   compile when using optimization, try to compile it without optimization and
    28   see if that fixes the problem. Even if the package does compile when using
    29   optimization, there is the risk it may have been compiled incorrectly because
    30   of the complex interactions between the code and build tools.  Also note that
    31   the <option>-march</option> and <option>-mtune</option> options using values
    32   not specified in the book have not been tested. This may cause problems with
    33   the toolchain packages (Binutils, GCC and Glibc).  The small potential gains
    34   achieved in using compiler optimizations are often outweighed by the risks.
    35   First-time builders of LFS are encouraged to build without custom
    36   optimizations. The subsequent system will still run very fast and be stable
    37   at the same time.</para>
    38 
    39   <para>The order that packages are installed in this chapter needs to be
    40   strictly followed to ensure that no program accidentally acquires a path
    41   referring to <filename class="directory">/tools</filename> hard-wired into
    42   it.  For the same reason, do not compile separate packages in parallel.
    43   Compiling in parallel may save time (especially on dual-CPU machines), but it
    44   could result in a program containing a hard-wired path to <filename
    45   class="directory">/tools</filename>, which will cause the program to stop
    46   working when that directory is removed.</para>
    47 
    48   <para>Before the installation instructions, each installation page provides
    49   information about the package, including a concise description of what it
    50   contains, approximately how long it will take to build, and how much disk
    51   space is required during this building process. Following the installation
    52   instructions, there is a list of programs and libraries (along with brief
    53   descriptions of these) that the package installs.</para>
    54 
    55   <note><para>The SBU values and required disk space includes
    56   test suite data for all applicable packages in Chapter&nbsp;6.</para></note>
    57 
    58   <sect2>
    59     <title>About libraries</title>
    60 
    61     <para>In general, the LFS editors discourage building and installing static
    62     libraries.  The original purpose for most static libraries has been made
    63     obsolete in a modern Linux system.  In addition linking a static library
    64     into a program can be detrimental.  If an update to the library is needed
    65     to remove a security problem, all programs that use the static library will
    66     need to be relinked to the new library.  Since the use of static libraries
    67     is not always obvious, the relevant programs (and the procedures needed to
    68     do the linking) may not even be known.</para>
    69 
    70     <para>In the procedures in Chapter&nbsp;6, we remove or disable installation of
    71     most static libraries. Usually this is done by passing a
    72     <option>--disable-static</option> option to <command>configure</command>.
    73     In other cases, alternate means are needed. In a few cases, especially
    74     glibc and gcc, the use of static libraries remains essential to the general
    75     package building process. </para>
    76 
    77     <para>For a more complete discussion of libraries, see the discussion
    78     <ulink url="&blfs-root;/view/&short-version;/introduction/libraries.html">
    79     Libraries: Static or shared?</ulink> in the BLFS book.</para>
    80 
    81   </sect2>
     24  <para>Once again, let us recall that improper setting of <envar>LFS</envar>
     25  together with building as root, may render your computer unusable.
     26  This whole chapter must be done as user <systemitem
     27  class="username">lfs</systemitem>, with the enviroment as described in
     28  <xref linkend="ch-preps-settingenviron"/>.</para>
    8229
    8330</sect1>
  • chapter06/m4.xml

    rd4fdde6 r37e35d2  
    66]>
    77
    8 <sect1 id="ch-system-m4" role="wrap">
     8<sect1 id="ch-tools-m4" role="wrap">
    99  <?dbhtml filename="m4.html"?>
    1010
     
    1717  <title>M4-&m4-version;</title>
    1818
    19   <indexterm zone="ch-system-m4">
     19  <indexterm zone="ch-tools-m4">
    2020    <primary sortas="a-M4">M4</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The M4 package contains a macro processor.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/m4.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2730
    2831    <segmentedlist>
     
    3134
    3235      <seglistitem>
    33         <seg>&m4-ch6-sbu;</seg>
    34         <seg>&m4-ch6-du;</seg>
     36        <seg>&m4-tmp-sbu;</seg>
     37        <seg>&m4-tmp-du;</seg>
    3538      </seglistitem>
    3639    </segmentedlist>
     
    4144    <title>Installation of M4</title>
    4245
    43     <para>First, make some fixes required by glibc-2.28:</para>
     46    <para>First, make some fixes introduced by glibc-2.28:</para>
    4447
    4548<screen><userinput remap="pre">sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
     
    4851    <para>Prepare M4 for compilation:</para>
    4952
    50 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     53<screen><userinput remap="configure">./configure --prefix=/usr   \
     54            --host=$LFS_TGT \
     55            --build=$(build-aux/config.guess)</userinput></screen>
    5156
    5257    <para>Compile the package:</para>
     
    5459<screen><userinput remap="make">make</userinput></screen>
    5560
    56     <para>To test the results, issue:</para>
    57 
    58 <screen><userinput remap="test">make check</userinput></screen>
    59 
    6061    <para>Install the package:</para>
    6162
    62 <screen><userinput remap="install">make install</userinput></screen>
     63<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    6364
    6465  </sect2>
    6566
    66   <sect2 id="contents-m4" role="content">
    67     <title>Contents of M4</title>
    68 
    69     <segmentedlist>
    70       <segtitle>Installed program</segtitle>
    71 
    72       <seglistitem>
    73         <seg>m4</seg>
    74       </seglistitem>
    75     </segmentedlist>
    76 
    77     <variablelist>
    78       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    79       <?dbfo list-presentation="list"?>
    80       <?dbhtml list-presentation="table"?>
    81 
    82       <varlistentry id="m4">
    83          <!-- Don't remove the extra space, it prevet a FOP warning. -->
    84         <term><command>m4 </command></term>
    85         <listitem>
    86           <para>Copies the given files while expanding the macros that they
    87           contain [These macros are either built-in or user-defined and can
    88           take any number of arguments. Besides performing macro expansion,
    89           <command>m4</command> has built-in functions for including named
    90           files, running Unix commands, performing integer arithmetic,
    91           manipulating text, recursion, etc. The <command>m4</command> program
    92           can be used either as a front-end to a compiler or as a macro processor
    93           in its own right.]</para>
    94           <indexterm zone="ch-system-m4 m4">
    95             <primary sortas="b-m4">m4</primary>
    96           </indexterm>
    97         </listitem>
    98       </varlistentry>
    99 
    100     </variablelist>
     67  <sect2 role="content">
     68    <title/>
     69    <para>Details on this package are located in
     70    <xref linkend="contents-m4" role="."/></para>
    10171
    10272  </sect2>
  • chapter06/make.xml

    rd4fdde6 r37e35d2  
    55  %general-entities;
    66]>
    7 
    8 <sect1 id="ch-system-make" role="wrap">
     7<sect1 id="ch-tools-make" role="wrap">
    98  <?dbhtml filename="make.html"?>
    109
     
    1716  <title>Make-&make-version;</title>
    1817
    19   <indexterm zone="ch-system-make">
     18  <indexterm zone="ch-tools-make">
    2019    <primary sortas="a-Make">Make</primary>
     20    <secondary>tools</secondary>
    2121  </indexterm>
    2222
     
    2424    <title/>
    2525
    26     <para>The Make package contains a program for compiling packages.</para>
     26    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     27    href="../chapter08/make.xml"
     28    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2729
    2830    <segmentedlist>
     
    3133
    3234      <seglistitem>
    33         <seg>&make-ch6-sbu;</seg>
    34         <seg>&make-ch6-du;</seg>
     35        <seg>&make-tmp-sbu;</seg>
     36        <seg>&make-tmp-du;</seg>
    3537      </seglistitem>
    3638    </segmentedlist>
     
    4042  <sect2 role="installation">
    4143    <title>Installation of Make</title>
    42 <!--
    43     <para>Again, work around an error caused by glibc-2.27 and later:</para>
    4444
    45 <screen><userinput remap="pre">sed -i '211,217 d; 219,229 d; 232 d' glob/glob.c</userinput></screen>
    46 -->
    4745    <para>Prepare Make for compilation:</para>
    4846
    49 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     47<screen><userinput remap="configure">./configure --prefix=/usr   \
     48            --without-guile \
     49            --host=$LFS_TGT \
     50            --build=$(build-aux/config.guess)</userinput></screen>
     51
     52    <variablelist>
     53      <title>The meaning of the new configure option:</title>
     54
     55      <varlistentry>
     56        <term><parameter>--without-guile</parameter></term>
     57        <listitem>
     58          <para>Although we are cross-compiling, configure tries to use
     59          guile from the build host if it finds it. This makes compilation
     60          fail, so this switch prevents using it.</para>
     61        </listitem>
     62      </varlistentry>
     63    </variablelist>
    5064
    5165    <para>Compile the package:</para>
     
    5367<screen><userinput remap="make">make</userinput></screen>
    5468
    55     <para>The test suite needs to know where supporting perl files are located.
    56     We use an environment variable to accomplish this.  To test the
    57     results, issue:</para>
    58