blob: 2973452532960de1b015416aac5d715bbe207267 [file] [log] [blame]
Reid Spencercbadf802004-11-01 09:21:32 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Chris Lattner61757352004-02-27 06:28:34 +00002<html>
3<head>
Reid Spencer341d7142004-10-31 23:00:25 +00004 <title>Using The LLVM Libraries</title>
Chris Lattner61757352004-02-27 06:28:34 +00005 <link rel="stylesheet" href="llvm.css" type="text/css">
6</head>
7<body>
NAKAMURA Takumi05d02652011-04-18 23:59:50 +00008<h1>Using The LLVM Libraries</h1>
Chris Lattner61757352004-02-27 06:28:34 +00009<ol>
10 <li><a href="#abstract">Abstract</a></li>
11 <li><a href="#introduction">Introduction</a></li>
Reid Spencer341d7142004-10-31 23:00:25 +000012 <li><a href="#descriptions">Library Descriptions</a></li>
Reid Spencere0f33ae2004-12-30 23:12:04 +000013 <li><a href="#dependencies">Library Dependencies</a></li>
Chris Lattner61757352004-02-27 06:28:34 +000014 <li><a href="#rot">Linkage Rules Of Thumb</a>
15 <ol>
Reid Spencer41482662004-10-31 23:24:31 +000016 <li><a href="#always">Always link LLVMCore, LLVMSupport, LLVMSystem</a>
17 <li><a href="#onlyone">Never link both archive and re-linked</a>
Chris Lattner61757352004-02-27 06:28:34 +000018 </ol>
19 </li>
20</ol>
Chris Lattner7911ce22004-05-23 21:07:27 +000021
22<div class="doc_author">
23 <p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p>
Chris Lattner61757352004-02-27 06:28:34 +000024</div>
Chris Lattner7911ce22004-05-23 21:07:27 +000025
Oscar Fuentesd3a04652010-09-17 00:30:52 +000026<p class="doc_warning">Warning: This document is out of date, for more
27 information please
28 see <a href="CommandGuide/html/llvm-config.html">llvm-config</a> or,
NAKAMURA Takumi4d6deb02011-04-09 09:51:57 +000029 if you use CMake, <a href="CMake.html#embedding">the CMake LLVM
Oscar Fuentesd3a04652010-09-17 00:30:52 +000030 guide</a>.</p>
Tanya Lattnerd006d3a2006-04-20 04:55:50 +000031
Chris Lattner61757352004-02-27 06:28:34 +000032<!-- ======================================================================= -->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +000033<h2><a name="abstract">Abstract</a></h2>
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +000034<div>
Reid Spencer341d7142004-10-31 23:00:25 +000035 <p>Amongst other things, LLVM is a toolkit for building compilers, linkers,
36 runtime executives, virtual machines, and other program execution related
37 tools. In addition to the LLVM tool set, the functionality of LLVM is
38 available through a set of libraries. To use LLVM as a toolkit for
39 constructing tools, a developer needs to understand what is contained in the
Reid Spencere131ec92006-08-01 07:32:01 +000040 various libraries, what they depend on, and how to use them. Fortunately,
41 there is a tool, <tt>llvm-config</tt> to aid with this. This document
42 describes the contents of the libraries and how to use <tt>llvm-config</tt>
43 to generate command line options.
Chris Lattner61757352004-02-27 06:28:34 +000044</p>
45</div>
Reid Spencer341d7142004-10-31 23:00:25 +000046
Chris Lattner61757352004-02-27 06:28:34 +000047<!-- ======================================================================= -->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +000048<h2><a name="introduction">Introduction</a></h2>
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +000049<div>
Reid Spencer341d7142004-10-31 23:00:25 +000050 <p>If you're writing a compiler, virtual machine, or any other utility based
51 on LLVM, you'll need to figure out which of the many libraries files you will
52 need to link with to be successful. An understanding of the contents of these
Reid Spencere131ec92006-08-01 07:32:01 +000053 libraries will be useful in coming up with an optimal specification for the
54 libraries to link with. The purpose of this document is to reduce some of
55 the trial and error that the author experienced in using LLVM.</p>
Reid Spencer341d7142004-10-31 23:00:25 +000056 <p>LLVM produces two types of libraries: archives (ending in <tt>.a</tt>) and
57 objects (ending in <tt>.o</tt>). However, both are libraries. Libraries ending
58 in <tt>.o</tt> are known as re-linked libraries because they contain all the
59 compilation units of the library linked together as a single <tt>.o</tt> file.
Reid Spencere131ec92006-08-01 07:32:01 +000060 Furthermore, several of the libraries have <em>both</em> forms of library. The
Reid Spencer341d7142004-10-31 23:00:25 +000061 re-linked libraries are used whenever you want to include all symbols from the
62 library. The archive libraries are used whenever you want to only resolve
63 outstanding symbols at that point in the link without including everything in
64 the library. </p>
Reid Spencere131ec92006-08-01 07:32:01 +000065 <p>If you're using the LLVM Makefile system to link your tools,you will use
66 the <tt>LLVMLIBS</tt> make variable.
Reid Spencer341d7142004-10-31 23:00:25 +000067 (see the <a href="MakefileGuide.html#LLVMLIBS">Makefile Guide</a> for
68 details). This variable specifies which LLVM libraries to link into your tool
69 and the order in which they will be linked. You specify re-linked libraries by
70 naming the library without a suffix. You specify archive libraries by naming
71 the library with a <tt>.a</tt> suffix but without the <tt>lib</tt> prefix. The
72 order in which the libraries appear in the <tt>LLVMLIBS</tt> variable
73 definition is the order in which they will be linked. Getting this order
74 correct for your tool can sometimes be challenging.
Chris Lattner61757352004-02-27 06:28:34 +000075</div>
76<!-- ======================================================================= -->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +000077<h2><a name="descriptions">Library Descriptions</a></h2>
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +000078<div>
Reid Spencer341d7142004-10-31 23:00:25 +000079 <p>The table below categorizes each library
80<table style="text-align:left">
81 <tr><th>Library</th><th>Forms</th><th>Description</th></tr>
Reid Spencer0a4e8b32004-11-01 09:22:49 +000082 <tr><th colspan="3">Core Libraries</th></tr>
Reid Spencer139e1662004-12-31 00:13:14 +000083 <tr><td>LLVMArchive</td><td><tt>.a</tt></td>
84 <td>LLVM archive reading and writing</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +000085 <tr><td>LLVMAsmParser</td><td><tt>.a</tt></td>
Reid Spencer139e1662004-12-31 00:13:14 +000086 <td>LLVM assembly parsing</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +000087 <tr><td>LLVMBCReader</td><td><tt>.a</tt></td>
Gabor Greif04367bf2007-07-06 22:07:22 +000088 <td>LLVM bitcode reading</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +000089 <tr><td>LLVMBCWriter</td><td><tt>.a</tt></td>
Gabor Greif04367bf2007-07-06 22:07:22 +000090 <td>LLVM bitcode writing</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +000091 <tr><td>LLVMCore</td><td><tt>.a</tt></td>
Reid Spencer139e1662004-12-31 00:13:14 +000092 <td>LLVM core intermediate representation</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +000093 <tr><td>LLVMDebugger</td><td><tt>.a</tt></td>
Reid Spencer139e1662004-12-31 00:13:14 +000094 <td>Source level debugging support</td></tr>
95 <tr><td>LLVMLinker</td><td><tt>.a</tt></td>
Gabor Greif04367bf2007-07-06 22:07:22 +000096 <td>Bitcode and archive linking interface</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +000097 <tr><td>LLVMSupport</td><td><tt>.a</tt></td>
Reid Spencer41482662004-10-31 23:24:31 +000098 <td>General support utilities</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +000099 <tr><td>LLVMSystem</td><td><tt>.a</tt></td>
Reid Spencer139e1662004-12-31 00:13:14 +0000100 <td>Operating system abstraction layer</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000101 <tr><td>LLVMbzip2</td><td><tt>.a</tt></td>
102 <td>BZip2 compression library</td></tr>
Reid Spencer341d7142004-10-31 23:00:25 +0000103
Reid Spencer0a4e8b32004-11-01 09:22:49 +0000104 <tr><th colspan="3">Analysis Libraries</th></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000105 <tr><td>LLVMAnalysis</td><td><tt>.a</tt></td>
Reid Spencer41482662004-10-31 23:24:31 +0000106 <td>Various analysis passes.</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000107 <tr><td>LLVMDataStructure</td><td><tt>.o</tt></td>
Reid Spencer41482662004-10-31 23:24:31 +0000108 <td>Data structure analysis passes.</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000109 <tr><td>LLVMipa</td><td><tt>.a</tt></td>
Reid Spencer41482662004-10-31 23:24:31 +0000110 <td>Inter-procedural analysis passes.</td></tr>
Reid Spencer341d7142004-10-31 23:00:25 +0000111
Reid Spencer0a4e8b32004-11-01 09:22:49 +0000112 <tr><th colspan="3">Transformation Libraries</th></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000113 <tr><td>LLVMInstrumentation</td><td><tt>.a</tt></td>
Reid Spencer41482662004-10-31 23:24:31 +0000114 <td>Instrumentation passes.</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000115 <tr><td>LLVMipo</td><td><tt>.a</tt></td>
Reid Spencer41482662004-10-31 23:24:31 +0000116 <td>All inter-procedural optimization passes.</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000117 <tr><td>LLVMScalarOpts</td><td><tt>.a</tt></td>
Reid Spencer41482662004-10-31 23:24:31 +0000118 <td>All scalar optimization passes.</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000119 <tr><td>LLVMTransformUtils</td><td><tt>.a</tt></td>
Reid Spencer006c6872007-02-04 00:17:35 +0000120 <td>Transformation utilities used by many passes.</td></tr>
Reid Spencer341d7142004-10-31 23:00:25 +0000121
Reid Spencer0a4e8b32004-11-01 09:22:49 +0000122 <tr><th colspan="3">Code Generation Libraries </th></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000123 <tr><td>LLVMCodeGen</td><td><tt>.o</tt></td>
124 <td>Native code generation infrastructure</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000125 <tr><td>LLVMSelectionDAG</td><td><tt>.o</tt></td>
126 <td>Aggressive instruction selector for directed acyclic graphs</td></tr>
Reid Spencer341d7142004-10-31 23:00:25 +0000127
Reid Spencer0a4e8b32004-11-01 09:22:49 +0000128 <tr><th colspan="3">Target Libraries</th></tr>
Reid Spencerd42037a2006-05-13 02:22:01 +0000129 <tr><td>LLVMAlpha</td><td><tt>.o</tt></td>
130 <td>Code generation for Alpha architecture</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000131 <tr><td>LLVMARM</td><td><tt>.o</tt></td>
132 <td>Code generation for ARM architecture</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000133 <tr><td>LLVMCBackend</td><td><tt>.o</tt></td>
134 <td>'C' language code generator.</td></tr>
135 <tr><td>LLVMPowerPC</td><td><tt>.o</tt></td>
Reid Spencerd42037a2006-05-13 02:22:01 +0000136 <td>Code generation for PowerPC architecture</td></tr>
Chris Lattner029e8442006-02-05 06:40:12 +0000137 <tr><td>LLVMSparc</td><td><tt>.o</tt></td>
Reid Spencerd42037a2006-05-13 02:22:01 +0000138 <td>Code generation for Sparc architecture</td></tr>
Reid Spencere131ec92006-08-01 07:32:01 +0000139 <tr><td>LLVMTarget</td><td><tt>.a</tt></td>
Reid Spencer41482662004-10-31 23:24:31 +0000140 <td>Generic code generation utilities.</td></tr>
141 <tr><td>LLVMX86</td><td><tt>.o</tt></td>
Reid Spencerd42037a2006-05-13 02:22:01 +0000142 <td>Code generation for Intel x86 architecture</td></tr>
Reid Spencer341d7142004-10-31 23:00:25 +0000143
Reid Spencer0a4e8b32004-11-01 09:22:49 +0000144 <tr><th colspan="3">Runtime Libraries</th></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000145 <tr><td>LLVMInterpreter</td><td><tt>.o</tt></td>
Gabor Greif04367bf2007-07-06 22:07:22 +0000146 <td>Bitcode Interpreter</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000147 <tr><td>LLVMJIT</td><td><tt>.o</tt></td>
Gabor Greif04367bf2007-07-06 22:07:22 +0000148 <td>Bitcode JIT Compiler</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000149 <tr><td>LLVMExecutionEngine</td><td><tt>.o</tt></td>
150 <td>Virtual machine engine</td></tr>
Chris Lattner61757352004-02-27 06:28:34 +0000151</table>
152</div>
Reid Spencer341d7142004-10-31 23:00:25 +0000153
Chris Lattner61757352004-02-27 06:28:34 +0000154<!-- ======================================================================= -->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +0000155<h2><a name="dependencies">Using llvm-config</a></h2>
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +0000156<div>
Reid Spencer704e81f2006-08-01 16:23:54 +0000157 <p>The <tt>llvm-config</tt> tool is a perl script that produces on its output
Reid Spencere131ec92006-08-01 07:32:01 +0000158 various kinds of information. For example, the source or object directories
159 used to build LLVM can be accessed by passing options to <tt>llvm-config</tt>.
160 For complete details on this tool, please see the
161 <a href="CommandGuide/html/llvm-config.html">manual page</a>.</p>
162 <p>To understand the relationships between libraries, the <tt>llvm-config</tt>
163 can be very useful. If all you know is that you want certain libraries to
164 be available, you can generate the complete set of libraries to link with
165 using one of four options, as below:</p>
166 <ol>
167 <li><tt>--ldflags</tt>. This generates the command line options necessary to
168 be passed to the <tt>ld</tt> tool in order to link with LLVM. Most notably,
169 the <tt>-L</tt> option is provided to specify a library search directory
Reid Spencer704e81f2006-08-01 16:23:54 +0000170 that contains the LLVM libraries.</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000171 <li><tt>--libs</tt>. This generates command line options suitable for
172 use with a gcc-style linker. That is, libraries are given with a -l option
173 and object files are given with a full path.</li>
174 <li><tt>--libnames</tt>. This generates a list of just the library file
175 names. If you know the directory in which these files reside (see --ldflags)
176 then you can find the libraries there.</li>
Reid Spencer704e81f2006-08-01 16:23:54 +0000177 <li><tt>--libfiles</tt>. This generates the full path names of the
178 LLVM library files.</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000179 </ol>
180 <p>If you wish to delve further into how <tt>llvm-config</tt> generates the
181 correct order (based on library dependencies), please see the tool named
182 <tt>GenLibDeps.pl</tt> in the <tt>utils</tt> source directory of LLVM.</p>
183
Reid Spencere0f33ae2004-12-30 23:12:04 +0000184 <!-- =======NOTE: =========================================================-->
Reid Spencer43ff9002005-01-03 05:46:46 +0000185 <!-- === The following graphs and <dl> list are generated automatically ===-->
186 <!-- === by the util named GenLibDeps.pl in the llvm/utils directory. ===-->
187 <!-- === This should be updated whenever new libraries are added, ===-->
188 <!-- === removed, or changed ===-->
Reid Spencere0f33ae2004-12-30 23:12:04 +0000189 <!-- =======NOTE: =========================================================-->
NAKAMURA Takumi06c6d9a2011-04-18 01:17:51 +0000190 <h3>Dependency Relationships Of Libraries</h3>
Reid Spencer43ff9002005-01-03 05:46:46 +0000191 <p>This graph shows the dependency of archive libraries on other archive
192 libraries or objects. Where a library has both archive and object forms, only
193 the archive form is shown.</p>
NAKAMURA Takumi4d6deb02011-04-09 09:51:57 +0000194 <img src="img/libdeps.gif" alt="Library Dependencies">
NAKAMURA Takumi06c6d9a2011-04-18 01:17:51 +0000195 <h3>Dependency Relationships Of Object Files</h3>
Reid Spencer43ff9002005-01-03 05:46:46 +0000196 <p>This graph shows the dependency of object files on archive libraries or
197 other objects. Where a library has both object and archive forms, only the
198 dependency to the archive form is shown.</p>
NAKAMURA Takumi4d6deb02011-04-09 09:51:57 +0000199 <img src="img/objdeps.gif" alt="Object File Dependencies">
Reid Spencer43ff9002005-01-03 05:46:46 +0000200 <p>The following list shows the dependency relationships between libraries in
201 textual form. The information is the same as shown on the graphs but arranged
202 alphabetically.</p>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000203<dl>
Dan Gohman364a39f2008-10-14 17:00:38 +0000204 <dt><b>libLLVMAnalysis.a</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000205 <li>libLLVMCore.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000206 <li>libLLVMSupport.a</li>
207 <li>libLLVMSystem.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000208 <li>libLLVMTarget.a</li>
209 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000210 <dt><b>libLLVMArchive.a</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000211 <li>libLLVMBCReader.a</li>
212 <li>libLLVMCore.a</li>
213 <li>libLLVMSupport.a</li>
214 <li>libLLVMSystem.a</li>
215 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000216 <dt><b>libLLVMAsmParser.a</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000217 <li>libLLVMCore.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000218 <li>libLLVMSystem.a</li>
219 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000220 <dt><b>libLLVMBCReader.a</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000221 <li>libLLVMCore.a</li>
222 <li>libLLVMSupport.a</li>
223 <li>libLLVMSystem.a</li>
224 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000225 <dt><b>libLLVMBCWriter.a</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000226 <li>libLLVMCore.a</li>
227 <li>libLLVMSupport.a</li>
228 <li>libLLVMSystem.a</li>
229 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000230 <dt><b>libLLVMCodeGen.a</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000231 <li>libLLVMAnalysis.a</li>
232 <li>libLLVMCore.a</li>
Reid Spencer006c6872007-02-04 00:17:35 +0000233 <li>libLLVMScalarOpts.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000234 <li>libLLVMSupport.a</li>
235 <li>libLLVMSystem.a</li>
236 <li>libLLVMTarget.a</li>
Reid Spencer006c6872007-02-04 00:17:35 +0000237 <li>libLLVMTransformUtils.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000238 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000239 <dt><b>libLLVMCore.a</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000240 <li>libLLVMSupport.a</li>
241 <li>libLLVMSystem.a</li>
242 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000243 <dt><b>libLLVMDebugger.a</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000244 <li>libLLVMBCReader.a</li>
245 <li>libLLVMCore.a</li>
246 <li>libLLVMSupport.a</li>
247 <li>libLLVMSystem.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000248 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000249 <dt><b>libLLVMInstrumentation.a</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000250 <li>libLLVMCore.a</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000251 <li>libLLVMScalarOpts.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000252 <li>libLLVMSupport.a</li>
253 <li>libLLVMTransformUtils.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000254 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000255 <dt><b>libLLVMLinker.a</b></dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000256 <li>libLLVMArchive.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000257 <li>libLLVMBCReader.a</li>
258 <li>libLLVMCore.a</li>
Reid Spencer006c6872007-02-04 00:17:35 +0000259 <li>libLLVMSupport.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000260 <li>libLLVMSystem.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000261 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000262 <dt><b>libLLVMScalarOpts.a</b></dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000263 <li>libLLVMAnalysis.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000264 <li>libLLVMCore.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000265 <li>libLLVMSupport.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000266 <li>libLLVMSystem.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000267 <li>libLLVMTarget.a</li>
268 <li>libLLVMTransformUtils.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000269 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000270 <dt><b>libLLVMSelectionDAG.a</b></dt><dd><ul>
Reid Spencer006c6872007-02-04 00:17:35 +0000271 <li>libLLVMAnalysis.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000272 <li>libLLVMCodeGen.a</li>
273 <li>libLLVMCore.a</li>
274 <li>libLLVMSupport.a</li>
275 <li>libLLVMSystem.a</li>
276 <li>libLLVMTarget.a</li>
277 <li>libLLVMTransformUtils.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000278 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000279 <dt><b>libLLVMSupport.a</b></dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000280 <li>libLLVMSystem.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000281 <li>libLLVMbzip2.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000282 </ul></dd>
NAKAMURA Takumi4d6deb02011-04-09 09:51:57 +0000283 <dt><b>libLLVMSystem.a</b></dt><dd>
284 </dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000285 <dt><b>libLLVMTarget.a</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000286 <li>libLLVMCore.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000287 <li>libLLVMSupport.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000288 <li>libLLVMSystem.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000289 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000290 <dt><b>libLLVMTransformUtils.a</b></dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000291 <li>libLLVMAnalysis.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000292 <li>libLLVMCore.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000293 <li>libLLVMSupport.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000294 <li>libLLVMSystem.a</li>
Reid Spencer006c6872007-02-04 00:17:35 +0000295 <li>libLLVMTarget.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000296 <li>libLLVMipa.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000297 </ul></dd>
NAKAMURA Takumi4d6deb02011-04-09 09:51:57 +0000298 <dt><b>libLLVMbzip2.a</b></dt><dd>
299 </dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000300 <dt><b>libLLVMipa.a</b></dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000301 <li>libLLVMAnalysis.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000302 <li>libLLVMCore.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000303 <li>libLLVMSupport.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000304 <li>libLLVMSystem.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000305 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000306 <dt><b>libLLVMipo.a</b></dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000307 <li>libLLVMAnalysis.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000308 <li>libLLVMCore.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000309 <li>libLLVMSupport.a</li>
310 <li>libLLVMSystem.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000311 <li>libLLVMTarget.a</li>
312 <li>libLLVMTransformUtils.a</li>
313 <li>libLLVMipa.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000314 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000315 <dt><b>libLLVMlto.a</b></dt><dd><ul>
Reid Spencer006c6872007-02-04 00:17:35 +0000316 <li>libLLVMAnalysis.a</li>
317 <li>libLLVMBCReader.a</li>
318 <li>libLLVMBCWriter.a</li>
319 <li>libLLVMCore.a</li>
320 <li>libLLVMLinker.a</li>
321 <li>libLLVMScalarOpts.a</li>
322 <li>libLLVMSupport.a</li>
323 <li>libLLVMSystem.a</li>
324 <li>libLLVMTarget.a</li>
325 <li>libLLVMipa.a</li>
326 <li>libLLVMipo.a</li>
327 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000328 <dt><b>LLVMARM.o</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000329 <li>libLLVMCodeGen.a</li>
330 <li>libLLVMCore.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000331 <li>libLLVMSelectionDAG.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000332 <li>libLLVMSupport.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000333 <li>libLLVMSystem.a</li>
334 <li>libLLVMTarget.a</li>
335 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000336 <dt><b>LLVMAlpha.o</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000337 <li>libLLVMCodeGen.a</li>
338 <li>libLLVMCore.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000339 <li>libLLVMSelectionDAG.a</li>
340 <li>libLLVMSupport.a</li>
341 <li>libLLVMSystem.a</li>
342 <li>libLLVMTarget.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000343 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000344 <dt><b>LLVMCBackend.o</b></dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000345 <li>libLLVMAnalysis.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000346 <li>libLLVMCodeGen.a</li>
347 <li>libLLVMCore.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000348 <li>libLLVMScalarOpts.a</li>
349 <li>libLLVMSupport.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000350 <li>libLLVMSystem.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000351 <li>libLLVMTarget.a</li>
Reid Spencer006c6872007-02-04 00:17:35 +0000352 <li>libLLVMTransformUtils.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000353 <li>libLLVMipa.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000354 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000355 <dt><b>LLVMExecutionEngine.o</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000356 <li>libLLVMCore.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000357 <li>libLLVMSupport.a</li>
358 <li>libLLVMSystem.a</li>
359 <li>libLLVMTarget.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000360 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000361 <dt><b>LLVMInterpreter.o</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000362 <li>LLVMExecutionEngine.o</li>
Reid Spencer006c6872007-02-04 00:17:35 +0000363 <li>libLLVMCodeGen.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000364 <li>libLLVMCore.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000365 <li>libLLVMSupport.a</li>
366 <li>libLLVMSystem.a</li>
367 <li>libLLVMTarget.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000368 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000369 <dt><b>LLVMJIT.o</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000370 <li>LLVMExecutionEngine.o</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000371 <li>libLLVMCore.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000372 <li>libLLVMSupport.a</li>
373 <li>libLLVMSystem.a</li>
374 <li>libLLVMTarget.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000375 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000376 <dt><b>LLVMPowerPC.o</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000377 <li>libLLVMCodeGen.a</li>
378 <li>libLLVMCore.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000379 <li>libLLVMSelectionDAG.a</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000380 <li>libLLVMSupport.a</li>
381 <li>libLLVMSystem.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000382 <li>libLLVMTarget.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000383 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000384 <dt><b>LLVMSparc.o</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000385 <li>libLLVMCodeGen.a</li>
386 <li>libLLVMCore.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000387 <li>libLLVMSelectionDAG.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000388 <li>libLLVMSupport.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000389 <li>libLLVMSystem.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000390 <li>libLLVMTarget.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000391 </ul></dd>
Dan Gohman364a39f2008-10-14 17:00:38 +0000392 <dt><b>LLVMX86.o</b></dt><dd><ul>
Reid Spencere131ec92006-08-01 07:32:01 +0000393 <li>libLLVMCodeGen.a</li>
394 <li>libLLVMCore.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000395 <li>libLLVMSelectionDAG.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000396 <li>libLLVMSupport.a</li>
Reid Spencere131ec92006-08-01 07:32:01 +0000397 <li>libLLVMSystem.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000398 <li>libLLVMTarget.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000399 </ul></dd>
400</dl>
401</div>
402
403<!-- ======================================================================= -->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +0000404<h2><a name="rot">Linkage Rules Of Thumb</a></h2>
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +0000405<div>
Chris Lattner61757352004-02-27 06:28:34 +0000406 <p>This section contains various "rules of thumb" about what files you
407 should link into your programs.</p>
Chris Lattner61757352004-02-27 06:28:34 +0000408<!-- ======================================================================= -->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +0000409<h3>
410 <a name="always">Always Link LLVMCore, LLVMSupport, and LLVMSystem</a>
411</h3>
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +0000412<div>
Reid Spencer52afa7e2004-11-08 00:26:32 +0000413 <p>No matter what you do with LLVM, the last three entries in the value of
414 your LLVMLIBS make variable should always be:
415 <tt>LLVMCore LLVMSupport.a LLVMSystem.a</tt>. There are no <tt>LLVM</tt>
416 programs that don't depend on these three.</p>
Chris Lattner61757352004-02-27 06:28:34 +0000417</div>
418<!-- ======================================================================= -->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +0000419<h3>
420 <a name="onlyone">Never link both archive and re-linked library</a>
421</h3>
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +0000422<div>
Reid Spencer341d7142004-10-31 23:00:25 +0000423 <p>There is never any point to linking both the re-linked (<tt>.o</tt>) and
424 the archive (<tt>.a</tt>) versions of a library. Since the re-linked version
425 includes the entire library, the archive version will not resolve any symbols.
Reid Spencer347e2882004-11-08 00:24:43 +0000426 You could even end up with link error if you place the archive version before
Reid Spencer341d7142004-10-31 23:00:25 +0000427 the re-linked version on the linker's command line.</p>
Chris Lattner61757352004-02-27 06:28:34 +0000428</div>
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +0000429
430</div>
431
Chris Lattner61757352004-02-27 06:28:34 +0000432<!-- ======================================================================= -->
433<hr>
434<div class="doc_footer">
Reid Spencerbd722412004-11-01 09:19:53 +0000435<address>
436 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
NAKAMURA Takumi4d6deb02011-04-09 09:51:57 +0000437 src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"></a>
Reid Spencerbd722412004-11-01 09:19:53 +0000438 <a href="http://validator.w3.org/check/referer"><img
Misha Brukmanf00ddb02008-12-11 18:23:24 +0000439 src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a>
Reid Spencerbd722412004-11-01 09:19:53 +0000440 <a href="mailto:rspencer@x10sys.com">Reid Spencer</a>
441</address>
NAKAMURA Takumib9a33632011-04-09 02:13:37 +0000442<a href="http://llvm.org/">The LLVM Compiler Infrastructure</a>
Chris Lattner61757352004-02-27 06:28:34 +0000443<br>Last modified: $Date$ </div>
444</body>
445</html>
446<!-- vim: sw=2 ts=2 ai
447-->