Index: general/prog/rust.xml
===================================================================
--- general/prog/rust.xml	(revision a37cebb4a395babe8921d271566e2b6c9c69b7f0)
+++ general/prog/rust.xml	(revision 326f8301c6cc7c38e28c34878cd7b2fbeb155756)
@@ -7,8 +7,8 @@
   <!ENTITY rust-download-http "https://static.rust-lang.org/dist/rustc-&rust-version;-src.tar.gz">
   <!ENTITY rust-download-ftp  " ">
-  <!ENTITY rust-md5sum        "75e779670ac79edf023497a9c37eb35d">
-  <!ENTITY rust-size          "48 MB">
-  <!ENTITY rust-buildsize     "4.2 GB (362 MB installed), (add 0.6GB for tests) plus 273MB for ~/.cargo files">
-  <!ENTITY rust-time          "33 SBU (add 14 SBU for tests, both with 4 processors)">
+  <!ENTITY rust-md5sum        "7272ddba14f512e6d2612ef60460bed8">
+  <!ENTITY rust-size          "53 MB">
+  <!ENTITY rust-buildsize     "4.1 GB (437 MB installed), (add 1.2GB for tests) including 226MB of ~/.cargo files for both the builder and root (from the install)">
+  <!ENTITY rust-time          "48 SBU (add 12 SBU for tests, both with 4 processors)">	
 ]>
 
@@ -54,4 +54,22 @@
     </para>
 
+    <note>
+      <para>
+        Repeated builds of this package on the same machine show a wide range
+        of build times. Some of this might be due to variations in downloading
+        the required cargo files if they are not already present, but this does
+        not seem to adequately explain the variations. Also, both the builder
+        and the user running the install will need to download the cargo crates
+        if they are not already present in <filename>~/.cargo</filename>.
+      </para>
+      <para>
+        If you use a DESTDIR method to install, you will only need to download
+        the crates once, for the build, saving about one-third of the build and
+        install time (but using extra space for the install). Similarly if you
+        were to build as root, or if your user is allowed to run <command>sudo
+        ./x.py install</command> - but those methods are dangerous.
+      </para>
+    </note>
+
     &lfs81_checked;
 
@@ -96,4 +114,6 @@
       <xref linkend="curl"/>,
       <xref linkend="cmake"/>,
+<!-- if changing this to use python3, also add python2 as a required
+ dependency for firefox, because at the moment it picks that up from here -->
       <xref linkend="python2"/>
     </para>
@@ -127,5 +147,5 @@
 
 <screen><userinput>cat &lt;&lt;EOF &gt; config.toml
-# see src/bootstrap/config.toml.example for more possible options
+# see config.toml.example for more possible options
 [llvm]
 targets = "X86"
@@ -137,6 +157,9 @@
 [install]
 prefix = "/usr"
-docdir = "share/doc/rustc-1.19.0"
+docdir = "share/doc/rustc-&rust-version;"
+
+[rust]
 channel = "stable"
+rpath = false
 EOF</userinput></screen>
 
@@ -156,5 +179,6 @@
       compile for the thumbv6m-none-eabi target, but the BLFS build does not cater for
       that, and all 105 tests in debuginfo-gdb will fail if
-      <application>gdb</application> has not been installed.
+      <application>gdb</application> has not been installed. Several other tests in
+      run-make can also fail.
     </para>
 
@@ -167,5 +191,5 @@
 
     <para>
-      That should report 14029 tests. Similarly, the total tests which failed can
+      That should report 14854 tests. Similarly, the total tests which failed can
       be found by running:
     </para>
@@ -205,4 +229,12 @@
 
     <para>
+      <command>rpath = false</command>: by default, <command>rust</command> can
+      be run from where it was built, without being installed. That adds DT_RPATH
+      entries to all of the ELF files, which produces very messy output from
+      <command>ldd</command>, showing the libraries in the place they were built,
+      even if they have been deleted from there after the install.
+    </para>
+
+    <para>
       <command>--verbose</command>: this switch can sometimes provide more
       information about a test which fails.
@@ -212,4 +244,15 @@
       <command>--no-fail-fast</command>: this switch ensures that the testsuite
       will not stop at the first error.
+    </para>
+
+    <para>
+      <option>PYTHON=/usr/bin/python3 ... tee buildlog</option>: Because rust
+      can use <application>Python3</application> which was installed in LFS,
+      this command tells it to use that instead of the deprecated
+      <application>Python2</application>. For the moment this should be regarded
+      as experimental and problems may be encountered. Because
+      <application>rust</application> will use all CPUs, if an error happened the
+      message may have scrolled out of the terminal's buffer. Logging makes it
+      possible to find out what was reported.
     </para>
 
@@ -226,5 +269,5 @@
       <seglistitem>
         <seg>
-          cargo, rust-gdb, rust-lldb, rustc, rustdoc.
+          cargo, rls, rust-gdb, rust-lldb, rustc, rustdoc.
         </seg>
         <seg>
@@ -257,4 +300,18 @@
       </varlistentry>
 
+      <varlistentry id="rls">
+        <term><command>rls</command></term>
+        <listitem>
+          <para>
+            is the Rust Language Server. This can run in the background to
+            provide IDEs, editors, and other tools with information about Rust
+            programs.
+          </para>
+          <indexterm zone="rust rls">
+            <primary sortas="b-rls">rls</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
       <varlistentry id="rust-gdb">
         <term><command>rust-gdb</command></term>
Index: introduction/welcome/changelog.xml
===================================================================
--- introduction/welcome/changelog.xml	(revision a37cebb4a395babe8921d271566e2b6c9c69b7f0)
+++ introduction/welcome/changelog.xml	(revision 326f8301c6cc7c38e28c34878cd7b2fbeb155756)
@@ -45,4 +45,13 @@
       <para>January 23rd, 2018</para>
       <itemizedlist>
+        <listitem>
+          <para>[ken] - Update to rustc-1.22.1 and firefox-58.0 (which
+          includes security fixes). Fixes
+          <ulink url="&blfs-ticket-root;10292">#10292</ulink> and
+          <ulink url="&blfs-ticket-root;10279">#10279</ulink>. Please note
+          firefox now has an additional dependency and added Configuration
+          Information details. Particular thanks to Tim Tassonis, Ryan
+          Marsaw, and Bruce for their help with this.</para>
+        </listitem>
         <listitem>
           <para>[bdubbs] - Update to sqlite-3.22.0. Fixes
Index: packages.ent
===================================================================
--- packages.ent	(revision a37cebb4a395babe8921d271566e2b6c9c69b7f0)
+++ packages.ent	(revision 326f8301c6cc7c38e28c34878cd7b2fbeb155756)
@@ -333,5 +333,5 @@
 <!ENTITY ruby-patch-version           "0">
 <!ENTITY ruby-version                 "&ruby-minor-version;.&ruby-patch-version;">
-<!ENTITY rust-version                 "1.19.0">
+<!ENTITY rust-version                 "1.22.1">
 <!ENTITY scons-version                "3.0.0">
 <!ENTITY slang-version                "2.3.1">
@@ -729,5 +729,5 @@
 <!ENTITY chromium-version             "63.0.3239.132">
 <!ENTITY epiphany-version             "3.26.5.1">
-<!ENTITY firefox-version              "57.0.4">
+<!ENTITY firefox-version              "58.0">
 <!ENTITY flashplayer-version          "27.0.0.187">
 <!ENTITY qupzilla-version             "2.2.4">
Index: xsoft/graphweb/firefox.xml
===================================================================
--- xsoft/graphweb/firefox.xml	(revision a37cebb4a395babe8921d271566e2b6c9c69b7f0)
+++ xsoft/graphweb/firefox.xml	(revision 326f8301c6cc7c38e28c34878cd7b2fbeb155756)
@@ -7,7 +7,7 @@
   <!ENTITY firefox-download-http "&mozilla-http;/firefox/releases/&firefox-version;/source/firefox-&firefox-version;.source.tar.xz">
   <!ENTITY firefox-download-ftp  " ">
-  <!ENTITY firefox-md5sum        "18586d62f24671fa15f4a5dd7b19c09c">
-  <!ENTITY firefox-size          "239 MB">
-  <!ENTITY firefox-buildsize     "7.2 GB (148 MB installed) without tests">
+  <!ENTITY firefox-md5sum        "0d5b70d2cf074ed6716b13c3e8d43a18">
+  <!ENTITY firefox-size          "236 MB">
+  <!ENTITY firefox-buildsize     "7.4 GB (152 MB installed) without tests">
   <!ENTITY firefox-time          "20 SBU (with parallelism=4) without tests">
 ]>
@@ -75,7 +75,13 @@
         The build times for this version of firefox (using stylo, the new CSS
         rendering code) seem to vary widely between different machines. On one
-        old Intel i3 the build took 33 SBU. The reason for this is not understood.
-        A build with stylo disabled is typically 1 or 2 SBU quicker and needs
-        0.8GB less disk space.
+        old Intel i3 the build took considerably longer. The reason for this is
+        not understood. A build with stylo disabled is typically 1 or 2 SBU
+        quicker and needs 0.8GB less disk space.
+      </para>
+
+      <para>
+        Although upstream prefer to use <application>PulseAudio</application>,
+        for the moment <application>Alsa</application> can still be used. Both
+        may need runtime configuration to get sound working.
       </para>
     </note>
@@ -123,9 +129,11 @@
       both <xref linkend="gtk3"/> and
       <xref linkend="gtk2"/>, 
+      <xref linkend="libnotify"/>,
       <xref linkend="nss"/>,
       <xref linkend="pulseaudio"/>
       (or
       <xref linkend="alsa-lib"/> if you edit the mozconfig; 
-        now deprecated by mozilla), 
+        now deprecated by mozilla), in either case please read the
+        Configuration Information,
       <xref linkend="rust"/>,
       <xref linkend="unzip"/>,
@@ -345,7 +353,7 @@
  https://bugzilla.mozilla.org/show_bug.cgi?id=1341234
  which is reported to be fixed in ff58 -->
-<screen><userinput>export BINDGEN_CFLAGS=$(pkg-config --cflags nspr pixman-1) &amp;&amp;
-make -f client.mk                                          &amp;&amp;
-unset BINDGEN_CFLAGS</userinput></screen>
+<screen><userinput>
+./mach build
+</userinput></screen>
 
     <para>
@@ -364,9 +372,8 @@
     </para>
 
-<screen role="root"><userinput>make -f client.mk install INSTALL_SDK= &amp;&amp;
-chown -R 0:0 /usr/lib/firefox-&firefox-version;   &amp;&amp;
-
-mkdir -pv    /usr/lib/mozilla/plugins  &amp;&amp;
-ln    -sfv   ../../mozilla/plugins /usr/lib/firefox-&firefox-version;/browser</userinput></screen>
+<screen role="root"><userinput>./mach install                                                  &amp;&amp;
+
+mkdir -pv  /usr/lib/mozilla/plugins                             &amp;&amp;
+ln    -sfv ../../mozilla/plugins /usr/lib/firefox-&firefox-version;/browser</userinput></screen>
 <!--
     <para>
@@ -385,15 +392,13 @@
 
     <para>
-      <command>export BINDGEN_CFLAGS=$(pkg-config --cflags nspr pixman-1)</command>:
-      This works around a bug in the style rust package to allow it to find the
-      system headers for <package>nspr</package> and <package>pixman</package>.
-    </para>
-
-    <para>
-      <command>make -f client.mk ...</command>: Mozilla products are packaged to
-      allow the use of a configuration file which can be used to pass the
-      configuration settings to the <command>configure</command> command.
-      <command>make</command> uses the <filename>client.mk</filename> file to
-      get initial configuration and setup parameters.
+      <command>./mach build</command>: <application>Firefox</application>
+      now uses this <application>python2</application> script to run the
+      build and install.
+    </para>
+
+    <para>
+      <option>./mach build --verbose</option>: Use this alternative if you
+      need details of which files are being compiled, together with any C or
+      C++ flags being used.
     </para>
 
@@ -449,4 +454,65 @@
         /usr/share/pixmaps/firefox.png</userinput></screen>
 
+    <sect3><title>Configuration Information</title>
+
+      <para>
+        The application settings for firefox are accessible by keying
+        <command>about:config</command> in the address bar.
+      </para>
+
+      <para>
+        With this version of <application>firefox</application>, getting
+        working sound can be a problem.  Although upstream prefers pulseaudio,
+        on balance using <application>Alsa</application> may be easier.
+      </para>
+
+      <para>
+        If you enabled <application>Alsa</application> for sound, you may need
+        to alter one variable to get working sound. If you run
+        <command>firefox</command> from a term and try to play something with
+        sound you might encounter error messages like:
+      </para>
+
+      <para>
+         <literal>Sandbox: seccomp sandbox violation: pid 3941, tid 4030,
+         syscall 16, args 48 2147767296 139909894784796 0 0 0.</literal>
+      </para>
+
+      <para>
+        That was on x86_64, on i686 the syscall number is 54. To allow this
+        syscall, in <command>about:config</command> change
+        <command>security.sandbox.content.syscall_whitelist</command> to 16
+        (or 54 if using i686).
+      </para>
+
+      <para>
+        If you use <command>pulseaudio</command> in a Desktop Environment, it
+        might already be started by that DE.  But if it is not, although
+        firefox-57 managed to start it, firefox-58 does not.  If you run
+        <command>firefox</command> from a term, trying to play sound will
+        encounter error messages warning <literal>Can't get cubeb
+        context!</literal>
+      </para>
+
+    <para>
+      The fix for this is to close firefox, start pulseaudio to check it
+      does start (if not, read the information on Configuring in <xref
+      linkend="pulseaudio"/>) and restart firefox to check it is working.
+      If it now works, add the following to your <filename>~/.xinitrc</filename>:
+<phrase revision="sysv">
+<literal>pulseaudio --verbose --log-target=syslog&amp;</literal></phrase>
+<phrase revision="systemd">
+<literal>pulseaudio --verbose --log-target=journald&amp;</literal></phrase>
+        (unfortunately, on some systems this does not work).
+      </para>
+
+      <para>
+        You may wish to use multiple profiles within firefox. To do that, invoke
+        firefox as <command>firefox --ProfileManager</command>. You can also
+        check which profile is currently in use from
+        <command>about:profiles</command>.
+      </para>
+
+    </sect3>
   </sect2>
 
