aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2014-03-24 20:53:52 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2014-03-24 20:53:52 +0100
commit09f15d1b52b9e1e37dc02c8674c8738a1b036ea7 (patch)
tree8d3b75c7f580fdd02d924c5a0f27b9915d8b8bab
parent6f6c00f3a3e5f79e89c4ec8a4901ac270d451023 (diff)
downloadgcc-09f15d1b52b9e1e37dc02c8674c8738a1b036ea7.zip
gcc-09f15d1b52b9e1e37dc02c8674c8738a1b036ea7.tar.gz
gcc-09f15d1b52b9e1e37dc02c8674c8738a1b036ea7.tar.bz2
invoke.texi (-flto): Expand section about using static libraries with LTO.
2014-03-24 Tobias Burnus <burnus@net-b.de> * doc/invoke.texi (-flto): Expand section about using static libraries with LTO. From-SVN: r208798
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/doc/invoke.texi13
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d904fc0..3741b54 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-24 Tobias Burnus <burnus@net-b.de>
+
+ * doc/invoke.texi (-flto): Expand section about
+ using static libraries with LTO.
+
2014-03-24 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
PR rtl-optimization/60501
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4c183a3..78ddde0 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -8664,8 +8664,13 @@ regular (non-LTO) compilation.
If object files containing GIMPLE bytecode are stored in a library archive, say
@file{libfoo.a}, it is possible to extract and use them in an LTO link if you
-are using a linker with plugin support. To enable this feature, use
-the flag @option{-fuse-linker-plugin} at link time:
+are using a linker with plugin support. To create static libraries suitable
+for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
+and @code{ranlib}; to show the symbols of object files with GIMPLE bytecode, use
+@command{gcc-nm}. Those commands require that @command{ar}, @command{ranlib}
+and @command{nm} have been compiled with plugin support. At link time, use the the
+flag @option{-fuse-linker-plugin} to ensure that the library participates in
+the LTO optimization process:
@smallexample
gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
@@ -8678,7 +8683,9 @@ to make them part of the aggregated GIMPLE image to be optimized.
If you are not using a linker with plugin support and/or do not
enable the linker plugin, then the objects inside @file{libfoo.a}
are extracted and linked as usual, but they do not participate
-in the LTO optimization process.
+in the LTO optimization process. In order to make a static library suitable
+for both LTO optimization and usual linkage, compile its object files with
+@option{-flto} @code{-ffat-lto-objects}.
Link-time optimizations do not require the presence of the whole program to
operate. If the program does not require any symbols to be exported, it is