]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
invoke.texi (-flto): Expand section about using static libraries with LTO.
authorTobias Burnus <burnus@net-b.de>
Mon, 24 Mar 2014 19:53:52 +0000 (20:53 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Mon, 24 Mar 2014 19:53:52 +0000 (20:53 +0100)
2014-03-24  Tobias Burnus  <burnus@net-b.de>

        * doc/invoke.texi (-flto): Expand section about
        using static libraries with LTO.

From-SVN: r208798

gcc/ChangeLog
gcc/doc/invoke.texi

index d904fc022a932dcb32a132fa85ee2005c58c6713..3741b54df970f48e6f3391f5d423b675ed52c68b 100644 (file)
@@ -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
index 4c183a37b1b3cd6d416d325f355fc7b23eeb6e6b..78ddde07f9bcaf16cb7b608d414fe0d323bc09ea 100644 (file)
@@ -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