aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2014-05-11 21:58:56 +0000
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2014-05-11 21:58:56 +0000
commit6206f72d670d6b9de52f40e3dc54648d08146801 (patch)
tree02b5539f734d2fbe87d583789ca368b579fcfa92 /chapter06
parentf6fe5000d71afe93a210ee5e0976fac1a114c03f (diff)
Add a patch to binutils to enable LTO with gcc-4.9.0.
Remove omit-frame-pointer in gcc-pass2 and Chapter 6 gcc. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10561 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06')
-rw-r--r--chapter06/binutils.xml11
-rw-r--r--chapter06/gcc.xml12
2 files changed, 15 insertions, 8 deletions
diff --git a/chapter06/binutils.xml b/chapter06/binutils.xml
index ae8aff092..8daeb5616 100644
--- a/chapter06/binutils.xml
+++ b/chapter06/binutils.xml
@@ -64,6 +64,11 @@ Ask your system administrator to create more.</computeroutput></screen>
<screen><userinput remap="pre">rm -fv etc/standards.info
sed -i.bak '/^INFO/s/standards.info //' etc/Makefile.in</userinput></screen>
+ <para>Add an upstream patch to use gcc's link time optimization (LTO)
+ the default:</para>
+
+<screen><userinput remap="pre">patch -Np1 -i ../&binutils-lto-patch;</userinput></screen>
+
<para>The Binutils documentation recommends building Binutils outside of the
source directory in a dedicated build directory:</para>
@@ -114,15 +119,9 @@ cd ../binutils-build</userinput></screen>
<para>Install the package:</para>
<screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
-<!--
- <para>Install the <filename class="headerfile">libiberty</filename> header
- file that is needed by some packages:</para>
-<screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
--->
</sect2>
-
<sect2 id="contents-binutils" role="content">
<title>Contents of Binutils</title>
diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml
index 7c92ccf28..c1434e7e3 100644
--- a/chapter06/gcc.xml
+++ b/chapter06/gcc.xml
@@ -45,7 +45,7 @@
programs to fail:</para>
<screen><userinput remap="pre">patch -Np1 -i ../&gcc-upstream-patch;</userinput></screen>
-
+<!--
<para>As in <xref linkend="ch-tools-gcc-pass2"/>, apply the following
<command>sed</command> to force the build to use the
<option>-fomit-frame-pointer</option> compiler flag in order to ensure
@@ -54,7 +54,7 @@
<screen><userinput remap="pre">case `uname -m` in
i?86) sed -i 's/^T_CFLAGS =$/&amp; -fomit-frame-pointer/' gcc/Makefile.in ;;
esac</userinput></screen>
-
+-->
<para>The GCC documentation recommends building GCC outside of the source
directory in a dedicated build directory:</para>
@@ -150,6 +150,14 @@ cd ../gcc-build</userinput></screen>
<screen><userinput remap="install">ln -sv gcc /usr/bin/cc</userinput></screen>
+ <para>Add a compatibility symlink to enable building programs with
+ Link Time Optimization (LTO):</para>
+
+<screen><userinput remap="install">install -dm755 /usr/lib/bfd-plugins
+pushd /usr/lib/bfd-plugins
+ln -sfv ../../libexec/gcc/x86_64-unknown-linux-gnu/&gcc-version;/liblto_plugin.so
+popd</userinput></screen>
+
<para>Now that our final toolchain is in place, it is important to again ensure
that compiling and linking will work as expected. We do this by performing
the same sanity checks as we did earlier in the chapter:</para>