Index: general/prog/gcc-ada.xml
===================================================================
--- general/prog/gcc-ada.xml	(revision 718593a75427a1f7379eec1062784f668aa38b3f)
+++ general/prog/gcc-ada.xml	(revision ae0673a886272fd364b9ba9ba14351499e7d26e7)
@@ -5,10 +5,10 @@
   %general-entities;
 
-  <!ENTITY gcc-download-http     "http://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
+  <!ENTITY gcc-download-http     "https://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
   <!ENTITY gcc-download-ftp      "ftp://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
-  <!ENTITY gcc-md5sum            "4df8ee253b7f3863ad0b86359cd39c43">
-  <!ENTITY gcc-size              "86 MB">
-  <!ENTITY gcc-ada-buildsize     "5.1 GB (0.7 GB added if GNAT install dir is not removed)">
-  <!ENTITY gcc-ada-time          "114 SBU (including 72 SBU for tests)">
+  <!ENTITY gcc-md5sum            "d5525b1127d07d215960e6051c5da35e">
+  <!ENTITY gcc-size              "91 MB">
+  <!ENTITY gcc-ada-buildsize     "6.4 GB (0.7 GB added if GNAT install dir is not removed)">
+  <!ENTITY gcc-ada-time          "125 SBU (including 73 SBU for tests)">
 
   <!ENTITY gnat-download-http    "https://libre.adacore.com/download/">
@@ -38,45 +38,75 @@
     <title>Introduction to the GCC Ada compiler</title>
 
-    <para>Ada is a modern programming language designed for large, long-lived
-    applications &mdash; and embedded systems in particular &mdash; where
-    reliability and efficiency are essential. It has a set of unique technical
-    features that make it highly effective for use in large, complex and
-    safety-critical projects.</para>
-
-    <para>The compiler and associated tools on this page are known as the
-    <application>GNAT</application> technology, developed by the Adacore
-    company, using the <application>GCC</application> backend. Since
-    parts of the Ada compiler are written in Ada, there is a circular
-    dependency on an Ada compiler. The instructions below first install
-    a binary compiler.</para>
+    <para>
+      Ada is a modern programming language designed for large, long-lived
+      applications &mdash; and embedded systems in particular &mdash; where
+      reliability and efficiency are essential. It has a set of unique technical
+      features that make it highly effective for use in large, complex and
+      safety-critical projects.
+    </para>
+
+    <para>
+      The compiler and associated tools on this page are known as the
+      <application>GNAT</application> technology, developed by the Adacore
+      company, using the <application>GCC</application> backend. Since
+      parts of the Ada compiler are written in Ada, there is a circular
+      dependency on an Ada compiler. The instructions below first install
+      a binary compiler. You do not need to do that if you already have built
+      <application>GNAT</application> tools.
+    </para>
 
     &lfs77_checked;
 
     <caution>
-      <para>Using the instructions on this page will have the effect that
-      the C and C++ compiler and libraries will be reinstalled, overwriting
-      the ones on your system. This may lead to some issues. Please read the
-      notes and caution on the <xref linkend="gcc"/> page.</para>
+      <para>
+        Using the instructions on this page will have the effect that
+        the C and C++ compiler and libraries will be reinstalled, overwriting
+        the ones on your system. This may lead to some issues. Please read the
+        notes and caution on the <xref linkend="gcc"/> page.
+      </para>
     </caution>
+
+    <note>
+      <para>
+        If you want to install other compilers in the <application>GCC
+        </application> collection, do that first, or specify ada in the
+        <parameter>--enable-languages</parameter> switch to <command>
+        configure</command>. If you rebuild <application>GCC</application>
+        without enabling ada after running the instructions on this page,
+        the new compiler will not be able to compile ADA anymore.
+      </para>
+    </note>
 
     <bridgehead renderas="sect3">Package Information</bridgehead>
     <itemizedlist spacing="compact">
       <listitem>
-        <para>Download (HTTP): <ulink url="&gcc-download-http;"/></para>
-      </listitem>
-      <listitem>
-        <para>Download (FTP): <ulink url="&gcc-download-ftp;"/></para>
-      </listitem>
-      <listitem>
-        <para>Download MD5 sum: &gcc-md5sum;</para>
-      </listitem>
-      <listitem>
-        <para>Download size: &gcc-size;</para>
-      </listitem>
-      <listitem>
-        <para>Estimated disk space required: &gcc-ada-buildsize;</para>
-      </listitem>
-      <listitem>
-        <para>Estimated build time: &gcc-ada-time;</para>
+        <para>
+          Download (HTTP): <ulink url="&gcc-download-http;"/>
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          Download (FTP): <ulink url="&gcc-download-ftp;"/>
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          Download MD5 sum: &gcc-md5sum;
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          Download size: &gcc-size;
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          Estimated disk space required: &gcc-ada-buildsize;
+        </para>
+      </listitem>
+      <listitem>
+        <para>
+          Estimated build time: &gcc-ada-time;
+        </para>
       </listitem>
     </itemizedlist>
@@ -84,10 +114,12 @@
     <bridgehead renderas="sect3">Additional Downloads</bridgehead>
     <note>
-      <para>You will need to install <application>GNAT</application>
-      temporarily to satisfy the circular dependency. You may point your
-      browser to the <ulink url="&gnat-download-http;">AdaCore download
-      page</ulink>, choose your platform and 2014, then select the file
-      to download. Alternatively, direct links to the 64 bit and 32 bit
-      linux versions are given below.</para>
+      <para>
+        You will need to install <application>GNAT</application>
+        temporarily to satisfy the circular dependency. You may point your
+        browser to the <ulink url="&gnat-download-http;">AdaCore download
+        page</ulink>, choose your platform and 2014, then select the file
+        to download. Alternatively, direct links to the 64 bit and 32 bit
+        linux versions are given below.
+      </para>
     </note>
 
@@ -123,10 +155,10 @@
         </para>
       </listitem>
-<!--      <listitem>
+      <listitem>
         <para>
           Required patch:
-          <ulink url="&patch-root;/gcc-&gcc-version;-upstream_fixes-1.patch"/>
-        </para>
-      </listitem>-->
+          <ulink url="&patch-root;/gcc-&gcc-version;-upstream_libgomp_fix-1.patch"/>
+        </para>
+      </listitem>
     </itemizedlist>
 
@@ -146,36 +178,46 @@
     <title>Installation of the GNAT binary</title>
 
-    <para>Before unpacking and changing into the GCC source directory, first
-    unpack the <application>GNAT</application> tarball, and change to the
-    GNAT directory. Then, install the <application>GNAT</application> binary
-    by running the following command as the
-    <systemitem class="username">root</systemitem> user:</para>
+    <para>
+      Before unpacking and changing into the GCC source directory, first
+      unpack the <application>GNAT</application> tarball, and change to the
+      GNAT directory. Then, install the <application>GNAT</application> binary
+      by running the following command as the
+      <systemitem class="username">root</systemitem> user:
+    </para>
 
 <screen role="root"><userinput>make ins-all prefix=/opt/gnat</userinput></screen>
 
-    <para>The <application>GNAT</application> compiler can be invoked by
-    executing the <command>gcc</command> binary installed in <filename
-    class="directory">/opt/gnat/bin</filename>.</para>
-
-    <para>You may now remove the <application>GNAT</application>
-    source directory if desired.</para>
-
-    <para>Prepare to compile <application>GCC</application> by placing the
-    <application>GNAT</application> version of <command>gcc</command> at the
-    beginning of the <envar>PATH</envar> variable by using the following
-    commands:</para>
+    <para>
+      The <application>GNAT</application> compiler can be invoked by
+      executing the <command>gcc</command> binary installed in <filename
+      class="directory">/opt/gnat/bin</filename>.
+    </para>
+
+    <para>
+      You may now remove the <application>GNAT</application>
+      source directory if desired.
+    </para>
+
+    <para>
+      Prepare to compile <application>GCC</application> by placing the
+      <application>GNAT</application> version of <command>gcc</command> at the
+      beginning of the <envar>PATH</envar> variable by using the following
+      commands:
+    </para>
 
 <screen><userinput>PATH_HOLD=$PATH &amp;&amp;
 export PATH=/opt/gnat/bin:$PATH_HOLD</userinput></screen>
 
-    <para>Doing so has the drawback that the <application>GCC</application>
-    and <application>Binutils</application> executables are taken
-    from the just installed <application>GNAT</application> package, but the
-    versions of those executables are outdated compared to those installed in
-    LFS. This is not important for the <application>GCC</application> compilers,
-    since they recompile themselves during the bootstrap process. On the other
-    hand, the outdated <command>ld</command> and <command>as</command> tools
-    are used all along. In order to use the LFS tools, issue as the
-    <systemitem class="username">root</systemitem> user:</para>
+    <para>
+      Doing so has the drawback that the <application>GCC</application>
+      and <application>Binutils</application> executables are taken
+      from the just installed <application>GNAT</application> package, but the
+      versions of those executables are outdated compared to those installed in
+      LFS. This is not important for the <application>GCC</application> compilers,
+      since they recompile themselves during the bootstrap process. On the other
+      hand, the outdated <command>ld</command> and <command>as</command> tools
+      are used all along. In order to use the LFS tools, issue as the
+      <systemitem class="username">root</systemitem> user:
+    </para>
 
 <screen role="root"><userinput>find /opt/gnat -name ld -exec mv -v {} {}.old \;
@@ -186,25 +228,21 @@
   <sect2 role="installation">
     <title>Installation of GCC Ada</title>
-<!--
-    <para>As in LFS, fix a problem identified upstream:</para>
-
-<screen><userinput>sed -i 's/if \((code.*))\)/if (\1 \&amp;\&amp; \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c</userinput></screen>
--->
-
-    <para>Install <application>GCC Ada</application> by running the
-    following commands:</para>
-
-<screen><userinput><!--
-patch -Np1 -i ../gcc-&gcc-version;-upstream_fixes-1.patch &amp;&amp;
--->mkdir ../gcc-build &amp;&amp;
+
+    <para>
+      As in LFS, fix a problem identified upstream with the libgomp library:
+    </para>
+
+<screen><userinput>patch -Np1 -i ../gcc-&gcc-version;-upstream_libgomp_fix-1.patch</userinput></screen>
+
+    <para>
+      Install <application>GCC Ada</application> by running the
+      following commands:
+    </para>
+
+<screen><userinput>mkdir ../gcc-build &amp;&amp;
 cd    ../gcc-build &amp;&amp;
 
 ../gcc-&gcc-version;/configure          \
     --prefix=/usr               \
-    --libdir=/usr/lib           \
-    --enable-shared             \
-    --enable-threads=posix      \
-    --enable-__cxa_atexit       \
-    --enable-clocale=gnu        \
     --disable-multilib          \
     --with-system-zlib          \
@@ -212,9 +250,11 @@
 make</userinput></screen>
 
-    <para>If you have installed additional packages such as
-    <application>Valgrind</application> and <application>GDB</application>,
-    the <application>GCC</application> part of the testsuite will run more
-    tests than in LFS. Some of those will report FAIL and others XPASS
-    (pass when expected to FAIL). To run the tests, issue:</para>
+    <para>
+      If you have installed additional packages such as
+      <application>Valgrind</application> and <application>GDB</application>,
+      the <application>GCC</application> part of the testsuite will run more
+      tests than in LFS. Some of those will report FAIL and others XPASS
+      (pass when expected to FAIL). To run the tests, issue:
+    </para>
 
 <screen><userinput>ulimit -s 32768 &amp;&amp;
@@ -223,11 +263,15 @@
 to be run. -->
 
-    <para>The tests are very long, and the results may be hard to find in the
-    logs, specially if you use parallel jobs with make. You can get a summary
-    of the tests with:</para>
+    <para>
+      The tests are very long, and the results may be hard to find in the
+      logs, specially if you use parallel jobs with make. You can get a summary
+      of the tests with:
+    </para>
 
 <screen><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
 
-    <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
+    <para>
+      Now, as the <systemitem class="username">root</systemitem> user:
+    </para>
 
 <screen role="root"><userinput>make install &amp;&amp;
@@ -240,9 +284,17 @@
     /usr/lib/gcc/*linux-gnu/&gcc-version;/ada{lib,include}</userinput></screen>
 
-    <para>You should now remove the <application>GNAT</application>
-    installation and perform other cleanups:</para>
-
-<screen><userinput>rm -rf /opt/gnat &amp;&amp;
-export PATH=$PATH_HOLD &amp;&amp;
+    <para>
+      You should now remove the <application>GNAT</application>
+      installation and perform other cleanups. First, as the <systemitem
+      class="username">root</systemitem> user:
+    </para>
+
+<screen role="root"><userinput>rm -rf /opt/gnat</userinput></screen>
+
+    <para>
+      Then, as a normal user:
+    </para>
+
+<screen><userinput>export PATH=$PATH_HOLD &amp;&amp;
 unset PATH_HOLD</userinput></screen>
 
@@ -251,25 +303,15 @@
   <sect2 role="commands">
     <title>Command Explanations</title>
-<!--
-    <para>
-      <command>patch ... gcc-&gcc-version;-upstream_fixes-1.patch</command>:
-      This patch corrects bugs in the C++ compiler, which lead to
-      segmentation faults in some cases.
-    </para>
--->
-
-    <para><command>mkdir ../gcc-build; cd ../gcc-build</command>: The
-    <application>GCC</application> documentation recommends
-    building the package in a dedicated build directory.</para>
-
-    <para><parameter>--enable-shared --enable-threads=posix
-    --enable-__cxa_atexit</parameter>: These parameters are required to build
-    the <application>C++</application> libraries to published standards.</para>
-
-    <para><parameter>--enable-clocale=gnu</parameter>: This parameter is a
-    failsafe for incomplete locale data.</para>
-
-    <para><parameter>--disable-multilib</parameter>: This parameter ensures
-    that files are created for the specific architecture of your computer.</para>
+
+    <para>
+      <command>mkdir ../gcc-build; cd ../gcc-build</command>: The
+      <application>GCC</application> documentation recommends
+      building the package in a dedicated build directory.
+    </para>
+
+    <para>
+      <parameter>--disable-multilib</parameter>: This parameter ensures
+      that files are created for the specific architecture of your computer.
+    </para>
 
     <para>
@@ -288,22 +330,37 @@
     </para>
 
-    <para><command>ulimit -s 32768</command>: This command prevents several
-    tests from running out of stack space.</para>
-
-    <para><command>make -k check</command>: This command runs the test suite
-    without stopping if any errors are encountered.</para>
-
-    <para><command>../gcc-&gcc-version;/contrib/test_summary</command>: This
-    command will produce a summary of the test suite results. You can append
-    <command>| grep -A7 Summ</command> to the command to produce an even more
-    condensed version of the summary. You may also wish to redirect the output
-    to a file for review and comparison later on.</para>
-
-    <para><command>chown -v -R root:root /usr/lib/gcc/*linux-gnu/...</command>:
-    If the package is built by a user other than root, the ownership of the
-    installed <filename class="directory">include</filename> and
-    <filename class="directory">adalib</filename> directories (and their
-    contents) will be incorrect. These commands change the ownership to the
-    <systemitem class="username">root</systemitem> user and group.</para>
+    <para>
+      <option>--with-default-libstdcxx-abi=c++98</option>: Use this switch if you
+      are building <application>GNAT</application> tools using a
+      <application>GCC</application> version prior to 5.1.0,
+      and you do not want to recompile all the libraries written in C++.
+    </para>
+
+    <para>
+      <command>ulimit -s 32768</command>: This command prevents several
+      tests from running out of stack space.
+    </para>
+
+    <para>
+      <command>make -k check</command>: This command runs the test suite
+      without stopping if any errors are encountered.
+    </para>
+
+    <para>
+      <command>../gcc-&gcc-version;/contrib/test_summary</command>: This
+      command will produce a summary of the test suite results. You can append
+      <command>| grep -A7 Summ</command> to the command to produce an even more
+      condensed version of the summary. You may also wish to redirect the output
+      to a file for review and comparison later on.
+    </para>
+
+    <para>
+      <command>chown -v -R root:root /usr/lib/gcc/*linux-gnu/...</command>:
+      If the package is built by a user other than root, the ownership of the
+      installed <filename class="directory">include</filename> and
+      <filename class="directory">adalib</filename> directories (and their
+      contents) will be incorrect. These commands change the ownership to the
+      <systemitem class="username">root</systemitem> user and group.
+    </para>
 
   </sect2>
@@ -320,7 +377,5 @@
         <seg>
           gnat, gnatbind, gnatchop, gnatclean, gnatfind, gnatkr,
-          gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatxref,
-          and a run-time executable, gnat1, in <filename class="directory">
-          /usr/libexec/&lt;arch-triplet&gt;/&gcc-version;</filename>
+          gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatxref
         </seg>
         <seg>
@@ -334,7 +389,9 @@
     </segmentedlist>
 
-    <para>Only the Ada specific files are listed here. Others can be found at
-    <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
-    initially installed during the building of LFS.</para>
+    <para>
+      Only the Ada specific files are listed here. Others can be found at
+      <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
+      initially installed during the building of LFS.
+    </para>
 
     <variablelist>
@@ -346,6 +403,8 @@
         <term><command>gnat</command></term>
         <listitem>
-          <para>is a wrapper that accepts a number of commands and calls
-          the corresponding tool from the list below.</para>
+          <para>
+            is a wrapper that accepts a number of commands and calls
+            the corresponding tool from the list below.
+          </para>
           <indexterm zone="gcc-ada gnat">
             <primary sortas="b-gnat">gnat</primary>
@@ -357,5 +416,7 @@
         <term><command>gnatbind</command></term>
         <listitem>
-          <para>is used to bind compiled objects.</para>
+          <para>
+            is used to bind compiled objects.
+          </para>
           <indexterm zone="gcc-ada gnatbind">
             <primary sortas="b-gnatbind">gnatbind</primary>
@@ -367,6 +428,8 @@
         <term><command>gnatchop</command></term>
         <listitem>
-          <para>is useful for renaming files to meet the standard
-          <application>Ada</application> default file naming conventions.</para>
+          <para>
+            is useful for renaming files to meet the standard
+            <application>Ada</application> default file naming conventions.
+          </para>
           <indexterm zone="gcc-ada gnatchop">
             <primary sortas="b-gnatchop">gnatchop</primary>
@@ -378,6 +441,8 @@
         <term><command>gnatclean</command></term>
         <listitem>
-          <para>is used to remove files associated with a
-          <application>GNAT</application> project.</para>
+          <para>
+            is used to remove files associated with a
+            <application>GNAT</application> project.
+          </para>
           <indexterm zone="gcc-ada gnatclean">
             <primary sortas="b-gnatclean">gnatclean</primary>
@@ -389,6 +454,8 @@
         <term><command>gnatfind</command></term>
         <listitem>
-          <para> is intended for locating definition and/or references to
-          specified entities in a <application>GNAT</application> project.</para>
+          <para>
+            is intended for locating definition and/or references to
+            specified entities in a <application>GNAT</application> project.
+          </para>
           <indexterm zone="gcc-ada gnatfind">
             <primary sortas="b-gnatfind">gnatfind</primary>
@@ -400,6 +467,8 @@
         <term><command>gnatkr</command></term>
         <listitem>
-          <para>is used to determine the crunched name for a given file, when
-          crunched to a specified maximum length.</para>
+          <para>
+            is used to determine the crunched name for a given file, when
+            crunched to a specified maximum length.
+          </para>
           <indexterm zone="gcc-ada gnatkr">
             <primary sortas="b-gnatkr">gnatkr</primary>
@@ -411,5 +480,7 @@
         <term><command>gnatlink</command></term>
         <listitem>
-          <para>is used to link programs and build an executable file.</para>
+          <para>
+            is used to link programs and build an executable file.
+          </para>
           <indexterm zone="gcc-ada gnatlink">
             <primary sortas="b-gnatlink">gnatlink</primary>
@@ -421,5 +492,7 @@
         <term><command>gnatls</command></term>
         <listitem>
-          <para>is the compiled unit browser.</para>
+          <para>
+            is the compiled unit browser.
+          </para>
           <indexterm zone="gcc-ada gnatls">
             <primary sortas="b-gnatls">gnatls</primary>
@@ -431,6 +504,8 @@
         <term><command>gnatmake</command></term>
         <listitem>
-          <para>is the <application>Ada</application> compiler, which performs
-          compilaton, binding and linking.</para>
+          <para>
+            is the <application>Ada</application> compiler, which performs
+            compilaton, binding and linking.
+          </para>
           <indexterm zone="gcc-ada gnatmake">
             <primary sortas="b-gnatmake">gnatmake</primary>
@@ -442,6 +517,8 @@
         <term><command>gnatname</command></term>
         <listitem>
-          <para>will list the files associated with a
-          <application>GNAT</application> project.</para>
+          <para>
+            will list the files associated with a
+            <application>GNAT</application> project.
+          </para>
           <indexterm zone="gcc-ada gnatname">
             <primary sortas="b-gnatname">gnatname</primary>
@@ -453,6 +530,7 @@
         <term><command>gnatprep</command></term>
         <listitem>
-          <para>is the <application>GNAT</application> external
-          preprocessor.</para>
+          <para>
+            is the <application>GNAT</application> external preprocessor.
+          </para>
           <indexterm zone="gcc-ada gnatprep">
             <primary sortas="b-gnatprep">gnatprep</primary>
@@ -464,6 +542,8 @@
         <term><command>gnatxref</command></term>
         <listitem>
-          <para>is similar to <command>gnatfind</command>, but generates
-          a full report of all cross-references.</para>
+          <para>
+            is similar to <command>gnatfind</command>, but generates
+            a full report of all cross-references.
+          </para>
           <indexterm zone="gcc-ada gnatxref">
             <primary sortas="b-gnatxref">gnatxref</primary>
