Index: chapter01/changelog.xml
===================================================================
--- chapter01/changelog.xml	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ chapter01/changelog.xml	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -38,4 +38,26 @@
 
     <listitem>
+      <para>2015-04-24</para>
+      <itemizedlist>
+        <listitem>
+          <para>[krejzi] - Added a fix for security issue
+          in Glibc (CVE-2015-1781). Thanks to Ken Moffat
+          for bringing it up and Bruce Dubbs for providing
+          the fix in form of a sed.</para>
+        </listitem>
+        <listitem>
+          <para>[krejzi] - Fixed Ncurses and Perl build
+          with GCC 5. Thanks to Ken Moffat and Douglas
+          R. Reno for providing the patches.</para>
+        </listitem>
+        <listitem>
+          <para>[krejzi] - Updated to GCC-5.1.0. Fixes
+          <ulink url="&lfs-ticket-root;3779">#3779</ulink>.</para>
+        </listitem>
+      </itemizedlist>
+    </listitem>
+
+
+    <listitem>
       <para>2015-04-21</para>
       <itemizedlist>
Index: chapter01/whatsnew.xml
===================================================================
--- chapter01/whatsnew.xml	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ chapter01/whatsnew.xml	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -86,7 +86,7 @@
       <para>Gawk &gawk-version;</para>
     </listitem>-->
-    <!--<listitem>
+    <listitem>
       <para>GCC &gcc-version;</para>
-    </listitem>-->
+    </listitem>
     <!--<listitem>
       <para>GDBM &gdbm-version;</para>
@@ -243,4 +243,12 @@
     </listitem>
 
+    <listitem>
+      <para>&ncurses-gcc5-buildfixes-patch;</para>
+    </listitem>
+
+    <listitem>
+      <para>&perl-gcc5-fixes-patch;</para>
+    </listitem>
+
     <!--<listitem>
       <para>&bash-fixes-patch;</para>
Index: chapter03/patches.xml
===================================================================
--- chapter03/patches.xml	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ chapter03/patches.xml	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -124,13 +124,21 @@
       </listitem>
     </varlistentry>
-<!--
+
     <varlistentry>
-      <term>Perl Data::Dumper Patch - <token>&perl-fix-patch-size;</token>:</term>
+      <term>Ncurses GCC 5 Fixes Patch - <token>&ncurses-gcc5-buildfixes-patch-size;</token>:</term>
       <listitem>
-        <para>Download: <ulink url="&patches-root;&perl-fix-patch;"/></para>
-        <para>MD5 sum: <literal>&perl-fix-patch-md5;</literal></para>
+        <para>Download: <ulink url="&patches-root;&ncurses-gcc5-buildfixes-patch;"/></para>
+        <para>MD5 sum: <literal>&ncurses-gcc5-buildfixes-patch-md5;</literal></para>
       </listitem>
     </varlistentry>
--->
+
+    <varlistentry>
+      <term>Perl GCC 5 Fixes Patch - <token>&perl-gcc5-fixes-patch-size;</token>:</term>
+      <listitem>
+        <para>Download: <ulink url="&patches-root;&perl-gcc5-fixes-patch;"/></para>
+        <para>MD5 sum: <literal>&perl-gcc5-fixes-patch-md5;</literal></para>
+      </listitem>
+    </varlistentry>
+
     <varlistentry>
       <term>Readline Upstream Fixes Patch - <token>&readline-fixes-patch-size;</token>:</term>
Index: chapter05/glibc.xml
===================================================================
--- chapter05/glibc.xml	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ chapter05/glibc.xml	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -44,4 +44,5 @@
     <title>Installation of Glibc</title>
 
+<!-- The enable-obsolete-rpc should handle this just fine.
     <para>In some cases, particularly LFS 7.1, the rpc headers were not
     installed properly.  Test to see if they are installed in the host system
@@ -52,5 +53,5 @@
   su -c 'cp -v sunrpc/rpc/*.h /usr/include/rpc'
 fi</userinput></screen>
-
+-->
     <para>Fix a regression in the package that affects 32-bit architectures:</para>
 
@@ -88,4 +89,5 @@
       --disable-profile                             \
       --enable-kernel=&min-kernel;                        \
+      --enable-obsolete-rpc                         \
       --with-headers=/tools/include                 \
       libc_cv_forced_unwind=yes                     \
@@ -119,4 +121,13 @@
           for &min-kernel; and later Linux kernels.  Workarounds for older
           kernels are not enabled.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><parameter>--enable-obsolete-rpc</parameter></term>
+        <listitem>
+          <para>This installs NIS and RPC related headers that are not
+          installed by default. They are required to build GCC and by
+          several BLFS packages.</para>
         </listitem>
       </varlistentry>
Index: chapter05/libstdc++.xml
===================================================================
--- chapter05/libstdc++.xml	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ chapter05/libstdc++.xml	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -51,5 +51,5 @@
     <para>Create a directory for Libstdc++ and enter it:</para>
 
-<screen><userinput remap="pre">mkdir -pv ../gcc-build
+<screen><userinput remap="pre">mkdir -v ../gcc-build
 cd ../gcc-build</userinput></screen>
 
@@ -60,5 +60,4 @@
     --prefix=/tools                 \
     --disable-multilib              \
-    --disable-shared                \
     --disable-nls                   \
     --disable-libstdcxx-threads     \
Index: chapter05/ncurses.xml
===================================================================
--- chapter05/ncurses.xml	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ chapter05/ncurses.xml	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -43,4 +43,9 @@
   <sect2 role="installation">
     <title>Installation of Ncurses</title>
+
+    <para>First, apply a patch to prevent a build failure
+    when building with GCC 5:</para>
+
+<screen><userinput remap="pre">patch -Np1 -i ../&ncurses-gcc5-buildfixes-patch;</userinput></screen>
 
     <para>Prepare Ncurses for compilation:</para>
Index: chapter06/glibc.xml
===================================================================
--- chapter06/glibc.xml	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ chapter06/glibc.xml	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -75,4 +75,14 @@
     -i  sysdeps/i386/i686/multiarch/mempcpy_chk.S</userinput></screen>
 
+    <para>Fix a potential security issue identified upstream:</para>
+
+<screen><userinput remap="pre">sed -i '/glibc.*pad/{i\  buflen = buflen > pad ? buflen - pad : 0;
+                     s/ + pad//}' resolv/nss_dns/dns-host.c</userinput></screen>
+
+    <para>Fix a test case that fails when built using GCC 5:</para>
+
+<screen><userinput remap="pre">sed -e '/tst-audit2-ENV/i CFLAGS-tst-audit2.c += -fno-builtin' \
+    -i elf/Makefile</userinput></screen>
+
     <para>The Glibc documentation recommends building Glibc outside of the source
     directory in a dedicated build directory:</para>
@@ -88,18 +98,4 @@
     --enable-kernel=&min-kernel; \
     --enable-obsolete-rpc</userinput></screen>
-
-    <variablelist>
-      <title>The meaning of the new configure options:</title>
-
-      <varlistentry>
-        <term><parameter>--enable-obsolete-rpc</parameter></term>
-        <listitem>
-          <para>Installs NIS and RPC related headers that are not installed by
-          default; these are required to rebuild Glibc and by several BLFS
-          packages.</para>
-        </listitem>
-      </varlistentry>
-
-    </variablelist>
 
     <para>Compile the package:</para>
Index: chapter06/ncurses.xml
===================================================================
--- chapter06/ncurses.xml	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ chapter06/ncurses.xml	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -41,4 +41,9 @@
   <sect2 role="installation">
     <title>Installation of Ncurses</title>
+
+    <para>First, apply a patch to prevent a build failure
+    when building with GCC 5:</para>
+
+<screen><userinput remap="pre">patch -Np1 -i ../&ncurses-gcc5-buildfixes-patch;</userinput></screen>
 
     <para>Don't install a static library that is not handled by configure:</para>
Index: chapter06/perl.xml
===================================================================
--- chapter06/perl.xml	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ chapter06/perl.xml	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -56,9 +56,10 @@
 <screen><userinput remap="pre">export BUILD_ZLIB=False
 export BUILD_BZIP2=0</userinput></screen>
-<!--
-    <para>Fix a potential security problem:</para>
-
-<screen><userinput remap="pre">patch -Np1 -i ../&perl-fix-patch;</userinput></screen>
--->
+
+    <para>Apply a patch to allow the Errno.pm module and the h2ph
+    program to build correctly when building with GCC 5:</para>
+
+<screen><userinput remap="pre">patch -Np1 -i ../&perl-gcc5-fixes-patch;</userinput></screen>
+
     <para>To have full control over the way Perl is set up, you can remove the
     <quote>-des</quote> options from the following command and hand-pick the way
Index: general.ent
===================================================================
--- general.ent	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ general.ent	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -1,5 +1,5 @@
-<!ENTITY version         "20150420-systemd">
+<!ENTITY version         "20150424-systemd">
 <!ENTITY short-version   "systemd">  <!-- Used in dbus chapter, change to x.y for release -->
-<!ENTITY releasedate     "April 20, 2015">
+<!ENTITY releasedate     "April 24, 2015">
 <!ENTITY copyrightdate   "1999-2015"><!-- jhalfs needs a literal dash, not &ndash; -->
 <!ENTITY milestone       "7.8">
Index: packages.ent
===================================================================
--- packages.ent	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ packages.ent	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -198,18 +198,18 @@
 <!ENTITY gawk-ch6-sbu "0.3 SBU">
 
-<!ENTITY gcc-version "4.9.2">
-<!ENTITY gcc-size "87,832 KB">
+<!ENTITY gcc-version "5.1.0">
+<!ENTITY gcc-size "92,736 KB">
 <!ENTITY gcc-url "&gnu;gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
-<!ENTITY gcc-md5 "4df8ee253b7f3863ad0b86359cd39c43">
+<!ENTITY gcc-md5 "d5525b1127d07d215960e6051c5da35e">
 <!ENTITY gcc-home "http://gcc.gnu.org/">
-<!ENTITY gcc-ch5p1-du "2.0 GB">
-<!ENTITY gcc-ch5p1-sbu "5.9 SBU">
-<!ENTITY gcc-ch5p2-du "2.6 GB">
-<!ENTITY gcc-ch5p2-sbu "7.7 SBU">
-<!ENTITY gcc-ch6-du "2.9 GB ">
-<!ENTITY gcc-ch6-sbu "63 SBU (with tests)">
-
-<!ENTITY libstdcpp-ch5-du "798 MB">
-<!ENTITY libstdcpp-ch5-sbu "0.3 SBU">
+<!ENTITY gcc-ch5p1-du "2.4 GB">
+<!ENTITY gcc-ch5p1-sbu "8.0 SBU">
+<!ENTITY gcc-ch5p2-du "2.8 GB">
+<!ENTITY gcc-ch5p2-sbu "10.2 SBU">
+<!ENTITY gcc-ch6-du "2.6 GB ">
+<!ENTITY gcc-ch6-sbu "92 SBU (with tests)">
+
+<!ENTITY libstdcpp-ch5-du "838 MB">
+<!ENTITY libstdcpp-ch5-sbu "0.4 SBU">
 
 <!ENTITY gdbm-version "1.11">
Index: patches.ent
===================================================================
--- patches.ent	(revision 50bb87d1862a4b97fc3b180639143fb21ba24810)
+++ patches.ent	(revision 47f42fadbd7fe1fbf9ceee6cd5e6d305763df449)
@@ -31,9 +31,11 @@
 <!ENTITY mpfr-fixes-patch-size "38 KB">
 
-<!--
-<!ENTITY perl-fix-patch "perl-&perl-version;-infinite_recurse_fix-1.patch">
-<!ENTITY perl-fix-patch-md5 "579dfed34e97e0a2fe21b74aa53946ac">
-<!ENTITY perl-fix-patch-size "11 KB">
--->
+<!ENTITY ncurses-gcc5-buildfixes-patch "ncurses-&ncurses-version;-gcc5_buildfixes-1.patch">
+<!ENTITY ncurses-gcc5-buildfixes-patch-md5 "f9015f670940350a3fc3c2ef347e2b33">
+<!ENTITY ncurses-gcc5-buildfixes-patch-size "4 KB">
+
+<!ENTITY perl-gcc5-fixes-patch "perl-&perl-version;-gcc5_fixes-1.patch">
+<!ENTITY perl-gcc5-fixes-patch-md5 "30f4907f63ec3ef7d50fa55e12d2923e">
+<!ENTITY perl-gcc5-fixes-patch-size "8 KB">
 
 <!ENTITY readline-fixes-patch "readline-&readline-version;-upstream_fixes-3.patch">
