blob: b1a3b4de62c1e5bfb65c4675baef0db97f080f4a [file] [log] [blame]
Reid Spencer271fe882004-11-01 09:21:32 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Chris Lattner524ee2b2004-02-27 06:28:34 +00002<html>
3<head>
Reid Spencer0d6d8d02004-10-31 23:00:25 +00004 <title>Using The LLVM Libraries</title>
Chris Lattner524ee2b2004-02-27 06:28:34 +00005 <link rel="stylesheet" href="llvm.css" type="text/css">
6</head>
7<body>
Reid Spencer0d6d8d02004-10-31 23:00:25 +00008<div class="doc_title">Using The LLVM Libraries</div>
Chris Lattner524ee2b2004-02-27 06:28:34 +00009<ol>
10 <li><a href="#abstract">Abstract</a></li>
11 <li><a href="#introduction">Introduction</a></li>
Reid Spencer0d6d8d02004-10-31 23:00:25 +000012 <li><a href="#descriptions">Library Descriptions</a></li>
Reid Spencer72767f62004-12-30 23:12:04 +000013 <li><a href="#dependencies">Library Dependencies</a></li>
Chris Lattner524ee2b2004-02-27 06:28:34 +000014 <li><a href="#rot">Linkage Rules Of Thumb</a>
15 <ol>
Reid Spencerb1454872004-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 Lattner524ee2b2004-02-27 06:28:34 +000018 </ol>
19 </li>
20</ol>
Chris Lattner020e1fc2004-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 Lattner524ee2b2004-02-27 06:28:34 +000024</div>
Chris Lattner020e1fc2004-05-23 21:07:27 +000025
Tanya Lattner5a423b32006-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 Lattner011f7352006-04-20 04:55:50 +000027
Chris Lattner524ee2b2004-02-27 06:28:34 +000028<!-- ======================================================================= -->
29<div class="doc_section"><a name="abstract">Abstract</a></div>
30<div class="doc_text">
Reid Spencer0d6d8d02004-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
Reid Spencera16d6502006-08-01 07:32:01 +000036 various libraries, what they depend on, and how to use them. Fortunately,
37 there is a tool, <tt>llvm-config</tt> to aid with this. This document
38 describes the contents of the libraries and how to use <tt>llvm-config</tt>
39 to generate command line options.
Chris Lattner524ee2b2004-02-27 06:28:34 +000040</p>
41</div>
Reid Spencer0d6d8d02004-10-31 23:00:25 +000042
Chris Lattner524ee2b2004-02-27 06:28:34 +000043<!-- ======================================================================= -->
44<div class="doc_section"> <a name="introduction">Introduction</a></div>
45<div class="doc_text">
Reid Spencer0d6d8d02004-10-31 23:00:25 +000046 <p>If you're writing a compiler, virtual machine, or any other utility based
47 on LLVM, you'll need to figure out which of the many libraries files you will
48 need to link with to be successful. An understanding of the contents of these
Reid Spencera16d6502006-08-01 07:32:01 +000049 libraries will be useful in coming up with an optimal specification for the
50 libraries to link with. The purpose of this document is to reduce some of
51 the trial and error that the author experienced in using LLVM.</p>
Reid Spencer0d6d8d02004-10-31 23:00:25 +000052 <p>LLVM produces two types of libraries: archives (ending in <tt>.a</tt>) and
53 objects (ending in <tt>.o</tt>). However, both are libraries. Libraries ending
54 in <tt>.o</tt> are known as re-linked libraries because they contain all the
55 compilation units of the library linked together as a single <tt>.o</tt> file.
Reid Spencera16d6502006-08-01 07:32:01 +000056 Furthermore, several of the libraries have <em>both</em> forms of library. The
Reid Spencer0d6d8d02004-10-31 23:00:25 +000057 re-linked libraries are used whenever you want to include all symbols from the
58 library. The archive libraries are used whenever you want to only resolve
59 outstanding symbols at that point in the link without including everything in
60 the library. </p>
Reid Spencera16d6502006-08-01 07:32:01 +000061 <p>If you're using the LLVM Makefile system to link your tools,you will use
62 the <tt>LLVMLIBS</tt> make variable.
Reid Spencer0d6d8d02004-10-31 23:00:25 +000063 (see the <a href="MakefileGuide.html#LLVMLIBS">Makefile Guide</a> for
64 details). This variable specifies which LLVM libraries to link into your tool
65 and the order in which they will be linked. You specify re-linked libraries by
66 naming the library without a suffix. You specify archive libraries by naming
67 the library with a <tt>.a</tt> suffix but without the <tt>lib</tt> prefix. The
68 order in which the libraries appear in the <tt>LLVMLIBS</tt> variable
69 definition is the order in which they will be linked. Getting this order
70 correct for your tool can sometimes be challenging.
Chris Lattner524ee2b2004-02-27 06:28:34 +000071</div>
72<!-- ======================================================================= -->
Reid Spencer0d6d8d02004-10-31 23:00:25 +000073<div class="doc_section"><a name="descriptions"></a>Library Descriptions</div>
Chris Lattner524ee2b2004-02-27 06:28:34 +000074<div class="doc_text">
Reid Spencer0d6d8d02004-10-31 23:00:25 +000075 <p>The table below categorizes each library
76<table style="text-align:left">
77 <tr><th>Library</th><th>Forms</th><th>Description</th></tr>
Reid Spencer7336a6c2004-11-01 09:22:49 +000078 <tr><th colspan="3">Core Libraries</th></tr>
Reid Spencer234dc342004-12-31 00:13:14 +000079 <tr><td>LLVMArchive</td><td><tt>.a</tt></td>
80 <td>LLVM archive reading and writing</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +000081 <tr><td>LLVMAsmParser</td><td><tt>.a</tt></td>
Reid Spencer234dc342004-12-31 00:13:14 +000082 <td>LLVM assembly parsing</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +000083 <tr><td>LLVMBCReader</td><td><tt>.a</tt></td>
Gabor Greifa54634a2007-07-06 22:07:22 +000084 <td>LLVM bitcode reading</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +000085 <tr><td>LLVMBCWriter</td><td><tt>.a</tt></td>
Gabor Greifa54634a2007-07-06 22:07:22 +000086 <td>LLVM bitcode writing</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +000087 <tr><td>LLVMCore</td><td><tt>.a</tt></td>
Reid Spencer234dc342004-12-31 00:13:14 +000088 <td>LLVM core intermediate representation</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +000089 <tr><td>LLVMDebugger</td><td><tt>.a</tt></td>
Reid Spencer234dc342004-12-31 00:13:14 +000090 <td>Source level debugging support</td></tr>
91 <tr><td>LLVMLinker</td><td><tt>.a</tt></td>
Gabor Greifa54634a2007-07-06 22:07:22 +000092 <td>Bitcode and archive linking interface</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +000093 <tr><td>LLVMSupport</td><td><tt>.a</tt></td>
Reid Spencerb1454872004-10-31 23:24:31 +000094 <td>General support utilities</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +000095 <tr><td>LLVMSystem</td><td><tt>.a</tt></td>
Reid Spencer234dc342004-12-31 00:13:14 +000096 <td>Operating system abstraction layer</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +000097 <tr><td>LLVMbzip2</td><td><tt>.a</tt></td>
98 <td>BZip2 compression library</td></tr>
Reid Spencer0d6d8d02004-10-31 23:00:25 +000099
Reid Spencer7336a6c2004-11-01 09:22:49 +0000100 <tr><th colspan="3">Analysis Libraries</th></tr>
Reid Spencera16d6502006-08-01 07:32:01 +0000101 <tr><td>LLVMAnalysis</td><td><tt>.a</tt></td>
Reid Spencerb1454872004-10-31 23:24:31 +0000102 <td>Various analysis passes.</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +0000103 <tr><td>LLVMDataStructure</td><td><tt>.o</tt></td>
Reid Spencerb1454872004-10-31 23:24:31 +0000104 <td>Data structure analysis passes.</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +0000105 <tr><td>LLVMipa</td><td><tt>.a</tt></td>
Reid Spencerb1454872004-10-31 23:24:31 +0000106 <td>Inter-procedural analysis passes.</td></tr>
Reid Spencer0d6d8d02004-10-31 23:00:25 +0000107
Reid Spencer7336a6c2004-11-01 09:22:49 +0000108 <tr><th colspan="3">Transformation Libraries</th></tr>
Reid Spencera16d6502006-08-01 07:32:01 +0000109 <tr><td>LLVMInstrumentation</td><td><tt>.a</tt></td>
Reid Spencerb1454872004-10-31 23:24:31 +0000110 <td>Instrumentation passes.</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +0000111 <tr><td>LLVMipo</td><td><tt>.a</tt></td>
Reid Spencerb1454872004-10-31 23:24:31 +0000112 <td>All inter-procedural optimization passes.</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +0000113 <tr><td>LLVMScalarOpts</td><td><tt>.a</tt></td>
Reid Spencerb1454872004-10-31 23:24:31 +0000114 <td>All scalar optimization passes.</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +0000115 <tr><td>LLVMTransformUtils</td><td><tt>.a</tt></td>
Reid Spencerf9eabff2007-02-04 00:17:35 +0000116 <td>Transformation utilities used by many passes.</td></tr>
Reid Spencer0d6d8d02004-10-31 23:00:25 +0000117
Reid Spencer7336a6c2004-11-01 09:22:49 +0000118 <tr><th colspan="3">Code Generation Libraries </th></tr>
Reid Spencerb1454872004-10-31 23:24:31 +0000119 <tr><td>LLVMCodeGen</td><td><tt>.o</tt></td>
120 <td>Native code generation infrastructure</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +0000121 <tr><td>LLVMSelectionDAG</td><td><tt>.o</tt></td>
122 <td>Aggressive instruction selector for directed acyclic graphs</td></tr>
Reid Spencer0d6d8d02004-10-31 23:00:25 +0000123
Reid Spencer7336a6c2004-11-01 09:22:49 +0000124 <tr><th colspan="3">Target Libraries</th></tr>
Reid Spencer70de6062006-05-13 02:22:01 +0000125 <tr><td>LLVMAlpha</td><td><tt>.o</tt></td>
126 <td>Code generation for Alpha architecture</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +0000127 <tr><td>LLVMARM</td><td><tt>.o</tt></td>
128 <td>Code generation for ARM architecture</td></tr>
Reid Spencerb1454872004-10-31 23:24:31 +0000129 <tr><td>LLVMCBackend</td><td><tt>.o</tt></td>
130 <td>'C' language code generator.</td></tr>
131 <tr><td>LLVMPowerPC</td><td><tt>.o</tt></td>
Reid Spencer70de6062006-05-13 02:22:01 +0000132 <td>Code generation for PowerPC architecture</td></tr>
Chris Lattnera07b2d52006-02-05 06:40:12 +0000133 <tr><td>LLVMSparc</td><td><tt>.o</tt></td>
Reid Spencer70de6062006-05-13 02:22:01 +0000134 <td>Code generation for Sparc architecture</td></tr>
Reid Spencera16d6502006-08-01 07:32:01 +0000135 <tr><td>LLVMTarget</td><td><tt>.a</tt></td>
Reid Spencerb1454872004-10-31 23:24:31 +0000136 <td>Generic code generation utilities.</td></tr>
137 <tr><td>LLVMX86</td><td><tt>.o</tt></td>
Reid Spencer70de6062006-05-13 02:22:01 +0000138 <td>Code generation for Intel x86 architecture</td></tr>
Reid Spencer0d6d8d02004-10-31 23:00:25 +0000139
Reid Spencer7336a6c2004-11-01 09:22:49 +0000140 <tr><th colspan="3">Runtime Libraries</th></tr>
Reid Spencerb1454872004-10-31 23:24:31 +0000141 <tr><td>LLVMInterpreter</td><td><tt>.o</tt></td>
Gabor Greifa54634a2007-07-06 22:07:22 +0000142 <td>Bitcode Interpreter</td></tr>
Reid Spencerb1454872004-10-31 23:24:31 +0000143 <tr><td>LLVMJIT</td><td><tt>.o</tt></td>
Gabor Greifa54634a2007-07-06 22:07:22 +0000144 <td>Bitcode JIT Compiler</td></tr>
Reid Spencerb1454872004-10-31 23:24:31 +0000145 <tr><td>LLVMExecutionEngine</td><td><tt>.o</tt></td>
146 <td>Virtual machine engine</td></tr>
Chris Lattner524ee2b2004-02-27 06:28:34 +0000147</table>
148</div>
Reid Spencer0d6d8d02004-10-31 23:00:25 +0000149
Chris Lattner524ee2b2004-02-27 06:28:34 +0000150<!-- ======================================================================= -->
Reid Spencera16d6502006-08-01 07:32:01 +0000151<div class="doc_section"><a name="dependencies"></a>Using llvm-config</div>
Reid Spencer72767f62004-12-30 23:12:04 +0000152<div class="doc_text">
Reid Spencer738cb2a2006-08-01 16:23:54 +0000153 <p>The <tt>llvm-config</tt> tool is a perl script that produces on its output
Reid Spencera16d6502006-08-01 07:32:01 +0000154 various kinds of information. For example, the source or object directories
155 used to build LLVM can be accessed by passing options to <tt>llvm-config</tt>.
156 For complete details on this tool, please see the
157 <a href="CommandGuide/html/llvm-config.html">manual page</a>.</p>
158 <p>To understand the relationships between libraries, the <tt>llvm-config</tt>
159 can be very useful. If all you know is that you want certain libraries to
160 be available, you can generate the complete set of libraries to link with
161 using one of four options, as below:</p>
162 <ol>
163 <li><tt>--ldflags</tt>. This generates the command line options necessary to
164 be passed to the <tt>ld</tt> tool in order to link with LLVM. Most notably,
165 the <tt>-L</tt> option is provided to specify a library search directory
Reid Spencer738cb2a2006-08-01 16:23:54 +0000166 that contains the LLVM libraries.</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000167 <li><tt>--libs</tt>. This generates command line options suitable for
168 use with a gcc-style linker. That is, libraries are given with a -l option
169 and object files are given with a full path.</li>
170 <li><tt>--libnames</tt>. This generates a list of just the library file
171 names. If you know the directory in which these files reside (see --ldflags)
172 then you can find the libraries there.</li>
Reid Spencer738cb2a2006-08-01 16:23:54 +0000173 <li><tt>--libfiles</tt>. This generates the full path names of the
174 LLVM library files.</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000175 </ol>
176 <p>If you wish to delve further into how <tt>llvm-config</tt> generates the
177 correct order (based on library dependencies), please see the tool named
178 <tt>GenLibDeps.pl</tt> in the <tt>utils</tt> source directory of LLVM.</p>
179
Reid Spencer72767f62004-12-30 23:12:04 +0000180 <!-- =======NOTE: =========================================================-->
Reid Spencerf309b442005-01-03 05:46:46 +0000181 <!-- === The following graphs and <dl> list are generated automatically ===-->
182 <!-- === by the util named GenLibDeps.pl in the llvm/utils directory. ===-->
183 <!-- === This should be updated whenever new libraries are added, ===-->
184 <!-- === removed, or changed ===-->
Reid Spencer72767f62004-12-30 23:12:04 +0000185 <!-- =======NOTE: =========================================================-->
Reid Spencerf309b442005-01-03 05:46:46 +0000186 <h2>Dependency Relationships Of Libraries</h2>
187 <p>This graph shows the dependency of archive libraries on other archive
188 libraries or objects. Where a library has both archive and object forms, only
189 the archive form is shown.</p>
190 <img src="img/libdeps.gif" alt="Library Dependencies"/>
191 <h2>Dependency Relationships Of Object Files</h2>
192 <p>This graph shows the dependency of object files on archive libraries or
193 other objects. Where a library has both object and archive forms, only the
194 dependency to the archive form is shown.</p>
195 <img src="img/objdeps.gif" alt="Object File Dependencies"/>
196 <p>The following list shows the dependency relationships between libraries in
197 textual form. The information is the same as shown on the graphs but arranged
198 alphabetically.</p>
Reid Spencer72767f62004-12-30 23:12:04 +0000199<dl>
Dan Gohman2ed27532008-10-14 17:00:38 +0000200 <dt><b>libLLVMAnalysis.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000201 <li>libLLVMCore.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000202 <li>libLLVMSupport.a</li>
203 <li>libLLVMSystem.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000204 <li>libLLVMTarget.a</li>
205 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000206 <dt><b>libLLVMArchive.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000207 <li>libLLVMBCReader.a</li>
208 <li>libLLVMCore.a</li>
209 <li>libLLVMSupport.a</li>
210 <li>libLLVMSystem.a</li>
211 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000212 <dt><b>libLLVMAsmParser.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000213 <li>libLLVMCore.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000214 <li>libLLVMSystem.a</li>
215 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000216 <dt><b>libLLVMBCReader.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000217 <li>libLLVMCore.a</li>
218 <li>libLLVMSupport.a</li>
219 <li>libLLVMSystem.a</li>
220 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000221 <dt><b>libLLVMBCWriter.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000222 <li>libLLVMCore.a</li>
223 <li>libLLVMSupport.a</li>
224 <li>libLLVMSystem.a</li>
225 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000226 <dt><b>libLLVMCodeGen.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000227 <li>libLLVMAnalysis.a</li>
228 <li>libLLVMCore.a</li>
Reid Spencerf9eabff2007-02-04 00:17:35 +0000229 <li>libLLVMScalarOpts.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000230 <li>libLLVMSupport.a</li>
231 <li>libLLVMSystem.a</li>
232 <li>libLLVMTarget.a</li>
Reid Spencerf9eabff2007-02-04 00:17:35 +0000233 <li>libLLVMTransformUtils.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000234 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000235 <dt><b>libLLVMCore.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000236 <li>libLLVMSupport.a</li>
237 <li>libLLVMSystem.a</li>
238 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000239 <dt><b>libLLVMDebugger.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000240 <li>libLLVMBCReader.a</li>
241 <li>libLLVMCore.a</li>
242 <li>libLLVMSupport.a</li>
243 <li>libLLVMSystem.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000244 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000245 <dt><b>libLLVMInstrumentation.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000246 <li>libLLVMCore.a</li>
Reid Spencer70de6062006-05-13 02:22:01 +0000247 <li>libLLVMScalarOpts.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000248 <li>libLLVMSupport.a</li>
249 <li>libLLVMTransformUtils.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000250 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000251 <dt><b>libLLVMLinker.a</b></dt><dd><ul>
Reid Spencer72767f62004-12-30 23:12:04 +0000252 <li>libLLVMArchive.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000253 <li>libLLVMBCReader.a</li>
254 <li>libLLVMCore.a</li>
Reid Spencerf9eabff2007-02-04 00:17:35 +0000255 <li>libLLVMSupport.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000256 <li>libLLVMSystem.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000257 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000258 <dt><b>libLLVMScalarOpts.a</b></dt><dd><ul>
Reid Spencer72767f62004-12-30 23:12:04 +0000259 <li>libLLVMAnalysis.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000260 <li>libLLVMCore.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000261 <li>libLLVMSupport.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000262 <li>libLLVMSystem.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000263 <li>libLLVMTarget.a</li>
264 <li>libLLVMTransformUtils.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000265 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000266 <dt><b>libLLVMSelectionDAG.a</b></dt><dd><ul>
Reid Spencerf9eabff2007-02-04 00:17:35 +0000267 <li>libLLVMAnalysis.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000268 <li>libLLVMCodeGen.a</li>
269 <li>libLLVMCore.a</li>
270 <li>libLLVMSupport.a</li>
271 <li>libLLVMSystem.a</li>
272 <li>libLLVMTarget.a</li>
273 <li>libLLVMTransformUtils.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000274 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000275 <dt><b>libLLVMSupport.a</b></dt><dd><ul>
Reid Spencer72767f62004-12-30 23:12:04 +0000276 <li>libLLVMSystem.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000277 <li>libLLVMbzip2.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000278 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000279 <dt><b>libLLVMSystem.a</b></dt><dd><ul>
Reid Spencerf9eabff2007-02-04 00:17:35 +0000280 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000281 <dt><b>libLLVMTarget.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000282 <li>libLLVMCore.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000283 <li>libLLVMSupport.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000284 <li>libLLVMSystem.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000285 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000286 <dt><b>libLLVMTransformUtils.a</b></dt><dd><ul>
Reid Spencer72767f62004-12-30 23:12:04 +0000287 <li>libLLVMAnalysis.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000288 <li>libLLVMCore.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000289 <li>libLLVMSupport.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000290 <li>libLLVMSystem.a</li>
Reid Spencerf9eabff2007-02-04 00:17:35 +0000291 <li>libLLVMTarget.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000292 <li>libLLVMipa.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000293 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000294 <dt><b>libLLVMbzip2.a</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000295 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000296 <dt><b>libLLVMipa.a</b></dt><dd><ul>
Reid Spencer72767f62004-12-30 23:12:04 +0000297 <li>libLLVMAnalysis.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000298 <li>libLLVMCore.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000299 <li>libLLVMSupport.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000300 <li>libLLVMSystem.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000301 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000302 <dt><b>libLLVMipo.a</b></dt><dd><ul>
Reid Spencer72767f62004-12-30 23:12:04 +0000303 <li>libLLVMAnalysis.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000304 <li>libLLVMCore.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000305 <li>libLLVMSupport.a</li>
306 <li>libLLVMSystem.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000307 <li>libLLVMTarget.a</li>
308 <li>libLLVMTransformUtils.a</li>
309 <li>libLLVMipa.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000310 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000311 <dt><b>libLLVMlto.a</b></dt><dd><ul>
Reid Spencerf9eabff2007-02-04 00:17:35 +0000312 <li>libLLVMAnalysis.a</li>
313 <li>libLLVMBCReader.a</li>
314 <li>libLLVMBCWriter.a</li>
315 <li>libLLVMCore.a</li>
316 <li>libLLVMLinker.a</li>
317 <li>libLLVMScalarOpts.a</li>
318 <li>libLLVMSupport.a</li>
319 <li>libLLVMSystem.a</li>
320 <li>libLLVMTarget.a</li>
321 <li>libLLVMipa.a</li>
322 <li>libLLVMipo.a</li>
323 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000324 <dt><b>LLVMARM.o</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000325 <li>libLLVMCodeGen.a</li>
326 <li>libLLVMCore.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000327 <li>libLLVMSelectionDAG.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000328 <li>libLLVMSupport.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000329 <li>libLLVMSystem.a</li>
330 <li>libLLVMTarget.a</li>
331 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000332 <dt><b>LLVMAlpha.o</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000333 <li>libLLVMCodeGen.a</li>
334 <li>libLLVMCore.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000335 <li>libLLVMSelectionDAG.a</li>
336 <li>libLLVMSupport.a</li>
337 <li>libLLVMSystem.a</li>
338 <li>libLLVMTarget.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000339 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000340 <dt><b>LLVMCBackend.o</b></dt><dd><ul>
Reid Spencer72767f62004-12-30 23:12:04 +0000341 <li>libLLVMAnalysis.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000342 <li>libLLVMCodeGen.a</li>
343 <li>libLLVMCore.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000344 <li>libLLVMScalarOpts.a</li>
345 <li>libLLVMSupport.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000346 <li>libLLVMSystem.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000347 <li>libLLVMTarget.a</li>
Reid Spencerf9eabff2007-02-04 00:17:35 +0000348 <li>libLLVMTransformUtils.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000349 <li>libLLVMipa.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000350 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000351 <dt><b>LLVMExecutionEngine.o</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000352 <li>libLLVMCore.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000353 <li>libLLVMSupport.a</li>
354 <li>libLLVMSystem.a</li>
355 <li>libLLVMTarget.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000356 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000357 <dt><b>LLVMInterpreter.o</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000358 <li>LLVMExecutionEngine.o</li>
Reid Spencerf9eabff2007-02-04 00:17:35 +0000359 <li>libLLVMCodeGen.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000360 <li>libLLVMCore.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000361 <li>libLLVMSupport.a</li>
362 <li>libLLVMSystem.a</li>
363 <li>libLLVMTarget.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000364 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000365 <dt><b>LLVMJIT.o</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000366 <li>LLVMExecutionEngine.o</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000367 <li>libLLVMCore.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000368 <li>libLLVMSupport.a</li>
369 <li>libLLVMSystem.a</li>
370 <li>libLLVMTarget.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000371 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000372 <dt><b>LLVMPowerPC.o</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000373 <li>libLLVMCodeGen.a</li>
374 <li>libLLVMCore.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000375 <li>libLLVMSelectionDAG.a</li>
Reid Spencer70de6062006-05-13 02:22:01 +0000376 <li>libLLVMSupport.a</li>
377 <li>libLLVMSystem.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000378 <li>libLLVMTarget.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000379 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000380 <dt><b>LLVMSparc.o</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000381 <li>libLLVMCodeGen.a</li>
382 <li>libLLVMCore.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000383 <li>libLLVMSelectionDAG.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000384 <li>libLLVMSupport.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000385 <li>libLLVMSystem.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000386 <li>libLLVMTarget.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000387 </ul></dd>
Dan Gohman2ed27532008-10-14 17:00:38 +0000388 <dt><b>LLVMX86.o</b></dt><dd><ul>
Reid Spencera16d6502006-08-01 07:32:01 +0000389 <li>libLLVMCodeGen.a</li>
390 <li>libLLVMCore.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000391 <li>libLLVMSelectionDAG.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000392 <li>libLLVMSupport.a</li>
Reid Spencera16d6502006-08-01 07:32:01 +0000393 <li>libLLVMSystem.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000394 <li>libLLVMTarget.a</li>
Reid Spencer72767f62004-12-30 23:12:04 +0000395 </ul></dd>
396</dl>
397</div>
398
399<!-- ======================================================================= -->
Chris Lattner524ee2b2004-02-27 06:28:34 +0000400<div class="doc_section"><a name="rot">Linkage Rules Of Thumb</a></div>
401<div class="doc_text">
402 <p>This section contains various "rules of thumb" about what files you
403 should link into your programs.</p>
404</div>
405<!-- ======================================================================= -->
Misha Brukman26ecf232004-11-08 00:22:22 +0000406<div class="doc_subsection"><a name="always">Always Link LLVMCore, LLVMSupport,
407 and LLVMSystem</a></div>
Chris Lattner524ee2b2004-02-27 06:28:34 +0000408<div class="doc_text">
Reid Spencer47e49e12004-11-08 00:26:32 +0000409 <p>No matter what you do with LLVM, the last three entries in the value of
410 your LLVMLIBS make variable should always be:
411 <tt>LLVMCore LLVMSupport.a LLVMSystem.a</tt>. There are no <tt>LLVM</tt>
412 programs that don't depend on these three.</p>
Chris Lattner524ee2b2004-02-27 06:28:34 +0000413</div>
414<!-- ======================================================================= -->
Reid Spencer0d6d8d02004-10-31 23:00:25 +0000415<div class="doc_subsection"><a name="onlyone">Never link both archive and
416 re-linked library</a></div>
Chris Lattner524ee2b2004-02-27 06:28:34 +0000417<div class="doc_text">
Reid Spencer0d6d8d02004-10-31 23:00:25 +0000418 <p>There is never any point to linking both the re-linked (<tt>.o</tt>) and
419 the archive (<tt>.a</tt>) versions of a library. Since the re-linked version
420 includes the entire library, the archive version will not resolve any symbols.
Reid Spencer60ee2a22004-11-08 00:24:43 +0000421 You could even end up with link error if you place the archive version before
Reid Spencer0d6d8d02004-10-31 23:00:25 +0000422 the re-linked version on the linker's command line.</p>
Chris Lattner524ee2b2004-02-27 06:28:34 +0000423</div>
424<!-- ======================================================================= -->
425<hr>
426<div class="doc_footer">
Reid Spencerfea14b52004-11-01 09:19:53 +0000427<address>
428 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
Misha Brukman86242e12008-12-11 17:34:48 +0000429 src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"/></a>
Reid Spencerfea14b52004-11-01 09:19:53 +0000430 <a href="http://validator.w3.org/check/referer"><img
Misha Brukman21a63702008-12-11 18:23:24 +0000431 src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a>
Reid Spencerfea14b52004-11-01 09:19:53 +0000432 <a href="mailto:rspencer@x10sys.com">Reid Spencer</a>
433</address>
Reid Spencerca058542006-03-14 05:39:39 +0000434<a href="http://llvm.org">The LLVM Compiler Infrastructure</a>
Chris Lattner524ee2b2004-02-27 06:28:34 +0000435<br>Last modified: $Date$ </div>
436</body>
437</html>
438<!-- vim: sw=2 ts=2 ai
439-->