Update library dependency information, describe new libraries, talk a

little about llvm-config as a source for help with library dependencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29425 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2006-08-01 07:32:01 +00:00
parent 8f2105bcb9
commit e131ec935b
3 changed files with 173 additions and 116 deletions

View File

@ -33,8 +33,10 @@
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. This document
describes the contents of the libraries and how and when to use them.
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>
@ -44,20 +46,20 @@
<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
files and their inter-relationships 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>
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, many of the libraries have <em>both</em> forms of library. The
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>When linking your tools, you will use the <tt>LLVMLIBS</tt> make variable.
<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
@ -76,61 +78,65 @@
<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>.o</tt></td>
<tr><td>LLVMAsmParser</td><td><tt>.a</tt></td>
<td>LLVM assembly parsing</td></tr>
<tr><td>LLVMBCReader</td><td><tt>.o</tt></td>
<tr><td>LLVMBCReader</td><td><tt>.a</tt></td>
<td>LLVM bytecode reading</td></tr>
<tr><td>LLVMBCWriter</td><td><tt>.o</tt></td>
<tr><td>LLVMBCWriter</td><td><tt>.a</tt></td>
<td>LLVM bytecode writing</td></tr>
<tr><td>LLVMCore</td><td><tt>.o</tt></td>
<tr><td>LLVMCore</td><td><tt>.a</tt></td>
<td>LLVM core intermediate representation</td></tr>
<tr><td>LLVMDebugger</td><td><tt>.o</tt></td>
<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>Bytecode and archive linking interface</td></tr>
<tr><td>LLVMSupport</td><td><tt>.a .o</tt></td>
<tr><td>LLVMSupport</td><td><tt>.a</tt></td>
<td>General support utilities</td></tr>
<tr><td>LLVMSystem</td><td><tt>.a .o</tt></td>
<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 .o</tt></td>
<tr><td>LLVMAnalysis</td><td><tt>.a</tt></td>
<td>Various analysis passes.</td></tr>
<tr><td>LLVMDataStructure</td><td><tt>.a .o</tt></td>
<tr><td>LLVMDataStructure</td><td><tt>.o</tt></td>
<td>Data structure analysis passes.</td></tr>
<tr><td>LLVMipa</td><td><tt>.a .o</tt></td>
<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 .o</tt></td>
<tr><td>LLVMInstrumentation</td><td><tt>.a</tt></td>
<td>Instrumentation passes.</td></tr>
<tr><td>LLVMipo</td><td><tt>.a .o</tt></td>
<tr><td>LLVMipo</td><td><tt>.a</tt></td>
<td>All inter-procedural optimization passes.</td></tr>
<tr><td>LLVMScalarOpts</td><td><tt>.a .o</tt></td>
<tr><td>LLVMScalarOpts</td><td><tt>.a</tt></td>
<td>All scalar optimization passes.</td></tr>
<tr><td>LLVMTransforms</td><td><tt>.a .o</tt></td>
<tr><td>LLVMTransforms</td><td><tt>.a</tt></td>
<td>Uncategorized transformation passes.</td></tr>
<tr><td>LLVMTransformUtils</td><td><tt>.a .o</tt></td>
<tr><td>LLVMTransformUtils</td><td><tt>.a</tt></td>
<td>Transformation utilities.</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>LLVMSelectionDAG</td><td><tt>.o</tt></td>
<td>Aggressive instruction selector for directed acyclic graphs</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 .o</tt></td>
<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>
@ -146,12 +152,35 @@
</div>
<!-- ======================================================================= -->
<div class="doc_section"><a name="dependencies"></a>Library Dependencies</div>
<div class="doc_section"><a name="dependencies"></a>Using llvm-config</div>
<div class="doc_text">
<p>Below are two dependency graphs and a list that show the relationships
between the various LLVM archive libraries and object files. This information
can be automatically generated with the <tt>GenLibDeps.pl</tt> utility found
in the <tt>llvm/utils</tt> directory.</p>
<p>The <p>llvm-config</p> 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><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></li>. This generates the full path names of the
LLVM library files.
</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. ===-->
@ -173,184 +202,212 @@
alphabetically.</p>
<dl>
<dt><b>libLLVMAnalysis.a</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMArchive.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>libLLVMSupport.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>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>libLLVMTarget.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>
<li>LLVMBCReader.o</li>
<li>LLVMCore.o</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>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMLinker.a</b</dt><dd><ul>
<li>libLLVMArchive.a</li>
<li>libLLVMBCReader.a</li>
<li>libLLVMCore.a</li>
<li>libLLVMSystem.a</li>
<li>LLVMBCReader.o</li>
<li>LLVMCore.o</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>libLLVMCodeGen.a</li>
<li>libLLVMCore.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMSupport.a</b</dt><dd><ul>
<li>libLLVMSystem.a</li>
<li>LLVMbzip2.o</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>libLLVMCodeGen.a</li>
<li>libLLVMCore.a</li>
<li>libLLVMSelectionDAG.a</li>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</li>
<li>LLVMSelectionDAG.o</li>
<li>libLLVMSystem.a</li>
</ul></dd>
<dt><b>libLLVMTransformUtils.a</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMipa.a</li>
<li>libLLVMCore.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</li>
<li>libLLVMSystem.a</li>
<li>libLLVMipa.a</li>
</ul></dd>
<dt><b>libLLVMTransforms.a</b</dt><dd><ul>
<li>libLLVMCore.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</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>LLVMCore.o</li>
<li>libLLVMSystem.a</li>
</ul></dd>
<dt><b>libLLVMipo.a</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMipa.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMAlpha.o</b</dt><dd><ul>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMSelectionDAG.o</li>
</ul></dd>
<dt><b>LLVMAsmParser.o</b</dt><dd><ul>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMBCReader.o</b</dt><dd><ul>
<li>libLLVMCore.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>LLVMCore.o</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>libLLVMipa.a</li>
</ul></dd>
<dt><b>LLVMBCWriter.o</b</dt><dd><ul>
<dt><b>LLVMARM.o</b</dt><dd><ul>
<li>libLLVMCodeGen.a</li>
<li>libLLVMCore.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSelectionDAG.a</li>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</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>libLLVMScalarOpts.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>libLLVMipa.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>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMCodeGen.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMCore.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMipa.a</li>
</ul></dd>
<dt><b>LLVMDataStructure.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMDebugger.o</b</dt><dd><ul>
<li>libLLVMCore.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>LLVMBCReader.o</li>
<li>LLVMCore.o</li>
<li>libLLVMTarget.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>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMIA64.o</b</dt><dd><ul>
<li>libLLVMCodeGen.a</li>
<li>libLLVMCore.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSelectionDAG.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMSelectionDAG.o</li>
</ul></dd>
<dt><b>LLVMInterpreter.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>
<li>LLVMCore.o</li>
<li>LLVMExecutionEngine.o</li>
</ul></dd>
<dt><b>LLVMJIT.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>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMExecutionEngine.o</li>
</ul></dd>
<dt><b>LLVMPowerPC.o</b</dt><dd><ul>
<li>libLLVMCodeGen.a</li>
<li>libLLVMCore.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMSelectionDAG.o</li>
</ul></dd>
<dt><b>LLVMSelectionDAG.o</b</dt><dd><ul>
<li>libLLVMSelectionDAG.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMSparc.o</b</dt><dd><ul>
<li>libLLVMCodeGen.a</li>
<li>libLLVMCore.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSelectionDAG.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMSelectionDAG.o</li>
</ul></dd>
<dt><b>LLVMX86.o</b</dt><dd><ul>
<li>libLLVMCodeGen.a</li>
<li>libLLVMCore.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSelectionDAG.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMSelectionDAG.o</li>
</ul></dd>
<dt><b>LLVMbzip2.o</b</dt><dd><ul>
</ul></dd>
</dl>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 19 KiB