Index: chapter01/changelog.xml
===================================================================
--- chapter01/changelog.xml	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ chapter01/changelog.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -40,4 +40,14 @@
       <para>2011-10-10</para>
       <itemizedlist>
+        <listitem>
+          <para>[bdubbs] - Add a patch for gcc to fix some locale
+          tests. Fixes
+          <ulink url="&lfs-ticket-root;2938">#2938</ulink>.</para>
+        </listitem>
+        <listitem>
+          <para>[bdubbs] - Add check to Chapter 5 and incorate it into
+          libpipeline. Fixes
+          <ulink url="&lfs-ticket-root;2941">#2941</ulink>.</para>
+        </listitem>
         <listitem>
           <para>[bdubbs] - Add a paragraph in Chapter 3.1 about obtaining and
Index: chapter01/whatsnew.xml
===================================================================
--- chapter01/whatsnew.xml	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ chapter01/whatsnew.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -241,4 +241,7 @@
     </listitem>
     <listitem>
+      <para>&gcc-locale-patch;</para>
+    </listitem>
+    <listitem>
       <para>&glibc-fixes-patch;</para>
     </listitem>
Index: chapter03/packages.xml
===================================================================
--- chapter03/packages.xml	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ chapter03/packages.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -66,4 +66,13 @@
         <para>Download: <ulink url="&bzip2-url;"/></para>
         <para>MD5 sum: <literal>&bzip2-md5;</literal></para>
+      </listitem>
+    </varlistentry>
+
+    <varlistentry>
+      <term>Check (&check-version;) - <token>&check-size;</token>:</term>
+      <listitem>
+        <para>Home page: <ulink url="&check-home;"/></para>
+        <para>Download: <ulink url="&check-url;"/></para>
+        <para>MD5 sum: <literal>&check-md5;</literal></para>
       </listitem>
     </varlistentry>
Index: chapter03/patches.xml
===================================================================
--- chapter03/patches.xml	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ chapter03/patches.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -99,4 +99,12 @@
     </varlistentry>
 
+    <varlistentry>
+      <term>GCC Locale Patch - <token>&gcc-locale-patch-size;</token>:</term>
+      <listitem>
+        <para>Download: <ulink url="&patches-root;&gcc-locale-patch;"/></para>
+        <para>MD5 sum: <literal>&gcc-locale-patch-md5;</literal></para>
+      </listitem>
+    </varlistentry>
+
 <!--
     <varlistentry>
Index: chapter05/chapter05.xml
===================================================================
--- chapter05/chapter05.xml	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ chapter05/chapter05.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -25,4 +25,5 @@
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="expect.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dejagnu.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="check.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ncurses.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bash.xml"/>
Index: chapter05/check.xml
===================================================================
--- chapter05/check.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
+++ chapter05/check.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+
+<sect1 id="ch-tools-check" role="wrap">
+  <?dbhtml filename="check.html"?>
+
+  <sect1info condition="script">
+    <productname>check</productname>
+    <productnumber>&check-version;</productnumber>
+    <address>&check-url;</address>
+  </sect1info>
+
+  <title>Check-&check-version;</title>
+
+  <indexterm zone="ch-tools-check">
+    <primary sortas="a-Check">Check</primary>
+  </indexterm>
+
+  <sect2 role="package">
+    <title/>
+
+    <para>Check is a unit testing framework for C.</para>
+
+    <segmentedlist>
+      <segtitle>&buildtime;</segtitle>
+      <segtitle>&diskspace;</segtitle>
+
+      <seglistitem>
+        <seg>&check-ch5-sbu;</seg>
+        <seg>&check-ch5-du;</seg>
+      </seglistitem>
+    </segmentedlist>
+
+  </sect2>
+
+  <sect2 role="installation">
+    <title>Installation of Check</title>
+
+    <para>Prepare Check for compilation:</para>
+
+<screen><userinput remap="configure">./configure --prefix=/tools</userinput></screen>
+
+    <para>Build the package:</para>
+
+<screen><userinput remap="make">make</userinput></screen>
+
+    <para>Compilation is now complete. As discussed earlier, running the test
+    suite is not mandatory for the temporary tools here in this chapter. To run
+    the Check test suite anyway, issue the following command:</para>
+
+<screen><userinput remap="test">make check</userinput></screen>
+
+    <para>Note that the Check test suite may take a relatively long 
+    (up to 4 SBU) time.</para>
+
+    <para>Install the package:</para>
+
+<screen><userinput remap="install">make install</userinput></screen>
+
+  </sect2>
+
+  <sect2 id="contents-check" role="content">
+    <title>Contents of Check</title>
+
+    <segmentedlist>
+      <segtitle>Installed library</segtitle>
+
+      <seglistitem>
+        <seg>libcheck.{a,so}</seg>
+      </seglistitem>
+    </segmentedlist>
+
+    <variablelist>
+      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
+      <?dbfo list-presentation="list"?>
+      <?dbhtml list-presentation="table"?>
+
+      <varlistentry id="libcheck">
+        <term><filename class="libraryfile">libcheck.{a,so}</filename></term>
+        <listitem>
+          <para>Contains functions that allow Check to be called from a test
+          program</para>
+          <indexterm zone="ch-tools-check libcheck">
+            <primary sortas="c-libcheck">libcheck</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+
+  </sect2>
+
+</sect1>
Index: chapter05/tcl.xml
===================================================================
--- chapter05/tcl.xml	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ chapter05/tcl.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -41,11 +41,11 @@
     <title>Installation of Tcl</title>
 
-    <para>This package and the next two (Expect and DejaGNU) are installed
-    to support running the test suites for GCC and Binutils. Installing
-    three packages for testing purposes may seem excessive, but it is very
-    reassuring, if not essential, to know that the most important tools are
-    working properly. Even if the test suites are not run in this chapter
-    (they are not mandatory), these packages are required to run the test
-    suites in <xref linkend="chapter-building-system"/>.</para>
+    <para>This package and the next three (Expect, DejaGNU, and Check) are
+    installed to support running the test suites for GCC and Binutils and other
+    packages.  Installing four packages for testing purposes may seem
+    excessive, but it is very reassuring, if not essential, to know that the
+    most important tools are working properly. Even if the test suites are not
+    run in this chapter (they are not mandatory), these packages are required
+    to run the test suites in <xref linkend="chapter-building-system"/>.</para>
 
     <para>Prepare Tcl for compilation:</para>
Index: chapter06/gcc.xml
===================================================================
--- chapter06/gcc.xml	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ chapter06/gcc.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -66,4 +66,9 @@
 
 <screen><userinput remap="pre">sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in</userinput></screen>
+
+    <para>Finally, apply a patch that corrects the test code for locale changes
+    that were made in glibc-2.14 and later.</para>
+
+<screen><userinput remap="pre">patch -Np1 -i ../gcc-4.6.1-locale-1.patch</userinput></screen>
 
     <para>The GCC documentation recommends building GCC outside of the source
Index: chapter06/glibc.xml
===================================================================
--- chapter06/glibc.xml	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ chapter06/glibc.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -206,4 +206,8 @@
         make -k check</command>).</para>
       </listitem>
+      <listitem>
+        <para>Other tests known to fail on some architectures are posix/bug-regex32, 
+        misc/tst-writev, elf/check-textrel, nptl/tst-getpid2, and stdio-common/bug22.</para>
+      </listitem>
     </itemizedlist>
 
Index: chapter06/libpipeline.xml
===================================================================
--- chapter06/libpipeline.xml	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ chapter06/libpipeline.xml	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -44,5 +44,19 @@
     <para>Prepare Libpipeline for compilation:</para>
 
-<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
+<screen><userinput remap="configure">./configure CHECK_CFLAGS=-I/tools/include \
+    CHECK_LIBS="-L/tools/lib -lcheck" --prefix=/usr</userinput></screen>
+
+    <variablelist>
+      <title>The meaning of the configure options:</title>
+
+      <varlistentry>
+        <term><parameter>CHECK_CFLAGS=, CHECK_LIBS=</parameter></term>
+        <listitem>
+          <para>These environment variables specify the location of the test
+          library built in <xref linkend="ch-tools-check"/>.</para>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
 
     <para>Compile the package:</para>
@@ -50,5 +64,7 @@
 <screen><userinput remap="make">make</userinput></screen>
 
-    <para>This package does not come with a test suite.</para>
+    <para>To test the results, issue:</para>
+
+<screen><userinput remap="test">make check</userinput></screen>
 
     <para>Install the package:</para>
Index: packages.ent
===================================================================
--- packages.ent	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ packages.ent	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -69,4 +69,12 @@
 <!ENTITY bzip2-ch6-du "6.4 MB">
 <!ENTITY bzip2-ch6-sbu "less than 0.1 SBU">
+
+<!ENTITY check-version "0.9.8">
+<!ENTITY check-size "546 KB">
+<!ENTITY check-url "http://sourceforge.net/projects/check/files/check/&check-version;/check-&check-version;.tar.gz">
+<!ENTITY check-md5 "5d75e9a6027cde79d2c339ef261e7470">
+<!ENTITY check-home "http://check.sourceforge.net/">
+<!ENTITY check-ch5-du "4.8 MB">
+<!ENTITY check-ch5-sbu "0.1 SBU">
 
 <!ENTITY coreutils-version "8.13">
Index: patches.ent
===================================================================
--- patches.ent	(revision 1c2d2089a5ccbf5ba6099960bafa077c0ad0b3f8)
+++ patches.ent	(revision ee321a46882b7583b2b831b87e6afce2e5652a6d)
@@ -40,4 +40,7 @@
 <!ENTITY gcc-startfiles-patch-size "1.5 KB">
 
+<!ENTITY gcc-locale-patch "gcc-&gcc-version;-locale-1.patch">
+<!ENTITY gcc-locale-patch-md5 "406572f979f480be1450eb88eea08caa">
+<!ENTITY gcc-locale-patch-size "4 KB">
 
 <!ENTITY glibc-fixes-patch "glibc-&glibc-version;-fixes-2.patch">
