-<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>Object Files: Understanding The Result Of LLVM Compilation</title>
+ <title>Using The LLVM Libraries</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
-<div class="doc_title">Object Files: Understanding The Result Of LLVM Compilation</div>
-<hr>
+<div class="doc_title">Using The LLVM Libraries</div>
<ol>
<li><a href="#abstract">Abstract</a></li>
<li><a href="#introduction">Introduction</a></li>
- <li><a href="#files">File Contents</a></li>
+ <li><a href="#descriptions">Library Descriptions</a></li>
+ <li><a href="#dependencies">Library Dependencies</a></li>
<li><a href="#rot">Linkage Rules Of Thumb</a>
<ol>
- <li><a href="#always">Always Link vmcore.o, support.a</a>
- <li><a href="#placeholder">Placeholder</a>
+ <li><a href="#always">Always link LLVMCore, LLVMSupport, LLVMSystem</a>
+ <li><a href="#onlyone">Never link both archive and re-linked</a>
</ol>
</li>
</ol>
-<div class="doc_text">
-<p><b>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a> </b></p>
-<p> </p>
+
+<div class="doc_author">
+ <p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p>
</div>
-<hr>
+
+<p class="doc_warning">Warning: This document is out of date, please see <a href="CommandGuide/html/llvm-config.html">llvm-config</a> for more information.</p>
+
<!-- ======================================================================= -->
<div class="doc_section"><a name="abstract">Abstract</a></div>
<div class="doc_text">
-<p>This document describes the contents of the many objects files and libraries
-that are produced by compiling LLVM. To make use of LLVM this information is
-needed in order to understand what files should be linked into your program.
+ <p>Amongst other things, LLVM is a toolkit for building compilers, linkers,
+ runtime executives, virtual machines, and other program execution related
+ tools. In addition to the LLVM tool set, the functionality of LLVM is
+ available through a set of libraries. To use LLVM as a toolkit for
+ constructing tools, a developer needs to understand what is contained in the
+ various libraries, what they depend on, and how to use them. Fortunately,
+ there is a tool, <tt>llvm-config</tt> to aid with this. This document
+ describes the contents of the libraries and how to use <tt>llvm-config</tt>
+ to generate command line options.
</p>
</div>
+
<!-- ======================================================================= -->
<div class="doc_section"> <a name="introduction">Introduction</a></div>
<div class="doc_text">
-<p>If you're writing a compiler, virtual machine, or any other utility for
- LLVM, you'll need to figure out which of the many .a (archive) and .o
- (object) files you will need to link with to be successful. An
- understanding of the contents of these files and their inter-relationships
- will be useful in coming up with an optimal specification for the objects
- and libraries to link with.
-</p>
-<p>The purpose of this document is to hopefully reduce some of the trial and
- error that the author experienced in using LLVM.
-</p>
+ <p>If you're writing a compiler, virtual machine, or any other utility based
+ on LLVM, you'll need to figure out which of the many libraries files you will
+ need to link with to be successful. An understanding of the contents of these
+ libraries will be useful in coming up with an optimal specification for the
+ libraries to link with. The purpose of this document is to reduce some of
+ the trial and error that the author experienced in using LLVM.</p>
+ <p>LLVM produces two types of libraries: archives (ending in <tt>.a</tt>) and
+ objects (ending in <tt>.o</tt>). However, both are libraries. Libraries ending
+ in <tt>.o</tt> are known as re-linked libraries because they contain all the
+ compilation units of the library linked together as a single <tt>.o</tt> file.
+ Furthermore, several of the libraries have <em>both</em> forms of library. The
+ re-linked libraries are used whenever you want to include all symbols from the
+ library. The archive libraries are used whenever you want to only resolve
+ outstanding symbols at that point in the link without including everything in
+ the library. </p>
+ <p>If you're using the LLVM Makefile system to link your tools,you will use
+ the <tt>LLVMLIBS</tt> make variable.
+ (see the <a href="MakefileGuide.html#LLVMLIBS">Makefile Guide</a> for
+ details). This variable specifies which LLVM libraries to link into your tool
+ and the order in which they will be linked. You specify re-linked libraries by
+ naming the library without a suffix. You specify archive libraries by naming
+ the library with a <tt>.a</tt> suffix but without the <tt>lib</tt> prefix. The
+ order in which the libraries appear in the <tt>LLVMLIBS</tt> variable
+ definition is the order in which they will be linked. Getting this order
+ correct for your tool can sometimes be challenging.
</div>
<!-- ======================================================================= -->
-<div class="doc_section"><a name="files"></a>File Contents</div>
+<div class="doc_section"><a name="descriptions"></a>Library Descriptions</div>
<div class="doc_text">
-<p>The table below provides a summary of the basic contents of each file.</p>
-<table class="doc_table"
- style="width:80%; text-align: left; border: 2px solid blue; border-collapse: collapse;">
-<tr class="doc_table">
- <td colspan="2" class="doc_section">Summary Of LLVM Library And Object Files
- </td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue"><h2><u>Library</u></h2></td>
- <td style="border: 2px solid blue"><h2><u>Description</u></h2></td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libipo.a</td>
- <td style="border: 2px solid blue">
- An archive of all inter-procedural optimizations.
- </td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libscalaropts.a</td>
- <td style="border: 2px solid blue">
- An archive of all scalar optimizations.
- </td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libtransforms.a</td>
- <td style="border: 2px solid blue">
- An archive of all code transformations.
- </td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libtarget.a</td>
- <td style="border: 2px solid blue">
- An archive containing target (machine) specific code.
- </td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libanalysis.a</td>
- <td style="border: 2px solid blue">
- An archive containing analysis code.
- </td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libdatastructure.a</td>
- <td style="border: 2px solid blue">
- An archive containing optimizations for data structures.
- </td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libinstrument.a</td>
- <td style="border: 2px solid blue">No idea.</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libregalloc.a</td>
- <td style="border: 2px solid blue">Register Allocation code.</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libipa.a</td>
- <td style="border: 2px solid blue">Inter-procedural ??</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libtransformutils.a</td>
- <td style="border: 2px solid blue">
- Utiltities for transformations?
- </td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">libsupport.a</td>
- <td style="border: 2px solid blue">General support utilities</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue"><h2><u>Object File</u></h2></td>
- <td style="border: 2px solid blue"><h2><u>Description</u></h2></td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">support.o</td>
- <td style="border: 2px solid blue">General support utilities</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">asmparser.o</td>
- <td style="border: 2px solid blue">Assembler Parser</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">bcreader.o</td>
- <td style="border: 2px solid blue">Byte Code Reader</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">bcwriter.o</td>
- <td style="border: 2px solid blue">Byte Code Writer</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">sched.o</td>
- <td style="border: 2px solid blue">Scheduler? For What?</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">selectiondag.o</td>
- <td style="border: 2px solid blue">Selection Directed Acyclic Graph?</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">transformutils.o</td>
- <td style="border: 2px solid blue">Utilities for code transformations</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">ipa.o</td>
- <td style="border: 2px solid blue">Inter-Procedural Analysis Optimizations</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">select.o</td>
- <td style="border: 2px solid blue">Select Statement?</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">cwriter.o</td>
- <td style="border: 2px solid blue">"C" Code Writer</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">profpaths.o</td>
- <td style="border: 2px solid blue">Profile Paths?</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">regalloc.o</td>
- <td style="border: 2px solid blue">Register Allocation</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">instrument.o</td>
- <td style="border: 2px solid blue">Instrumentation? Of What?</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">datastructure.o</td>
- <td style="border: 2px solid blue">Data Structure Analysis</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">codegen.o</td>
- <td style="border: 2px solid blue">Native code generation</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">livevar.o</td>
- <td style="border: 2px solid blue">Live Variable Analysis</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">vmcore.o</td>
- <td style="border: 2px solid blue">Virtual Machine Core</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">lli-interpreter.o</td>
- <td style="border: 2px solid blue">Interpreter for LLVM ByteCode</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">lli-jit.o</td>
- <td style="border: 2px solid blue">
- Just-In-Time Compiler For LLVM ByteCode
- </td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">executionengine.o</td>
- <td style="border: 2px solid blue">Engine for LLI</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">debugger.o</td>
- <td style="border: 2px solid blue">Source Level Debugging Support</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">analysis.o</td>
- <td style="border: 2px solid blue">General Framework For Analysis?</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">sparc.o</td>
- <td style="border: 2px solid blue">Sun SPARC Processor Specific</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">target.o</td>
- <td style="border: 2px solid blue">Target Machine Support?</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">transforms.o</td>
- <td style="border: 2px solid blue">Code Transformations</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">x86.o</td>
- <td style="border: 2px solid blue">Intel x86 Processor Specific</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">powerpc.o</td>
- <td style="border: 2px solid blue">PowerPC Processor Specific</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">scalaropts.o</td>
- <td style="border: 2px solid blue">Optimizations For Scalars</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">ipo.o</td>
- <td style="border: 2px solid blue">Inter-Procedural Optimization</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">trace.o</td>
- <td style="border: 2px solid blue">Support For Tracing/Debugging?</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">profile_rt.o</td>
- <td style="border: 2px solid blue">Runtime Library For Profiler</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">sample.o</td>
- <td style="border: 2px solid blue">Sample Program ?</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">stkr_compiler.o</td>
- <td style="border: 2px solid blue">Stacker Language Compiler Library</td>
-</tr>
-<tr class="doc_table">
- <td style="border: 2px solid blue">stkr_runtime.o</td>
- <td style="border: 2px solid blue">Stacker Language Runtime Library</td>
-</tr>
+ <p>The table below categorizes each library
+<table style="text-align:left">
+ <tr><th>Library</th><th>Forms</th><th>Description</th></tr>
+ <tr><th colspan="3">Core Libraries</th></tr>
+ <tr><td>LLVMArchive</td><td><tt>.a</tt></td>
+ <td>LLVM archive reading and writing</td></tr>
+ <tr><td>LLVMAsmParser</td><td><tt>.a</tt></td>
+ <td>LLVM assembly parsing</td></tr>
+ <tr><td>LLVMBCReader</td><td><tt>.a</tt></td>
+ <td>LLVM bitcode reading</td></tr>
+ <tr><td>LLVMBCWriter</td><td><tt>.a</tt></td>
+ <td>LLVM bitcode writing</td></tr>
+ <tr><td>LLVMCore</td><td><tt>.a</tt></td>
+ <td>LLVM core intermediate representation</td></tr>
+ <tr><td>LLVMDebugger</td><td><tt>.a</tt></td>
+ <td>Source level debugging support</td></tr>
+ <tr><td>LLVMLinker</td><td><tt>.a</tt></td>
+ <td>Bitcode and archive linking interface</td></tr>
+ <tr><td>LLVMSupport</td><td><tt>.a</tt></td>
+ <td>General support utilities</td></tr>
+ <tr><td>LLVMSystem</td><td><tt>.a</tt></td>
+ <td>Operating system abstraction layer</td></tr>
+ <tr><td>LLVMbzip2</td><td><tt>.a</tt></td>
+ <td>BZip2 compression library</td></tr>
+
+ <tr><th colspan="3">Analysis Libraries</th></tr>
+ <tr><td>LLVMAnalysis</td><td><tt>.a</tt></td>
+ <td>Various analysis passes.</td></tr>
+ <tr><td>LLVMDataStructure</td><td><tt>.o</tt></td>
+ <td>Data structure analysis passes.</td></tr>
+ <tr><td>LLVMipa</td><td><tt>.a</tt></td>
+ <td>Inter-procedural analysis passes.</td></tr>
+
+ <tr><th colspan="3">Transformation Libraries</th></tr>
+ <tr><td>LLVMInstrumentation</td><td><tt>.a</tt></td>
+ <td>Instrumentation passes.</td></tr>
+ <tr><td>LLVMipo</td><td><tt>.a</tt></td>
+ <td>All inter-procedural optimization passes.</td></tr>
+ <tr><td>LLVMScalarOpts</td><td><tt>.a</tt></td>
+ <td>All scalar optimization passes.</td></tr>
+ <tr><td>LLVMTransformUtils</td><td><tt>.a</tt></td>
+ <td>Transformation utilities used by many passes.</td></tr>
+
+ <tr><th colspan="3">Code Generation Libraries </th></tr>
+ <tr><td>LLVMCodeGen</td><td><tt>.o</tt></td>
+ <td>Native code generation infrastructure</td></tr>
+ <tr><td>LLVMSelectionDAG</td><td><tt>.o</tt></td>
+ <td>Aggressive instruction selector for directed acyclic graphs</td></tr>
+
+ <tr><th colspan="3">Target Libraries</th></tr>
+ <tr><td>LLVMAlpha</td><td><tt>.o</tt></td>
+ <td>Code generation for Alpha architecture</td></tr>
+ <tr><td>LLVMARM</td><td><tt>.o</tt></td>
+ <td>Code generation for ARM architecture</td></tr>
+ <tr><td>LLVMCBackend</td><td><tt>.o</tt></td>
+ <td>'C' language code generator.</td></tr>
+ <tr><td>LLVMIA64</td><td><tt>.o</tt></td>
+ <td>Code generation for IA64 architecture</td></tr>
+ <tr><td>LLVMPowerPC</td><td><tt>.o</tt></td>
+ <td>Code generation for PowerPC architecture</td></tr>
+ <tr><td>LLVMSparc</td><td><tt>.o</tt></td>
+ <td>Code generation for Sparc architecture</td></tr>
+ <tr><td>LLVMTarget</td><td><tt>.a</tt></td>
+ <td>Generic code generation utilities.</td></tr>
+ <tr><td>LLVMX86</td><td><tt>.o</tt></td>
+ <td>Code generation for Intel x86 architecture</td></tr>
+
+ <tr><th colspan="3">Runtime Libraries</th></tr>
+ <tr><td>LLVMInterpreter</td><td><tt>.o</tt></td>
+ <td>Bitcode Interpreter</td></tr>
+ <tr><td>LLVMJIT</td><td><tt>.o</tt></td>
+ <td>Bitcode JIT Compiler</td></tr>
+ <tr><td>LLVMExecutionEngine</td><td><tt>.o</tt></td>
+ <td>Virtual machine engine</td></tr>
</table>
</div>
-<p></p>
+
+<!-- ======================================================================= -->
+<div class="doc_section"><a name="dependencies"></a>Using llvm-config</div>
+<div class="doc_text">
+ <p>The <tt>llvm-config</tt> tool is a perl script that produces on its output
+ various kinds of information. For example, the source or object directories
+ used to build LLVM can be accessed by passing options to <tt>llvm-config</tt>.
+ For complete details on this tool, please see the
+ <a href="CommandGuide/html/llvm-config.html">manual page</a>.</p>
+ <p>To understand the relationships between libraries, the <tt>llvm-config</tt>
+ can be very useful. If all you know is that you want certain libraries to
+ be available, you can generate the complete set of libraries to link with
+ using one of four options, as below:</p>
+ <ol>
+ <li><tt>--ldflags</tt>. This generates the command line options necessary to
+ be passed to the <tt>ld</tt> tool in order to link with LLVM. Most notably,
+ the <tt>-L</tt> option is provided to specify a library search directory
+ that contains the LLVM libraries.</li>
+ <li><tt>--libs</tt>. This generates command line options suitable for
+ use with a gcc-style linker. That is, libraries are given with a -l option
+ and object files are given with a full path.</li>
+ <li><tt>--libnames</tt>. This generates a list of just the library file
+ names. If you know the directory in which these files reside (see --ldflags)
+ then you can find the libraries there.</li>
+ <li><tt>--libfiles</tt>. This generates the full path names of the
+ LLVM library files.</li>
+ </ol>
+ <p>If you wish to delve further into how <tt>llvm-config</tt> generates the
+ correct order (based on library dependencies), please see the tool named
+ <tt>GenLibDeps.pl</tt> in the <tt>utils</tt> source directory of LLVM.</p>
+
+ <!-- =======NOTE: =========================================================-->
+ <!-- === The following graphs and <dl> list are generated automatically ===-->
+ <!-- === by the util named GenLibDeps.pl in the llvm/utils directory. ===-->
+ <!-- === This should be updated whenever new libraries are added, ===-->
+ <!-- === removed, or changed ===-->
+ <!-- =======NOTE: =========================================================-->
+ <h2>Dependency Relationships Of Libraries</h2>
+ <p>This graph shows the dependency of archive libraries on other archive
+ libraries or objects. Where a library has both archive and object forms, only
+ the archive form is shown.</p>
+ <img src="img/libdeps.gif" alt="Library Dependencies"/>
+ <h2>Dependency Relationships Of Object Files</h2>
+ <p>This graph shows the dependency of object files on archive libraries or
+ other objects. Where a library has both object and archive forms, only the
+ dependency to the archive form is shown.</p>
+ <img src="img/objdeps.gif" alt="Object File Dependencies"/>
+ <p>The following list shows the dependency relationships between libraries in
+ textual form. The information is the same as shown on the graphs but arranged
+ alphabetically.</p>
+<dl>
+ <dt><b>libLLVMAnalysis.a</b</dt><dd><ul>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ </ul></dd>
+ <dt><b>libLLVMArchive.a</b</dt><dd><ul>
+ <li>libLLVMBCReader.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ </ul></dd>
+ <dt><b>libLLVMAsmParser.a</b</dt><dd><ul>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSystem.a</li>
+ </ul></dd>
+ <dt><b>libLLVMBCReader.a</b</dt><dd><ul>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ </ul></dd>
+ <dt><b>libLLVMBCWriter.a</b</dt><dd><ul>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ </ul></dd>
+ <dt><b>libLLVMCodeGen.a</b</dt><dd><ul>
+ <li>libLLVMAnalysis.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMScalarOpts.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ <li>libLLVMTransformUtils.a</li>
+ </ul></dd>
+ <dt><b>libLLVMCore.a</b</dt><dd><ul>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ </ul></dd>
+ <dt><b>libLLVMDebugger.a</b</dt><dd><ul>
+ <li>libLLVMBCReader.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ </ul></dd>
+ <dt><b>libLLVMInstrumentation.a</b</dt><dd><ul>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMScalarOpts.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMTransformUtils.a</li>
+ </ul></dd>
+ <dt><b>libLLVMLinker.a</b</dt><dd><ul>
+ <li>libLLVMArchive.a</li>
+ <li>libLLVMBCReader.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ </ul></dd>
+ <dt><b>libLLVMScalarOpts.a</b</dt><dd><ul>
+ <li>libLLVMAnalysis.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ <li>libLLVMTransformUtils.a</li>
+ </ul></dd>
+ <dt><b>libLLVMSelectionDAG.a</b</dt><dd><ul>
+ <li>libLLVMAnalysis.a</li>
+ <li>libLLVMCodeGen.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ <li>libLLVMTransformUtils.a</li>
+ </ul></dd>
+ <dt><b>libLLVMSupport.a</b</dt><dd><ul>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMbzip2.a</li>
+ </ul></dd>
+ <dt><b>libLLVMSystem.a</b</dt><dd><ul>
+ </ul></dd>
+ <dt><b>libLLVMTarget.a</b</dt><dd><ul>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ </ul></dd>
+ <dt><b>libLLVMTransformUtils.a</b</dt><dd><ul>
+ <li>libLLVMAnalysis.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ <li>libLLVMipa.a</li>
+ </ul></dd>
+ <dt><b>libLLVMbzip2.a</b</dt><dd><ul>
+ </ul></dd>
+ <dt><b>libLLVMipa.a</b</dt><dd><ul>
+ <li>libLLVMAnalysis.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ </ul></dd>
+ <dt><b>libLLVMipo.a</b</dt><dd><ul>
+ <li>libLLVMAnalysis.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ <li>libLLVMTransformUtils.a</li>
+ <li>libLLVMipa.a</li>
+ </ul></dd>
+ <dt><b>libLLVMlto.a</b</dt><dd><ul>
+ <li>libLLVMAnalysis.a</li>
+ <li>libLLVMBCReader.a</li>
+ <li>libLLVMBCWriter.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMLinker.a</li>
+ <li>libLLVMScalarOpts.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ <li>libLLVMipa.a</li>
+ <li>libLLVMipo.a</li>
+ </ul></dd>
+ <dt><b>LLVMARM.o</b</dt><dd><ul>
+ <li>libLLVMCodeGen.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSelectionDAG.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ </ul></dd>
+ <dt><b>LLVMAlpha.o</b</dt><dd><ul>
+ <li>libLLVMCodeGen.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSelectionDAG.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ </ul></dd>
+ <dt><b>LLVMCBackend.o</b</dt><dd><ul>
+ <li>libLLVMAnalysis.a</li>
+ <li>libLLVMCodeGen.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMScalarOpts.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ <li>libLLVMTransformUtils.a</li>
+ <li>libLLVMipa.a</li>
+ </ul></dd>
+ <dt><b>LLVMExecutionEngine.o</b</dt><dd><ul>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ </ul></dd>
+ <dt><b>LLVMIA64.o</b</dt><dd><ul>
+ <li>libLLVMCodeGen.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSelectionDAG.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ </ul></dd>
+ <dt><b>LLVMInterpreter.o</b</dt><dd><ul>
+ <li>LLVMExecutionEngine.o</li>
+ <li>libLLVMCodeGen.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ </ul></dd>
+ <dt><b>LLVMJIT.o</b</dt><dd><ul>
+ <li>LLVMExecutionEngine.o</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ </ul></dd>
+ <dt><b>LLVMPowerPC.o</b</dt><dd><ul>
+ <li>libLLVMCodeGen.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSelectionDAG.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ </ul></dd>
+ <dt><b>LLVMSparc.o</b</dt><dd><ul>
+ <li>libLLVMCodeGen.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSelectionDAG.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ </ul></dd>
+ <dt><b>LLVMX86.o</b</dt><dd><ul>
+ <li>libLLVMCodeGen.a</li>
+ <li>libLLVMCore.a</li>
+ <li>libLLVMSelectionDAG.a</li>
+ <li>libLLVMSupport.a</li>
+ <li>libLLVMSystem.a</li>
+ <li>libLLVMTarget.a</li>
+ </ul></dd>
+</dl>
+</div>
+
<!-- ======================================================================= -->
<div class="doc_section"><a name="rot">Linkage Rules Of Thumb</a></div>
<div class="doc_text">
should link into your programs.</p>
</div>
<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="always">Always Link vmcore.o support.a</a>
-</div>
+<div class="doc_subsection"><a name="always">Always Link LLVMCore, LLVMSupport,
+ and LLVMSystem</a></div>
<div class="doc_text">
- <p>No matter what you do with LLVM, you'll always need to link with vmcore.o
- and support.a.</p>
+ <p>No matter what you do with LLVM, the last three entries in the value of
+ your LLVMLIBS make variable should always be:
+ <tt>LLVMCore LLVMSupport.a LLVMSystem.a</tt>. There are no <tt>LLVM</tt>
+ programs that don't depend on these three.</p>
</div>
<!-- ======================================================================= -->
-<div class="doc_subsection"><a name="Placeholder">Placeholder</a></div>
+<div class="doc_subsection"><a name="onlyone">Never link both archive and
+ re-linked library</a></div>
<div class="doc_text">
- <p>Need more rules of thumb here.</p>
+ <p>There is never any point to linking both the re-linked (<tt>.o</tt>) and
+ the archive (<tt>.a</tt>) versions of a library. Since the re-linked version
+ includes the entire library, the archive version will not resolve any symbols.
+ You could even end up with link error if you place the archive version before
+ the re-linked version on the linker's command line.</p>
</div>
<!-- ======================================================================= -->
<hr>
<div class="doc_footer">
-<address><a href="mailto:rspencer@x10sys.com">Reid Spencer</a></address>
-<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
+<address>
+ <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
+ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"/></a>
+ <a href="http://validator.w3.org/check/referer"><img
+ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
+ <a href="mailto:rspencer@x10sys.com">Reid Spencer</a>
+</address>
+<a href="http://llvm.org">The LLVM Compiler Infrastructure</a>
<br>Last modified: $Date$ </div>
</body>
</html>