aboutsummaryrefslogtreecommitdiffstats
path: root/docs/GoldPlugin.html
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-06-03 15:06:19 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-06-03 15:06:19 +0000
commit5641f8d67f16b44a03290b6884ac18a08623a291 (patch)
treee0b1fd9c7082989a9e258fb5a937f38fb7ddb054 /docs/GoldPlugin.html
parent703e235f0cb6882e0a7ab3b023422c600821a7ef (diff)
downloadexternal_llvm-5641f8d67f16b44a03290b6884ac18a08623a291.zip
external_llvm-5641f8d67f16b44a03290b6884ac18a08623a291.tar.gz
external_llvm-5641f8d67f16b44a03290b6884ac18a08623a291.tar.bz2
Document how easy it is to use the gold plugin and have LTO with autotooled projects.
Please correct the documentation if I missed anything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72773 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/GoldPlugin.html')
-rw-r--r--docs/GoldPlugin.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/GoldPlugin.html b/docs/GoldPlugin.html
index ee01410..845ea1c 100644
--- a/docs/GoldPlugin.html
+++ b/docs/GoldPlugin.html
@@ -14,6 +14,7 @@
<li><a href="#usage">Usage</a>
<ul>
<li><a href="#example1">Example of link time optimization</a></li>
+ <li><a href="#lto_autotools">Quickstart for using LTO with autotooled projects</a></li>
</ul></li>
<li><a href="#licensing">Licensing</a></li>
</ol>
@@ -136,6 +137,34 @@ $ llvm-gcc -use-gold-plugin a.o b.o -o main # &lt;-- link with LLVMgold plugin
</div>
<!--=========================================================================-->
+<div class="doc_section"><a name="lto_autotools">Quickstart for using LTO with autotooled projects</a></div>
+<!--=========================================================================-->
+<div class="doc_text">
+ <p><tt>gold</tt>, <tt>ar</tt> and <tt>nm</tt> all support plugins now, so everything should be
+ in place for an easy to use LTO build of autotooled projects:</p>
+ <ul>
+ <li>Follow the instructions <a href="#build">on how to build libLLVMgold.so</a>.</li>
+ <li>Install the newly built binutils to <tt>$PREFIX</tt></li>
+ <li>Copy <tt>Release/lib/libLLVMgold.so</tt> to
+ <tt>$PREFIX/libexec/gcc/x86_64-unknown-linux-gnu/4.2.1/</tt> and
+ <tt>$PREFIX/lib/bfd-plugins/</tt></li>
+ <li>Set environment variables (<tt>$PREFIX</tt> is where you installed llvm-gcc and
+ binutils):
+ <pre class="doc_code">
+export CC="$PREFIX/bin/llvm-gcc -use-gold-plugin"
+export AR="$PREFIX/bin/ar --plugin libLLVMgold.so"
+export NM="$PREFIX/bin/nm --plugin libLLVMgold.so"
+export RANLIB=/bin/true #ranlib is not needed, and doesn't support .bc files in .a
+export CFLAGS="-O4"
+ </pre>
+ </li>
+ <li>Configure &amp; build the project as usual: <tt>./configure &amp;&amp; make &amp;&amp; make check</tt> </li>
+ </ul>
+ <p> The environment variable settings may work for non-autotooled projects
+ too, but you may need to set the <tt>LD</tt> environment variable as well.</p>
+</div>
+
+<!--=========================================================================-->
<div class="doc_section"><a name="licensing">Licensing</a></div>
<!--=========================================================================-->
<div class="doc_text">