Index: chapter08/acl.xml
===================================================================
--- chapter08/acl.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/acl.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -42,4 +42,8 @@
   <sect2 role="installation">
     <title>Installation of Acl</title>
+
+    &update-config-text;
+
+<screen><userinput remap="pre">tar -C build-aux &update-config-arg;</userinput></screen>
 
     <para>Prepare Acl for compilation:</para>
Index: chapter08/attr.xml
===================================================================
--- chapter08/attr.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/attr.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -41,4 +41,8 @@
   <sect2 role="installation">
     <title>Installation of Attr</title>
+
+    &update-config-text;
+
+<screen><userinput remap="pre">tar -C build-aux &update-config-arg;</userinput></screen>
 
     <para>Prepare Attr for compilation:</para>
Index: chapter08/binutils.xml
===================================================================
--- chapter08/binutils.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/binutils.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -52,5 +52,4 @@
 <screen><userinput remap="configure">../configure --prefix=/usr       \
              --sysconfdir=/etc   \
-             --enable-gold       \
              --enable-ld=default \
              --enable-plugins    \
@@ -63,12 +62,4 @@
 
       <varlistentry>
-        <term><parameter>--enable-gold</parameter></term>
-        <listitem>
-          <para>Build the gold linker and install it as ld.gold (alongside the
-          default linker).</para>
-        </listitem>
-      </varlistentry>
-
-      <varlistentry>
         <term><parameter>--enable-ld=default</parameter></term>
         <listitem>
@@ -116,6 +107,6 @@
           ultimately be located) is set to <filename
           class="directory">$(exec_prefix)/$(target_alias)</filename>. For
-          example, x86_64 machines would expand that to <filename
-          class="directory">/usr/x86_64-pc-linux-gnu</filename>. Because this is
+          example, 64-bit LoongArch machines would expand that to <filename
+          class="directory">/usr/loongarch64-unknown-linux-gnu</filename>. Because this is
           a custom system, this target-specific directory in <filename
           class="directory">/usr</filename> is not required. <filename
@@ -142,8 +133,4 @@
 <screen><userinput remap="test">grep '^FAIL:' $(find -name '*.log')</userinput></screen>
 
-    <para>Twelve tests fail in the gold test suite when the
-    <option>--enable-default-pie</option> and
-    <option>--enable-default-ssp</option> options are passed to GCC.</para>
-
     <para>Install the package:</para>
 
@@ -166,5 +153,5 @@
 
       <seglistitem>
-        <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, ld.gold, nm,
+        <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, nm,
         objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
         <seg>libbfd.so, libctf.so, libctf-nobfd.so, libopcodes.so, and libsframe.so</seg>
@@ -271,15 +258,4 @@
           <indexterm zone="ch-system-binutils ld">
             <primary sortas="b-ld">ld</primary>
-          </indexterm>
-        </listitem>
-      </varlistentry>
-
-      <varlistentry id="ld.gold">
-        <term><command>ld.gold</command></term>
-        <listitem>
-          <para>A cut down version of ld that only supports the
-          elf object file format</para>
-          <indexterm zone="ch-system-binutils ld.gold">
-            <primary sortas="b-ld.gold">ld.gold</primary>
           </indexterm>
         </listitem>
Index: chapter08/check.xml
===================================================================
--- chapter08/check.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/check.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -40,4 +40,8 @@
   <sect2 role="installation">
     <title>Installation of Check</title>
+
+    &update-config-text;
+
+<screen><userinput remap="pre">tar &update-config-arg;</userinput></screen>
 
     <para>Prepare Check for compilation:</para>
Index: chapter08/expect.xml
===================================================================
--- chapter08/expect.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/expect.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -48,4 +48,8 @@
   <sect2 role="installation">
     <title>Installation of Expect</title>
+
+    &update-config-text;
+
+<screen><userinput remap="pre">tar -C tclconfig &update-config-arg;</userinput></screen>
 
     <para>Prepare Expect for compilation:</para>
Index: chapter08/file.xml
===================================================================
--- chapter08/file.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/file.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -41,4 +41,8 @@
   <sect2 role="installation">
     <title>Installation of File</title>
+
+    &update-config-text;
+
+<screen><userinput remap="pre">tar &update-config-arg;</userinput></screen>
 
     <para>Prepare File for compilation:</para>
Index: chapter08/flex.xml
===================================================================
--- chapter08/flex.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/flex.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -51,4 +51,8 @@
     This is not present, so we use an environment variable to skip this process.
     Now, prepare Flex for compilation:</para> -->
+
+    &update-config-text;
+
+<screen><userinput remap="pre">tar -C build-aux &update-config-arg;</userinput></screen>
 
     <para>Prepare Flex for compilation:</para>
Index: chapter08/gcc.xml
===================================================================
--- chapter08/gcc.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/gcc.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -55,13 +55,8 @@
     <screen><userinput remap="pre">patch -Np1 -i ../&gcc-upstream-fixes-patch;</userinput></screen>
 -->
-    <para>If building on x86_64, change the default directory name for 64-bit
-    libraries to <quote>lib</quote>:</para>
-
-<screen><userinput remap="pre">case $(uname -m) in
-  x86_64)
-    sed -e '/m64=/s/lib64/lib/' \
-        -i.orig gcc/config/i386/t-linux64
-  ;;
-esac</userinput></screen>
+    <para>Set the default directory name for
+    64-bit libraries to <quote>lib</quote>:</para>
+
+<screen><userinput remap="pre">sed 's/lib64/lib/' -i.orig gcc/config/loongarch/{t-linux,linux.h}</userinput></screen>
 
     <para>The GCC documentation recommends building GCC in a dedicated build directory:</para>
@@ -173,15 +168,13 @@
     <ulink url="https://gcc.gnu.org/ml/gcc-testresults/"/>.</para>
 
-    <para>Two tests named <filename>pr104610.c</filename> and
-    <filename>pr69482-1.c</filename> are known to fail because the test
-    files does not account for the
-    <parameter>--enable-default-ssp</parameter> option.
-    <!-- https://gcc.gnu.org/PR106375 and https://gcc.gnu.org/PR109353 -->
-    Two tests named <filename>copy.cc</filename> and
-    <filename>pr56837.c</filename> are known to fail.
-    <!-- https://gcc.gnu.org/PR107855#c6 -->
-    Additionally, several tests in the
-    <filename class='directory'>vect</filename> directory are known to fail
-    if the hardware does not support AVX.</para>
+    <para>The tests named
+    <filename>pr64076</filename>,
+    <filename>pr90883.C</filename>,
+    <filename>pr108357.c</filename>,
+    <filename>uninit-pred-9_b.c</filename>,
+    <filename>ssa-dom-cse-2.c</filename>,
+    <filename>stack-check-cfa-1.c</filename>, and
+    <filename>stack-check-cfa-2.c</filename>
+    are known to fail.</para>
 
     <para>A few unexpected failures cannot always be avoided. The GCC developers
@@ -242,5 +235,5 @@
   platform-specific differences in the dynamic linker name):</para>
 
-<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
+<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-loongarch-lp64d.so.1]</computeroutput></screen>
 
   <para>Now make sure that we're set up to use the correct start files:</para>
@@ -250,7 +243,7 @@
   <para>The output of the last command should be:</para>
 
-<screen><computeroutput>/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/Scrt1.o succeeded
-/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded
-/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
+<screen><computeroutput>/usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/Scrt1.o succeeded
+/usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded
+/usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
 
   <para>Depending on your machine architecture, the above may differ slightly.
@@ -269,7 +262,7 @@
 
 <screen><computeroutput>#include &lt;...&gt; search starts here:
- /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include
+ /usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/include
  /usr/local/include
- /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed
+ /usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/include-fixed
  /usr/include</computeroutput></screen>
 
@@ -284,13 +277,13 @@
   be ignored, but otherwise the output of the last command should be:</para>
 
-<screen><computeroutput>SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
+<screen><computeroutput>SEARCH_DIR("/usr/loongarch64-unknown-linux-gnu/lib64")
 SEARCH_DIR("/usr/local/lib64")
 SEARCH_DIR("/lib64")
 SEARCH_DIR("/usr/lib64")
-SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")
+SEARCH_DIR("/usr/loongarch64-unknown-linux-gnu/lib")
 SEARCH_DIR("/usr/local/lib")
 SEARCH_DIR("/lib")
 SEARCH_DIR("/usr/lib");</computeroutput></screen>
-
+<!--
    <para>A 32-bit system may use a few other directories. For example, here
    is the output from an i686 machine:</para>
@@ -304,5 +297,5 @@
 SEARCH_DIR("/lib")
 SEARCH_DIR("/usr/lib");</computeroutput></screen>
-
+-->
   <para>Next make sure that we're using the correct libc:</para>
 
@@ -320,5 +313,5 @@
   platform-specific differences in dynamic linker name):</para>
 
-<screen><computeroutput>found ld-linux-x86-64.so.2 at /usr/lib/ld-linux-x86-64.so.2</computeroutput></screen>
+<screen><computeroutput>found ld-linux-loongarch-lp64d.so.1 at /usr/lib/ld-linux-loongarch-lp64d.so.1</computeroutput></screen>
 
   <para>If the output does not appear as shown above or is not received
Index: chapter08/gdbm.xml
===================================================================
--- chapter08/gdbm.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/gdbm.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -49,4 +49,8 @@
 <screen><userinput remap="pre">sed -r -i '/^char.*parseopt_program_(doc|args)/d' src/parseopt.c</userinput></screen>
 -->
+    &update-config-text;
+
+<screen><userinput remap="pre">tar -C build-aux &update-config-arg;</userinput></screen>
+
     <para>Prepare GDBM for compilation:</para>
 
Index: chapter08/gmp.xml
===================================================================
--- chapter08/gmp.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/gmp.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -41,5 +41,5 @@
   <sect2 role="installation">
     <title>Installation of GMP</title>
-
+<!--
     <note>
       <para>If you are building for 32-bit x86, but you have a CPU which is
@@ -50,4 +50,8 @@
 <screen role="nodump"><userinput><parameter>ABI=32</parameter> ./configure ...</userinput></screen></para>
     </note>
+-->
+    &update-config-text;
+
+<screen><userinput remap="pre">tar &update-config-arg;</userinput></screen>
 
     <note>
Index: chapter08/groff.xml
===================================================================
--- chapter08/groff.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/groff.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -41,4 +41,8 @@
   <sect2 role="installation">
     <title>Installation of Groff</title>
+
+    &update-config-text;
+
+<screen><userinput remap="pre">tar -C build-aux &update-config-arg;</userinput></screen>
 
     <para>Groff expects the environment variable <envar>PAGE</envar> to
Index: chapter08/grub.xml
===================================================================
--- chapter08/grub.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/grub.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -43,9 +43,20 @@
     <note>
       <para>
-        If your system has UEFI support and you wish to boot LFS with UEFI,
-        you can skip this package in LFS,
-        and install GRUB with UEFI support (and its dependencies) by following
-        the instructions on
-        <ulink url="&blfs-book;postlfs/grub-efi.html">the BLFS page</ulink>.
+        On LoongArch systems, the following instruction builds GRUB for UEFI.
+        But the built GRUB lacks some features because a few optional
+        dependencies of GRUB for UEFI is beyond the scope of LFS and not
+        installed yet.
+      </para>
+      <para>
+        If your system firmware does not support UEFI, you need to skip the
+        content of this page and try to figure out how to boot your system.
+      </para>
+      <para>
+        If your system firmware supports UEFI and you want a fully
+        functional GRUB, you can skip the content of this page,
+        and install GRUB with UEFI support (and its dependencies) following
+        <ulink url="&blfs-book;postlfs/grub-efi.html">the BLFS page</ulink>
+        (with <parameter>--target=x86_64</parameter> removed) at the end of
+        this chapter.
       </para>
     </note>
@@ -61,13 +72,4 @@
       aggressive optimization.</para>
     </warning>
-
-    <para>
-      Fix an issue causing <command>grub-install</command> to fail when the
-      <filename class='directory'>/boot</filename> partition (or the root
-      partition if <filename class='directory'>/boot</filename> is not a
-      separate partition) is created by e2fsprogs-1.47.0 or later:
-    </para>
-
-<screen><userinput remap='pre'>patch -Np1 -i ../grub-&grub-version;-upstream_fixes-1.patch</userinput></screen>
 
     <para>Prepare GRUB for compilation:</para>
Index: chapter08/libcap.xml
===================================================================
--- chapter08/libcap.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/libcap.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -60,6 +60,5 @@
           <para>This parameter sets the library directory to
           <filename>/usr/lib</filename> rather than
-          <filename>/usr/lib64</filename> on x86_64. It has no effect on
-          x86.</para>
+          <filename>/usr/lib64</filename> on 64-bit LoongArch.</para>
         </listitem>
       </varlistentry>
Index: chapter08/libelf.xml
===================================================================
--- chapter08/libelf.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/libelf.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -44,4 +44,9 @@
       <para>Libelf is part of the elfutils-&elfutils-version; package. Use
       the elfutils-&elfutils-version;.tar.bz2 file as the source tarball.</para>
+
+    <para>Add LoongArch support for this package:</para>
+
+<screen><userinput remap="pre">patch -Np1 -i ../&elfutils-loongarch-patch;
+autoreconf -fi</userinput></screen>
 
     <para>Prepare Libelf for compilation:</para>
Index: chapter08/libffi.xml
===================================================================
--- chapter08/libffi.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/libffi.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -77,6 +77,6 @@
           system, use the less capable system as a parameter. For details
           about alternative system types, see <ulink
-          url='https://gcc.gnu.org/onlinedocs/gcc-&gcc-version;/gcc/x86-Options.html'>
-          the x86 options in the GCC manual</ulink>.</para>
+          url='https://gcc.gnu.org/onlinedocs/gcc-&gcc-version;/gcc/LoongArch-Options.html'>
+          the LoongArch options in the GCC manual</ulink>.</para>
         </listitem>
       </varlistentry>
Index: chapter08/openssl.xml
===================================================================
--- chapter08/openssl.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/openssl.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -55,4 +55,5 @@
          --openssldir=/etc/ssl \
          --libdir=lib          \
+         linux-generic64       \
          shared                \
          zlib-dynamic</userinput></screen>
Index: chapter08/patch.xml
===================================================================
--- chapter08/patch.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/patch.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -42,4 +42,8 @@
   <sect2 role="installation">
     <title>Installation of Patch</title>
+
+    &update-config-text;
+
+<screen><userinput remap="pre">tar -C build-aux &update-config-arg;</userinput></screen>
 
     <para>Prepare Patch for compilation:</para>
Index: chapter08/stripping.xml
===================================================================
--- chapter08/stripping.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/stripping.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -47,6 +47,6 @@
   rationale for using the <command>install</command> command here.)</para>
 
-  <note><para>The ELF loader's name is ld-linux-x86-64.so.2 on 64-bit systems
-  and ld-linux.so.2 on 32-bit systems.  The construct below selects the
+  <note><para>The ELF loader's name may vary on different systems.
+  The construct below selects the
   correct name for the current architecture, excluding anything ending
   with <quote>g</quote>, in case the commands below have already been
Index: chapter08/systemd.xml
===================================================================
--- chapter08/systemd.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/systemd.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -67,4 +67,5 @@
 cd       build
 
+CFLAGS+=" -Wno-format-overflow" \
 meson setup \
       --prefix=/usr                 \
Index: chapter08/udev.xml
===================================================================
--- chapter08/udev.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/udev.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -61,4 +61,5 @@
 cd       build
 
+CFLAGS+=" -Wno-format-overflow" \
 meson setup \
       --prefix=/usr                 \
Index: chapter08/util-linux.xml
===================================================================
--- chapter08/util-linux.xml	(revision e9619f650fc142ac74d5cdbf0b5c23000c1d949e)
+++ chapter08/util-linux.xml	(revision 428ca6c31b7d89a9c0fc7c69ea8fe8c499ea3fa8)
@@ -46,4 +46,8 @@
 
     <screen><userinput remap="pre">sed -i '/test_mkfds/s/^/#/' tests/helpers/Makemodule.am</userinput></screen>
+
+    <para>Disable a test which does not compile on LoongArch:</para>
+
+    <screen><userinput remap="pre">sed -i '/test_enosys/s/^/#/' tests/helpers/Makemodule.am</userinput></screen>
 
     <para>Prepare Util-linux for compilation:</para>
@@ -116,4 +120,8 @@
     known to fail.</para>
 
+    <!-- Related to non-4K page size. -->
+    <para>Two tests named <filename>fadvise/drop</filename> and
+    <filename>fincore/count</filename> are known to fail.</para>
+
     <para>Install the package:</para>
 
@@ -139,5 +147,5 @@
         eject, fallocate, fdisk, fincore, findfs, findmnt, flock, fsck,
         fsck.cramfs, fsck.minix, fsfreeze, fstrim, getopt, hardlink, hexdump, hwclock,
-        i386 (link to setarch), ionice, ipcmk, ipcrm, ipcs, irqtop, isosize, kill, last, 
+        ionice, ipcmk, ipcrm, ipcs, irqtop, isosize, kill, last, 
         lastb (link to last), ldattach, linux32 (link to setarch), linux64 (link to setarch),
         logger, look, losetup, lsblk, lscpu, lsipc, lsirq, lsfd, lslocks, lslogins,
@@ -148,5 +156,5 @@
         swapoff, swapon, switch_root, taskset, uclampset, ul,
         umount, uname26 (link to setarch), unshare, utmpdump, uuidd, uuidgen, uuidparse,
-        wall, wdctl, whereis, wipefs, x86_64 (link to setarch), and zramctl</seg>
+        wall, wdctl, whereis, wipefs, and zramctl</seg>
         <seg>libblkid.so, libfdisk.so, libmount.so,
         libsmartcols.so, and libuuid.so</seg>
@@ -531,14 +539,4 @@
       </varlistentry>
 
-      <varlistentry id="i386">
-        <term><command>i386</command></term>
-        <listitem>
-          <para>A symbolic link to setarch</para>
-          <indexterm zone="ch-system-util-linux i386">
-            <primary sortas="b-i386">i386</primary>
-          </indexterm>
-        </listitem>
-      </varlistentry>
-
       <varlistentry id="ionice">
         <term><command>ionice</command></term>
@@ -1290,14 +1288,4 @@
       </varlistentry>
 
-      <varlistentry id="x86_64">
-        <term><command>x86_64</command></term>
-        <listitem>
-          <para>A symbolic link to setarch</para>
-          <indexterm zone="ch-system-util-linux x86_64">
-            <primary sortas="b-x86_64">x86_64</primary>
-          </indexterm>
-        </listitem>
-      </varlistentry>
-
       <varlistentry id="zramctl">
         <term><command>zramctl</command></term>
