[llvm-commits] [llvm] r72773 - /llvm/trunk/docs/GoldPlugin.html

Torok Edwin edwintorok at gmail.com
Wed Jun 3 08:06:19 PDT 2009


Author: edwin
Date: Wed Jun  3 10:06:19 2009
New Revision: 72773

URL: http://llvm.org/viewvc/llvm-project?rev=72773&view=rev
Log:
Document how easy it is to use the gold plugin and have LTO with autotooled projects.
Please correct the documentation if I missed anything.

Modified:
    llvm/trunk/docs/GoldPlugin.html

Modified: llvm/trunk/docs/GoldPlugin.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GoldPlugin.html?rev=72773&r1=72772&r2=72773&view=diff

==============================================================================
--- llvm/trunk/docs/GoldPlugin.html (original)
+++ llvm/trunk/docs/GoldPlugin.html Wed Jun  3 10:06:19 2009
@@ -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 @@
 </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 & build the project as usual: <tt>./configure && make && 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">





More information about the llvm-commits mailing list