Fix GetConstantStringInfo to not look into MDString (it works on
[oota-llvm.git] / docs / GoldPlugin.html
index 845ea1cde508ca707094f07bad5136f9cbf8b23f..77a417f5710d54c168ec26d0269b9ee908d80e59 100644 (file)
@@ -127,8 +127,9 @@ void foo4(void) {
 
 --- command lines ---
 $ llvm-gcc -flto a.c -c -o a.o              # <-- a.o is LLVM bitcode file
+$ ar q a.a a.o                              # <-- a.a is an archive with LLVM bitcode
 $ llvm-gcc b.c -c -o b.o                    # <-- b.o is native object file
-$ llvm-gcc -use-gold-plugin a.o b.o -o main # <-- link with LLVMgold plugin
+$ llvm-gcc -use-gold-plugin a.a b.o -o main # <-- link with LLVMgold plugin
 </pre>
   <p>Gold informs the plugin that foo3 is never referenced outside the IR,
   leading LLVM to delete that function. However, unlike in the
@@ -152,11 +153,21 @@ $ llvm-gcc -use-gold-plugin a.o b.o -o main # &lt;-- link with LLVMgold plugin
     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 CXX="$PREFIX/bin/llvm-g++ -use-gold-plugin"
+export AR="$PREFIX/bin/ar"
+export NM="$PREFIX/bin/nm"
 export RANLIB=/bin/true #ranlib is not needed, and doesn't support .bc files in .a
 export CFLAGS="-O4"
-     </pre>
+</pre>
+     </li>
+     <li>Or you can just set your path:
+    <pre class="doc_code">
+export PATH="$PREFIX/bin:$PATH"
+export CC="llvm-gcc -use-gold-plugin"
+export CXX="llvm-g++ -use-gold-plugin"
+export RANLIB=/bin/true
+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>