blob: 26b75e2f16a5e78bffd7f3cf413702bcd92651a4 [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>
Reid Spencer341d7142004-10-31 23:00:25 +00008<div class="doc_title">Using The LLVM Libraries</div>
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
Tanya Lattner2b873622006-04-20 04:57:19 +000026<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>
Tanya Lattnerd006d3a2006-04-20 04:55:50 +000027
Chris Lattner61757352004-02-27 06:28:34 +000028<!-- ======================================================================= -->
29<div class="doc_section"><a name="abstract">Abstract</a></div>
30<div class="doc_text">
Reid Spencer341d7142004-10-31 23:00:25 +000031 <p>Amongst other things, LLVM is a toolkit for building compilers, linkers,
32 runtime executives, virtual machines, and other program execution related
33 tools. In addition to the LLVM tool set, the functionality of LLVM is
34 available through a set of libraries. To use LLVM as a toolkit for
35 constructing tools, a developer needs to understand what is contained in the
36 various libraries, what they depend on, and how to use them. This document
37 describes the contents of the libraries and how and when to use them.
Chris Lattner61757352004-02-27 06:28:34 +000038</p>
39</div>
Reid Spencer341d7142004-10-31 23:00:25 +000040
Chris Lattner61757352004-02-27 06:28:34 +000041<!-- ======================================================================= -->
42<div class="doc_section"> <a name="introduction">Introduction</a></div>
43<div class="doc_text">
Reid Spencer341d7142004-10-31 23:00:25 +000044 <p>If you're writing a compiler, virtual machine, or any other utility based
45 on LLVM, you'll need to figure out which of the many libraries files you will
46 need to link with to be successful. An understanding of the contents of these
47 files and their inter-relationships will be useful in coming up with an optimal
48 specification for the libraries to link with. The purpose of this document is
49 to reduce some of the trial and error that the author experienced in using
50 LLVM.</p>
51 <p>LLVM produces two types of libraries: archives (ending in <tt>.a</tt>) and
52 objects (ending in <tt>.o</tt>). However, both are libraries. Libraries ending
53 in <tt>.o</tt> are known as re-linked libraries because they contain all the
54 compilation units of the library linked together as a single <tt>.o</tt> file.
55 Furthermore, many of the libraries have <em>both</em> forms of library. The
56 re-linked libraries are used whenever you want to include all symbols from the
57 library. The archive libraries are used whenever you want to only resolve
58 outstanding symbols at that point in the link without including everything in
59 the library. </p>
60 <p>When linking your tools, you will use the <tt>LLVMLIBS</tt> make variable.
61 (see the <a href="MakefileGuide.html#LLVMLIBS">Makefile Guide</a> for
62 details). This variable specifies which LLVM libraries to link into your tool
63 and the order in which they will be linked. You specify re-linked libraries by
64 naming the library without a suffix. You specify archive libraries by naming
65 the library with a <tt>.a</tt> suffix but without the <tt>lib</tt> prefix. The
66 order in which the libraries appear in the <tt>LLVMLIBS</tt> variable
67 definition is the order in which they will be linked. Getting this order
68 correct for your tool can sometimes be challenging.
Chris Lattner61757352004-02-27 06:28:34 +000069</div>
70<!-- ======================================================================= -->
Reid Spencer341d7142004-10-31 23:00:25 +000071<div class="doc_section"><a name="descriptions"></a>Library Descriptions</div>
Chris Lattner61757352004-02-27 06:28:34 +000072<div class="doc_text">
Reid Spencer341d7142004-10-31 23:00:25 +000073 <p>The table below categorizes each library
74<table style="text-align:left">
75 <tr><th>Library</th><th>Forms</th><th>Description</th></tr>
Reid Spencer0a4e8b32004-11-01 09:22:49 +000076 <tr><th colspan="3">Core Libraries</th></tr>
Reid Spencer139e1662004-12-31 00:13:14 +000077 <tr><td>LLVMArchive</td><td><tt>.a</tt></td>
78 <td>LLVM archive reading and writing</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +000079 <tr><td>LLVMAsmParser</td><td><tt>.o</tt></td>
Reid Spencer139e1662004-12-31 00:13:14 +000080 <td>LLVM assembly parsing</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +000081 <tr><td>LLVMBCReader</td><td><tt>.o</tt></td>
Reid Spencer139e1662004-12-31 00:13:14 +000082 <td>LLVM bytecode reading</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +000083 <tr><td>LLVMBCWriter</td><td><tt>.o</tt></td>
Reid Spencer139e1662004-12-31 00:13:14 +000084 <td>LLVM bytecode writing</td></tr>
85 <tr><td>LLVMCore</td><td><tt>.o</tt></td>
86 <td>LLVM core intermediate representation</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +000087 <tr><td>LLVMDebugger</td><td><tt>.o</tt></td>
Reid Spencer139e1662004-12-31 00:13:14 +000088 <td>Source level debugging support</td></tr>
89 <tr><td>LLVMLinker</td><td><tt>.a</tt></td>
90 <td>Bytecode and archive linking interface</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +000091 <tr><td>LLVMSupport</td><td><tt>.a .o</tt></td>
92 <td>General support utilities</td></tr>
93 <tr><td>LLVMSystem</td><td><tt>.a .o</tt></td>
Reid Spencer139e1662004-12-31 00:13:14 +000094 <td>Operating system abstraction layer</td></tr>
Reid Spencer341d7142004-10-31 23:00:25 +000095
Reid Spencer0a4e8b32004-11-01 09:22:49 +000096 <tr><th colspan="3">Analysis Libraries</th></tr>
Reid Spencer41482662004-10-31 23:24:31 +000097 <tr><td>LLVMAnalysis</td><td><tt>.a .o</tt></td>
98 <td>Various analysis passes.</td></tr>
99 <tr><td>LLVMDataStructure</td><td><tt>.a .o</tt></td>
100 <td>Data structure analysis passes.</td></tr>
101 <tr><td>LLVMipa</td><td><tt>.a .o</tt></td>
102 <td>Inter-procedural analysis passes.</td></tr>
Reid Spencer341d7142004-10-31 23:00:25 +0000103
Reid Spencer0a4e8b32004-11-01 09:22:49 +0000104 <tr><th colspan="3">Transformation Libraries</th></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000105 <tr><td>LLVMInstrumentation</td><td><tt>.a .o</tt></td>
106 <td>Instrumentation passes.</td></tr>
107 <tr><td>LLVMipo</td><td><tt>.a .o</tt></td>
108 <td>All inter-procedural optimization passes.</td></tr>
109 <tr><td>LLVMScalarOpts</td><td><tt>.a .o</tt></td>
110 <td>All scalar optimization passes.</td></tr>
111 <tr><td>LLVMTransforms</td><td><tt>.a .o</tt></td>
112 <td>Uncategorized transformation passes.</td></tr>
113 <tr><td>LLVMTransformUtils</td><td><tt>.a .o</tt></td>
114 <td>Transformation utilities.</td></tr>
Reid Spencer341d7142004-10-31 23:00:25 +0000115
Reid Spencer0a4e8b32004-11-01 09:22:49 +0000116 <tr><th colspan="3">Code Generation Libraries </th></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000117 <tr><td>LLVMCodeGen</td><td><tt>.o</tt></td>
118 <td>Native code generation infrastructure</td></tr>
Reid Spencer341d7142004-10-31 23:00:25 +0000119
Reid Spencer0a4e8b32004-11-01 09:22:49 +0000120 <tr><th colspan="3">Target Libraries</th></tr>
Reid Spencerd42037a2006-05-13 02:22:01 +0000121 <tr><td>LLVMAlpha</td><td><tt>.o</tt></td>
122 <td>Code generation for Alpha architecture</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000123 <tr><td>LLVMCBackend</td><td><tt>.o</tt></td>
124 <td>'C' language code generator.</td></tr>
Reid Spencerd42037a2006-05-13 02:22:01 +0000125 <tr><td>LLVMIA64</td><td><tt>.o</tt></td>
126 <td>Code generation for IA64 architecture</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000127 <tr><td>LLVMPowerPC</td><td><tt>.o</tt></td>
Reid Spencerd42037a2006-05-13 02:22:01 +0000128 <td>Code generation for PowerPC architecture</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000129 <tr><td>LLVMSelectionDAG</td><td><tt>.o</tt></td>
Reid Spencerd42037a2006-05-13 02:22:01 +0000130 <td>Aggressive instruction selector for directed acyclic graphs</td></tr>
Chris Lattner029e8442006-02-05 06:40:12 +0000131 <tr><td>LLVMSparc</td><td><tt>.o</tt></td>
Reid Spencerd42037a2006-05-13 02:22:01 +0000132 <td>Code generation for Sparc architecture</td></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000133 <tr><td>LLVMTarget</td><td><tt>.a .o</tt></td>
134 <td>Generic code generation utilities.</td></tr>
135 <tr><td>LLVMX86</td><td><tt>.o</tt></td>
Reid Spencerd42037a2006-05-13 02:22:01 +0000136 <td>Code generation for Intel x86 architecture</td></tr>
Reid Spencer341d7142004-10-31 23:00:25 +0000137
Reid Spencer0a4e8b32004-11-01 09:22:49 +0000138 <tr><th colspan="3">Runtime Libraries</th></tr>
Reid Spencer41482662004-10-31 23:24:31 +0000139 <tr><td>LLVMInterpreter</td><td><tt>.o</tt></td>
140 <td>Bytecode Interpreter</td></tr>
141 <tr><td>LLVMJIT</td><td><tt>.o</tt></td>
142 <td>Bytecode JIT Compiler</td></tr>
143 <tr><td>LLVMExecutionEngine</td><td><tt>.o</tt></td>
144 <td>Virtual machine engine</td></tr>
Chris Lattner61757352004-02-27 06:28:34 +0000145</table>
146</div>
Reid Spencer341d7142004-10-31 23:00:25 +0000147
Chris Lattner61757352004-02-27 06:28:34 +0000148<!-- ======================================================================= -->
Reid Spencere0f33ae2004-12-30 23:12:04 +0000149<div class="doc_section"><a name="dependencies"></a>Library Dependencies</div>
150<div class="doc_text">
Reid Spencer43ff9002005-01-03 05:46:46 +0000151 <p>Below are two dependency graphs and a list that show the relationships
152 between the various LLVM archive libraries and object files. This information
153 can be automatically generated with the <tt>GenLibDeps.pl</tt> utility found
154 in the <tt>llvm/utils</tt> directory.</p>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000155 <!-- =======NOTE: =========================================================-->
Reid Spencer43ff9002005-01-03 05:46:46 +0000156 <!-- === The following graphs and <dl> list are generated automatically ===-->
157 <!-- === by the util named GenLibDeps.pl in the llvm/utils directory. ===-->
158 <!-- === This should be updated whenever new libraries are added, ===-->
159 <!-- === removed, or changed ===-->
Reid Spencere0f33ae2004-12-30 23:12:04 +0000160 <!-- =======NOTE: =========================================================-->
Reid Spencer43ff9002005-01-03 05:46:46 +0000161 <h2>Dependency Relationships Of Libraries</h2>
162 <p>This graph shows the dependency of archive libraries on other archive
163 libraries or objects. Where a library has both archive and object forms, only
164 the archive form is shown.</p>
165 <img src="img/libdeps.gif" alt="Library Dependencies"/>
166 <h2>Dependency Relationships Of Object Files</h2>
167 <p>This graph shows the dependency of object files on archive libraries or
168 other objects. Where a library has both object and archive forms, only the
169 dependency to the archive form is shown.</p>
170 <img src="img/objdeps.gif" alt="Object File Dependencies"/>
171 <p>The following list shows the dependency relationships between libraries in
172 textual form. The information is the same as shown on the graphs but arranged
173 alphabetically.</p>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000174<dl>
175 <dt><b>libLLVMAnalysis.a</b</dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000176 <li>libLLVMSupport.a</li>
177 <li>libLLVMTarget.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000178 <li>LLVMCore.o</li>
179 </ul></dd>
180 <dt><b>libLLVMArchive.a</b</dt><dd><ul>
181 <li>libLLVMSupport.a</li>
182 <li>libLLVMSystem.a</li>
183 <li>LLVMBCReader.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000184 <li>LLVMCore.o</li>
185 </ul></dd>
186 <dt><b>libLLVMInstrumentation.a</b</dt><dd><ul>
Reid Spencerd42037a2006-05-13 02:22:01 +0000187 <li>libLLVMScalarOpts.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000188 <li>libLLVMSupport.a</li>
189 <li>libLLVMTransformUtils.a</li>
190 <li>LLVMCore.o</li>
191 </ul></dd>
192 <dt><b>libLLVMLinker.a</b</dt><dd><ul>
193 <li>libLLVMArchive.a</li>
194 <li>libLLVMSystem.a</li>
195 <li>LLVMBCReader.o</li>
196 <li>LLVMCore.o</li>
197 </ul></dd>
198 <dt><b>libLLVMScalarOpts.a</b</dt><dd><ul>
199 <li>libLLVMAnalysis.a</li>
200 <li>libLLVMSupport.a</li>
201 <li>libLLVMTarget.a</li>
202 <li>libLLVMTransformUtils.a</li>
203 <li>LLVMCore.o</li>
204 </ul></dd>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000205 <dt><b>libLLVMSupport.a</b</dt><dd><ul>
206 <li>libLLVMSystem.a</li>
207 <li>LLVMbzip2.o</li>
208 </ul></dd>
Reid Spencerd42037a2006-05-13 02:22:01 +0000209 <dt><b>libLLVMSystem.a</b</dt><dd><ul>
210 </ul></dd>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000211 <dt><b>libLLVMTarget.a</b</dt><dd><ul>
212 <li>libLLVMSupport.a</li>
213 <li>LLVMCore.o</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000214 <li>LLVMSelectionDAG.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000215 </ul></dd>
216 <dt><b>libLLVMTransformUtils.a</b</dt><dd><ul>
217 <li>libLLVMAnalysis.a</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000218 <li>libLLVMipa.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000219 <li>libLLVMScalarOpts.a</li>
220 <li>libLLVMSupport.a</li>
221 <li>LLVMCore.o</li>
222 </ul></dd>
223 <dt><b>libLLVMTransforms.a</b</dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000224 <li>libLLVMSupport.a</li>
225 <li>libLLVMTarget.a</li>
226 <li>libLLVMTransformUtils.a</li>
227 <li>LLVMCore.o</li>
228 </ul></dd>
229 <dt><b>libLLVMipa.a</b</dt><dd><ul>
230 <li>libLLVMAnalysis.a</li>
231 <li>libLLVMSupport.a</li>
232 <li>LLVMCore.o</li>
233 </ul></dd>
234 <dt><b>libLLVMipo.a</b</dt><dd><ul>
235 <li>libLLVMAnalysis.a</li>
236 <li>libLLVMipa.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000237 <li>libLLVMSupport.a</li>
238 <li>libLLVMTarget.a</li>
239 <li>libLLVMTransformUtils.a</li>
240 <li>LLVMCore.o</li>
241 </ul></dd>
Reid Spencerd42037a2006-05-13 02:22:01 +0000242 <dt><b>LLVMAlpha.o</b</dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000243 <li>libLLVMScalarOpts.a</li>
244 <li>libLLVMSupport.a</li>
245 <li>libLLVMTarget.a</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000246 <li>LLVMCodeGen.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000247 <li>LLVMCore.o</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000248 <li>LLVMSelectionDAG.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000249 </ul></dd>
250 <dt><b>LLVMAsmParser.o</b</dt><dd><ul>
251 <li>LLVMCore.o</li>
252 </ul></dd>
253 <dt><b>LLVMBCReader.o</b</dt><dd><ul>
254 <li>libLLVMSupport.a</li>
255 <li>libLLVMSystem.a</li>
256 <li>LLVMCore.o</li>
257 </ul></dd>
258 <dt><b>LLVMBCWriter.o</b</dt><dd><ul>
259 <li>libLLVMSupport.a</li>
260 <li>LLVMCore.o</li>
261 </ul></dd>
262 <dt><b>LLVMCBackend.o</b</dt><dd><ul>
263 <li>libLLVMAnalysis.a</li>
264 <li>libLLVMipa.a</li>
265 <li>libLLVMScalarOpts.a</li>
266 <li>libLLVMSupport.a</li>
267 <li>libLLVMTarget.a</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000268 <li>LLVMCodeGen.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000269 <li>LLVMCore.o</li>
270 </ul></dd>
271 <dt><b>LLVMCodeGen.o</b</dt><dd><ul>
272 <li>libLLVMAnalysis.a</li>
273 <li>libLLVMSupport.a</li>
274 <li>libLLVMTarget.a</li>
275 <li>LLVMCore.o</li>
276 </ul></dd>
277 <dt><b>LLVMCore.o</b</dt><dd><ul>
278 <li>libLLVMSupport.a</li>
279 </ul></dd>
280 <dt><b>LLVMDataStructure.o</b</dt><dd><ul>
281 <li>libLLVMAnalysis.a</li>
282 <li>libLLVMSupport.a</li>
283 <li>libLLVMTarget.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000284 <li>LLVMCore.o</li>
285 </ul></dd>
286 <dt><b>LLVMDebugger.o</b</dt><dd><ul>
287 <li>libLLVMSupport.a</li>
288 <li>libLLVMSystem.a</li>
289 <li>LLVMBCReader.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000290 <li>LLVMCore.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000291 </ul></dd>
292 <dt><b>LLVMExecutionEngine.o</b</dt><dd><ul>
293 <li>libLLVMSupport.a</li>
294 <li>libLLVMSystem.a</li>
295 <li>libLLVMTarget.a</li>
296 <li>LLVMCore.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000297 </ul></dd>
Reid Spencerd42037a2006-05-13 02:22:01 +0000298 <dt><b>LLVMIA64.o</b</dt><dd><ul>
299 <li>libLLVMScalarOpts.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000300 <li>libLLVMSupport.a</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000301 <li>libLLVMTarget.a</li>
302 <li>LLVMCodeGen.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000303 <li>LLVMCore.o</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000304 <li>LLVMSelectionDAG.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000305 </ul></dd>
306 <dt><b>LLVMInterpreter.o</b</dt><dd><ul>
307 <li>libLLVMSupport.a</li>
308 <li>libLLVMSystem.a</li>
309 <li>libLLVMTarget.a</li>
310 <li>LLVMCore.o</li>
311 <li>LLVMExecutionEngine.o</li>
312 </ul></dd>
313 <dt><b>LLVMJIT.o</b</dt><dd><ul>
314 <li>libLLVMSupport.a</li>
315 <li>libLLVMSystem.a</li>
316 <li>libLLVMTarget.a</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000317 <li>LLVMCodeGen.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000318 <li>LLVMCore.o</li>
319 <li>LLVMExecutionEngine.o</li>
320 </ul></dd>
321 <dt><b>LLVMPowerPC.o</b</dt><dd><ul>
322 <li>libLLVMScalarOpts.a</li>
323 <li>libLLVMSupport.a</li>
324 <li>libLLVMTarget.a</li>
325 <li>LLVMCodeGen.o</li>
326 <li>LLVMCore.o</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000327 <li>LLVMSelectionDAG.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000328 </ul></dd>
329 <dt><b>LLVMSelectionDAG.o</b</dt><dd><ul>
Reid Spencerd42037a2006-05-13 02:22:01 +0000330 <li>libLLVMSupport.a</li>
331 <li>libLLVMSystem.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000332 <li>libLLVMTarget.a</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000333 <li>libLLVMTransformUtils.a</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000334 <li>LLVMCodeGen.o</li>
335 <li>LLVMCore.o</li>
336 </ul></dd>
Chris Lattner029e8442006-02-05 06:40:12 +0000337 <dt><b>LLVMSparc.o</b</dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000338 <li>libLLVMScalarOpts.a</li>
339 <li>libLLVMSupport.a</li>
340 <li>libLLVMTarget.a</li>
341 <li>LLVMCodeGen.o</li>
342 <li>LLVMCore.o</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000343 <li>LLVMSelectionDAG.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000344 </ul></dd>
345 <dt><b>LLVMX86.o</b</dt><dd><ul>
346 <li>libLLVMScalarOpts.a</li>
347 <li>libLLVMSupport.a</li>
348 <li>libLLVMTarget.a</li>
349 <li>LLVMCodeGen.o</li>
350 <li>LLVMCore.o</li>
Reid Spencerd42037a2006-05-13 02:22:01 +0000351 <li>LLVMSelectionDAG.o</li>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000352 </ul></dd>
Reid Spencerd42037a2006-05-13 02:22:01 +0000353 <dt><b>LLVMbzip2.o</b</dt><dd><ul>
Reid Spencere0f33ae2004-12-30 23:12:04 +0000354 </ul></dd>
355</dl>
356</div>
357
358<!-- ======================================================================= -->
Chris Lattner61757352004-02-27 06:28:34 +0000359<div class="doc_section"><a name="rot">Linkage Rules Of Thumb</a></div>
360<div class="doc_text">
361 <p>This section contains various "rules of thumb" about what files you
362 should link into your programs.</p>
363</div>
364<!-- ======================================================================= -->
Misha Brukman6fb51662004-11-08 00:22:22 +0000365<div class="doc_subsection"><a name="always">Always Link LLVMCore, LLVMSupport,
366 and LLVMSystem</a></div>
Chris Lattner61757352004-02-27 06:28:34 +0000367<div class="doc_text">
Reid Spencer52afa7e2004-11-08 00:26:32 +0000368 <p>No matter what you do with LLVM, the last three entries in the value of
369 your LLVMLIBS make variable should always be:
370 <tt>LLVMCore LLVMSupport.a LLVMSystem.a</tt>. There are no <tt>LLVM</tt>
371 programs that don't depend on these three.</p>
Chris Lattner61757352004-02-27 06:28:34 +0000372</div>
373<!-- ======================================================================= -->
Reid Spencer341d7142004-10-31 23:00:25 +0000374<div class="doc_subsection"><a name="onlyone">Never link both archive and
375 re-linked library</a></div>
Chris Lattner61757352004-02-27 06:28:34 +0000376<div class="doc_text">
Reid Spencer341d7142004-10-31 23:00:25 +0000377 <p>There is never any point to linking both the re-linked (<tt>.o</tt>) and
378 the archive (<tt>.a</tt>) versions of a library. Since the re-linked version
379 includes the entire library, the archive version will not resolve any symbols.
Reid Spencer347e2882004-11-08 00:24:43 +0000380 You could even end up with link error if you place the archive version before
Reid Spencer341d7142004-10-31 23:00:25 +0000381 the re-linked version on the linker's command line.</p>
Chris Lattner61757352004-02-27 06:28:34 +0000382</div>
383<!-- ======================================================================= -->
384<hr>
385<div class="doc_footer">
Reid Spencerbd722412004-11-01 09:19:53 +0000386<address>
387 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
388 src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"/></a>
389 <a href="http://validator.w3.org/check/referer"><img
390 src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
391 <a href="mailto:rspencer@x10sys.com">Reid Spencer</a>
392</address>
Reid Spencer05fe4b02006-03-14 05:39:39 +0000393<a href="http://llvm.org">The LLVM Compiler Infrastructure</a>
Chris Lattner61757352004-02-27 06:28:34 +0000394<br>Last modified: $Date$ </div>
395</body>
396</html>
397<!-- vim: sw=2 ts=2 ai
398-->