| Reid Spencer | cbadf80 | 2004-11-01 09:21:32 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 2 | <html> | 
|  | 3 | <head> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 4 | <title>Using The LLVM Libraries</title> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 5 | <link rel="stylesheet" href="llvm.css" type="text/css"> | 
|  | 6 | </head> | 
|  | 7 | <body> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 8 | <div class="doc_title">Using The LLVM Libraries</div> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 9 | <ol> | 
|  | 10 | <li><a href="#abstract">Abstract</a></li> | 
|  | 11 | <li><a href="#introduction">Introduction</a></li> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 12 | <li><a href="#descriptions">Library Descriptions</a></li> | 
| Reid Spencer | e0f33ae | 2004-12-30 23:12:04 +0000 | [diff] [blame] | 13 | <li><a href="#dependencies">Library Dependencies</a></li> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 14 | <li><a href="#rot">Linkage Rules Of Thumb</a> | 
|  | 15 | <ol> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 16 | <li><a href="#always">Always link LLVMCore, LLVMSupport, LLVMSystem</a> | 
|  | 17 | <li><a href="#onlyone">Never link both archive and re-linked</a> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 18 | </ol> | 
|  | 19 | </li> | 
|  | 20 | </ol> | 
| Chris Lattner | 7911ce2 | 2004-05-23 21:07:27 +0000 | [diff] [blame] | 21 |  | 
|  | 22 | <div class="doc_author"> | 
|  | 23 | <p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 24 | </div> | 
| Chris Lattner | 7911ce2 | 2004-05-23 21:07:27 +0000 | [diff] [blame] | 25 |  | 
| Tanya Lattner | d006d3a | 2006-04-20 04:55:50 +0000 | [diff] [blame^] | 26 | Warning: This document is out of date, please see <a href="CommandGuide/html/llvm-config.html">llvm-config</a> for more information. | 
|  | 27 |  | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 28 | <!-- ======================================================================= --> | 
|  | 29 | <div class="doc_section"><a name="abstract">Abstract</a></div> | 
|  | 30 | <div class="doc_text"> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 31 | <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 Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 38 | </p> | 
|  | 39 | </div> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 40 |  | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 41 | <!-- ======================================================================= --> | 
|  | 42 | <div class="doc_section"> <a name="introduction">Introduction</a></div> | 
|  | 43 | <div class="doc_text"> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 44 | <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 Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 69 | </div> | 
|  | 70 | <!-- ======================================================================= --> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 71 | <div class="doc_section"><a name="descriptions"></a>Library Descriptions</div> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 72 | <div class="doc_text"> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 73 | <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 Spencer | 0a4e8b3 | 2004-11-01 09:22:49 +0000 | [diff] [blame] | 76 | <tr><th colspan="3">Core Libraries</th></tr> | 
| Reid Spencer | 139e166 | 2004-12-31 00:13:14 +0000 | [diff] [blame] | 77 | <tr><td>LLVMArchive</td><td><tt>.a</tt></td> | 
|  | 78 | <td>LLVM archive reading and writing</td></tr> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 79 | <tr><td>LLVMAsmParser</td><td><tt>.o</tt></td> | 
| Reid Spencer | 139e166 | 2004-12-31 00:13:14 +0000 | [diff] [blame] | 80 | <td>LLVM assembly parsing</td></tr> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 81 | <tr><td>LLVMBCReader</td><td><tt>.o</tt></td> | 
| Reid Spencer | 139e166 | 2004-12-31 00:13:14 +0000 | [diff] [blame] | 82 | <td>LLVM bytecode reading</td></tr> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 83 | <tr><td>LLVMBCWriter</td><td><tt>.o</tt></td> | 
| Reid Spencer | 139e166 | 2004-12-31 00:13:14 +0000 | [diff] [blame] | 84 | <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 Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 87 | <tr><td>LLVMDebugger</td><td><tt>.o</tt></td> | 
| Reid Spencer | 139e166 | 2004-12-31 00:13:14 +0000 | [diff] [blame] | 88 | <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 Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 91 | <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 Spencer | 139e166 | 2004-12-31 00:13:14 +0000 | [diff] [blame] | 94 | <td>Operating system abstraction layer</td></tr> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 95 |  | 
| Reid Spencer | 0a4e8b3 | 2004-11-01 09:22:49 +0000 | [diff] [blame] | 96 | <tr><th colspan="3">Analysis Libraries</th></tr> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 97 | <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 Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 103 |  | 
| Reid Spencer | 0a4e8b3 | 2004-11-01 09:22:49 +0000 | [diff] [blame] | 104 | <tr><th colspan="3">Transformation Libraries</th></tr> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 105 | <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> | 
|  | 115 | <tr><td>LLVMProfilePaths</td><td><tt>.o</tt></td> | 
|  | 116 | <td>Profile paths for instrumentation.</td></tr> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 117 |  | 
| Reid Spencer | 0a4e8b3 | 2004-11-01 09:22:49 +0000 | [diff] [blame] | 118 | <tr><th colspan="3">Code Generation Libraries </th></tr> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 119 | <tr><td>LLVMCodeGen</td><td><tt>.o</tt></td> | 
|  | 120 | <td>Native code generation infrastructure</td></tr> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 121 |  | 
| Reid Spencer | 0a4e8b3 | 2004-11-01 09:22:49 +0000 | [diff] [blame] | 122 | <tr><th colspan="3">Target Libraries</th></tr> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 123 | <tr><td>LLVMCBackend</td><td><tt>.o</tt></td> | 
|  | 124 | <td>'C' language code generator.</td></tr> | 
|  | 125 | <tr><td>LLVMPowerPC</td><td><tt>.o</tt></td> | 
|  | 126 | <td>PowerPC code generation backend</td></tr> | 
|  | 127 | <tr><td>LLVMSelectionDAG</td><td><tt>.o</tt></td> | 
| Reid Spencer | 139e166 | 2004-12-31 00:13:14 +0000 | [diff] [blame] | 128 | <td>Aggressive instruction selector for directed acyclic graphs.</td></tr> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 129 | <tr><td>LLVMSkeleton</td><td><tt>.a .o</tt></td> | 
|  | 130 | <td>Skeleton for a code generation backend.</td></tr> | 
| Chris Lattner | 029e844 | 2006-02-05 06:40:12 +0000 | [diff] [blame] | 131 | <tr><td>LLVMSparc</td><td><tt>.o</tt></td> | 
|  | 132 | <td>Code generation for Sparc.</td></tr> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 133 | <tr><td>LLVMSparcV9</td><td><tt>.o</tt></td> | 
|  | 134 | <td>Code generation for SparcV9.</td></tr> | 
|  | 135 | <tr><td>LLVMSparcV9RegAlloc</td><td><tt>.a .o</tt></td> | 
|  | 136 | <td>Graph-coloring register allocator for SparcV9.</td></tr> | 
|  | 137 | <tr><td>LLVMSparcV9InstrSched</td><td><tt>.o</tt></td> | 
|  | 138 | <td>Instruction scheduling for SparcV9.</td></tr> | 
|  | 139 | <tr><td>LLVMSparcV9LiveVar</td><td><tt>.o</tt></td> | 
|  | 140 | <td>Live variable analysis SparcV9.</td></tr> | 
|  | 141 | <tr><td>LLVMSparcV9ModuloSched</td><td><tt>.o</tt></td> | 
|  | 142 | <td>Modulo scheduling for SparcV9.</td></tr> | 
|  | 143 | <tr><td>LLVMTarget</td><td><tt>.a .o</tt></td> | 
|  | 144 | <td>Generic code generation utilities.</td></tr> | 
|  | 145 | <tr><td>LLVMX86</td><td><tt>.o</tt></td> | 
|  | 146 | <td>Intel x86 code generation backend</td></tr> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 147 |  | 
| Reid Spencer | 0a4e8b3 | 2004-11-01 09:22:49 +0000 | [diff] [blame] | 148 | <tr><th colspan="3">Runtime Libraries</th></tr> | 
| Reid Spencer | 4148266 | 2004-10-31 23:24:31 +0000 | [diff] [blame] | 149 | <tr><td>LLVMInterpreter</td><td><tt>.o</tt></td> | 
|  | 150 | <td>Bytecode Interpreter</td></tr> | 
|  | 151 | <tr><td>LLVMJIT</td><td><tt>.o</tt></td> | 
|  | 152 | <td>Bytecode JIT Compiler</td></tr> | 
|  | 153 | <tr><td>LLVMExecutionEngine</td><td><tt>.o</tt></td> | 
|  | 154 | <td>Virtual machine engine</td></tr> | 
|  | 155 | <tr><td>LLVMexecve</td><td><tt>.o</tt></td> | 
|  | 156 | <td>execve(2) replacement for llee</td></tr> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 157 | </table> | 
|  | 158 | </div> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 159 |  | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 160 | <!-- ======================================================================= --> | 
| Reid Spencer | e0f33ae | 2004-12-30 23:12:04 +0000 | [diff] [blame] | 161 | <div class="doc_section"><a name="dependencies"></a>Library Dependencies</div> | 
|  | 162 | <div class="doc_text"> | 
| Reid Spencer | 43ff900 | 2005-01-03 05:46:46 +0000 | [diff] [blame] | 163 | <p>Below are two dependency graphs and a list that show the relationships | 
|  | 164 | between the various LLVM archive libraries and object files.  This information | 
|  | 165 | can be automatically generated with the <tt>GenLibDeps.pl</tt> utility found | 
|  | 166 | in the <tt>llvm/utils</tt> directory.</p> | 
| Reid Spencer | e0f33ae | 2004-12-30 23:12:04 +0000 | [diff] [blame] | 167 | <!-- =======NOTE: =========================================================--> | 
| Reid Spencer | 43ff900 | 2005-01-03 05:46:46 +0000 | [diff] [blame] | 168 | <!-- === The following graphs and <dl> list are generated automatically ===--> | 
|  | 169 | <!-- === by the util named GenLibDeps.pl in the llvm/utils directory.   ===--> | 
|  | 170 | <!-- === This should be updated whenever new libraries are added,       ===--> | 
|  | 171 | <!-- === removed, or changed                                            ===--> | 
| Reid Spencer | e0f33ae | 2004-12-30 23:12:04 +0000 | [diff] [blame] | 172 | <!-- =======NOTE: =========================================================--> | 
| Reid Spencer | 43ff900 | 2005-01-03 05:46:46 +0000 | [diff] [blame] | 173 | <h2>Dependency Relationships Of Libraries</h2> | 
|  | 174 | <p>This graph shows the dependency of archive libraries on other archive | 
|  | 175 | libraries or objects. Where a library has both archive and object forms, only | 
|  | 176 | the archive form is shown.</p> | 
|  | 177 | <img src="img/libdeps.gif" alt="Library Dependencies"/> | 
|  | 178 | <h2>Dependency Relationships Of Object Files</h2> | 
|  | 179 | <p>This graph shows the dependency of object files on archive libraries or | 
|  | 180 | other objects. Where a library has both object and archive forms, only the | 
|  | 181 | dependency to the archive form is shown.</p> | 
|  | 182 | <img src="img/objdeps.gif" alt="Object File Dependencies"/> | 
|  | 183 | <p>The following list shows the dependency relationships between libraries in | 
|  | 184 | textual form. The information is the same as shown on the graphs but arranged | 
|  | 185 | alphabetically.</p> | 
| Reid Spencer | e0f33ae | 2004-12-30 23:12:04 +0000 | [diff] [blame] | 186 | <dl> | 
|  | 187 | <dt><b>libLLVMAnalysis.a</b</dt><dd><ul> | 
|  | 188 | <li>libLLVMScalarOpts.a</li> | 
|  | 189 | <li>libLLVMSupport.a</li> | 
|  | 190 | <li>libLLVMTarget.a</li> | 
|  | 191 | <li>libLLVMTransformUtils.a</li> | 
|  | 192 | <li>LLVMCore.o</li> | 
|  | 193 | </ul></dd> | 
|  | 194 | <dt><b>libLLVMArchive.a</b</dt><dd><ul> | 
|  | 195 | <li>libLLVMSupport.a</li> | 
|  | 196 | <li>libLLVMSystem.a</li> | 
|  | 197 | <li>LLVMBCReader.o</li> | 
|  | 198 | </ul></dd> | 
|  | 199 | <dt><b>libLLVMDataStructure.a</b</dt><dd><ul> | 
|  | 200 | <li>libLLVMAnalysis.a</li> | 
|  | 201 | <li>libLLVMSupport.a</li> | 
|  | 202 | <li>libLLVMTarget.a</li> | 
|  | 203 | <li>libLLVMTransformUtils.a</li> | 
|  | 204 | <li>LLVMCore.o</li> | 
|  | 205 | </ul></dd> | 
|  | 206 | <dt><b>libLLVMInstrumentation.a</b</dt><dd><ul> | 
|  | 207 | <li>libLLVMSupport.a</li> | 
|  | 208 | <li>libLLVMTransformUtils.a</li> | 
|  | 209 | <li>LLVMCore.o</li> | 
|  | 210 | </ul></dd> | 
|  | 211 | <dt><b>libLLVMLinker.a</b</dt><dd><ul> | 
|  | 212 | <li>libLLVMArchive.a</li> | 
|  | 213 | <li>libLLVMSystem.a</li> | 
|  | 214 | <li>LLVMBCReader.o</li> | 
|  | 215 | <li>LLVMCore.o</li> | 
|  | 216 | </ul></dd> | 
|  | 217 | <dt><b>libLLVMScalarOpts.a</b</dt><dd><ul> | 
|  | 218 | <li>libLLVMAnalysis.a</li> | 
|  | 219 | <li>libLLVMSupport.a</li> | 
|  | 220 | <li>libLLVMTarget.a</li> | 
|  | 221 | <li>libLLVMTransformUtils.a</li> | 
|  | 222 | <li>LLVMCore.o</li> | 
|  | 223 | </ul></dd> | 
|  | 224 | <dt><b>libLLVMSparcV9RegAlloc.a</b</dt><dd><ul> | 
|  | 225 | <li>libLLVMAnalysis.a</li> | 
|  | 226 | <li>libLLVMSupport.a</li> | 
|  | 227 | <li>LLVMCodeGen.o</li> | 
|  | 228 | <li>LLVMCore.o</li> | 
|  | 229 | <li>LLVMSparcV9LiveVar.o</li> | 
|  | 230 | <li>LLVMSparcV9.o</li> | 
|  | 231 | </ul></dd> | 
|  | 232 | <dt><b>libLLVMSupport.a</b</dt><dd><ul> | 
|  | 233 | <li>libLLVMSystem.a</li> | 
|  | 234 | <li>LLVMbzip2.o</li> | 
|  | 235 | </ul></dd> | 
| Reid Spencer | 43ff900 | 2005-01-03 05:46:46 +0000 | [diff] [blame] | 236 | <dt><b>libLLVMSystem.a</b</dt><dd></dd> | 
| Reid Spencer | e0f33ae | 2004-12-30 23:12:04 +0000 | [diff] [blame] | 237 | <dt><b>libLLVMTarget.a</b</dt><dd><ul> | 
|  | 238 | <li>libLLVMSupport.a</li> | 
|  | 239 | <li>LLVMCore.o</li> | 
|  | 240 | </ul></dd> | 
|  | 241 | <dt><b>libLLVMTransformUtils.a</b</dt><dd><ul> | 
|  | 242 | <li>libLLVMAnalysis.a</li> | 
|  | 243 | <li>libLLVMScalarOpts.a</li> | 
|  | 244 | <li>libLLVMSupport.a</li> | 
|  | 245 | <li>LLVMCore.o</li> | 
|  | 246 | </ul></dd> | 
|  | 247 | <dt><b>libLLVMTransforms.a</b</dt><dd><ul> | 
|  | 248 | <li>libLLVMAnalysis.a</li> | 
|  | 249 | <li>libLLVMSupport.a</li> | 
|  | 250 | <li>libLLVMTarget.a</li> | 
|  | 251 | <li>libLLVMTransformUtils.a</li> | 
|  | 252 | <li>LLVMCore.o</li> | 
|  | 253 | </ul></dd> | 
|  | 254 | <dt><b>libLLVMipa.a</b</dt><dd><ul> | 
|  | 255 | <li>libLLVMAnalysis.a</li> | 
|  | 256 | <li>libLLVMSupport.a</li> | 
|  | 257 | <li>LLVMCore.o</li> | 
|  | 258 | </ul></dd> | 
|  | 259 | <dt><b>libLLVMipo.a</b</dt><dd><ul> | 
|  | 260 | <li>libLLVMAnalysis.a</li> | 
|  | 261 | <li>libLLVMipa.a</li> | 
|  | 262 | <li>libLLVMScalarOpts.a</li> | 
|  | 263 | <li>libLLVMSupport.a</li> | 
|  | 264 | <li>libLLVMTarget.a</li> | 
|  | 265 | <li>libLLVMTransformUtils.a</li> | 
|  | 266 | <li>LLVMCore.o</li> | 
|  | 267 | </ul></dd> | 
|  | 268 | <dt><b>LLVMAnalysis.o</b</dt><dd><ul> | 
|  | 269 | <li>libLLVMScalarOpts.a</li> | 
|  | 270 | <li>libLLVMSupport.a</li> | 
|  | 271 | <li>libLLVMTarget.a</li> | 
|  | 272 | <li>libLLVMTransformUtils.a</li> | 
|  | 273 | <li>LLVMCore.o</li> | 
|  | 274 | </ul></dd> | 
|  | 275 | <dt><b>LLVMAsmParser.o</b</dt><dd><ul> | 
|  | 276 | <li>LLVMCore.o</li> | 
|  | 277 | </ul></dd> | 
|  | 278 | <dt><b>LLVMBCReader.o</b</dt><dd><ul> | 
|  | 279 | <li>libLLVMSupport.a</li> | 
|  | 280 | <li>libLLVMSystem.a</li> | 
|  | 281 | <li>LLVMCore.o</li> | 
|  | 282 | </ul></dd> | 
|  | 283 | <dt><b>LLVMBCWriter.o</b</dt><dd><ul> | 
|  | 284 | <li>libLLVMSupport.a</li> | 
|  | 285 | <li>LLVMCore.o</li> | 
|  | 286 | </ul></dd> | 
|  | 287 | <dt><b>LLVMCBackend.o</b</dt><dd><ul> | 
|  | 288 | <li>libLLVMAnalysis.a</li> | 
|  | 289 | <li>libLLVMipa.a</li> | 
|  | 290 | <li>libLLVMScalarOpts.a</li> | 
|  | 291 | <li>libLLVMSupport.a</li> | 
|  | 292 | <li>libLLVMTarget.a</li> | 
|  | 293 | <li>LLVMCore.o</li> | 
|  | 294 | </ul></dd> | 
|  | 295 | <dt><b>LLVMCodeGen.o</b</dt><dd><ul> | 
|  | 296 | <li>libLLVMAnalysis.a</li> | 
|  | 297 | <li>libLLVMSupport.a</li> | 
|  | 298 | <li>libLLVMTarget.a</li> | 
|  | 299 | <li>LLVMCore.o</li> | 
|  | 300 | </ul></dd> | 
|  | 301 | <dt><b>LLVMCore.o</b</dt><dd><ul> | 
|  | 302 | <li>libLLVMSupport.a</li> | 
|  | 303 | </ul></dd> | 
|  | 304 | <dt><b>LLVMDataStructure.o</b</dt><dd><ul> | 
|  | 305 | <li>libLLVMAnalysis.a</li> | 
|  | 306 | <li>libLLVMSupport.a</li> | 
|  | 307 | <li>libLLVMTarget.a</li> | 
|  | 308 | <li>libLLVMTransformUtils.a</li> | 
|  | 309 | <li>LLVMCore.o</li> | 
|  | 310 | </ul></dd> | 
|  | 311 | <dt><b>LLVMDebugger.o</b</dt><dd><ul> | 
|  | 312 | <li>libLLVMSupport.a</li> | 
|  | 313 | <li>libLLVMSystem.a</li> | 
|  | 314 | <li>LLVMBCReader.o</li> | 
|  | 315 | <li>LLVMCodeGen.o</li> | 
|  | 316 | <li>LLVMCore.o</li> | 
|  | 317 | <li>LLVMExecutionEngine.o</li> | 
|  | 318 | </ul></dd> | 
|  | 319 | <dt><b>LLVMExecutionEngine.o</b</dt><dd><ul> | 
|  | 320 | <li>libLLVMSupport.a</li> | 
|  | 321 | <li>libLLVMSystem.a</li> | 
|  | 322 | <li>libLLVMTarget.a</li> | 
|  | 323 | <li>LLVMCore.o</li> | 
|  | 324 | <li>LLVMInterpreter.o</li> | 
|  | 325 | <li>LLVMJIT.o</li> | 
|  | 326 | </ul></dd> | 
|  | 327 | <dt><b>LLVMInstrumentation.o</b</dt><dd><ul> | 
|  | 328 | <li>libLLVMSupport.a</li> | 
|  | 329 | <li>libLLVMTransformUtils.a</li> | 
|  | 330 | <li>LLVMCore.o</li> | 
|  | 331 | </ul></dd> | 
|  | 332 | <dt><b>LLVMInterpreter.o</b</dt><dd><ul> | 
|  | 333 | <li>libLLVMSupport.a</li> | 
|  | 334 | <li>libLLVMSystem.a</li> | 
|  | 335 | <li>libLLVMTarget.a</li> | 
|  | 336 | <li>LLVMCore.o</li> | 
|  | 337 | <li>LLVMExecutionEngine.o</li> | 
|  | 338 | </ul></dd> | 
|  | 339 | <dt><b>LLVMJIT.o</b</dt><dd><ul> | 
|  | 340 | <li>libLLVMSupport.a</li> | 
|  | 341 | <li>libLLVMSystem.a</li> | 
|  | 342 | <li>libLLVMTarget.a</li> | 
|  | 343 | <li>LLVMCore.o</li> | 
|  | 344 | <li>LLVMExecutionEngine.o</li> | 
|  | 345 | </ul></dd> | 
|  | 346 | <dt><b>LLVMPowerPC.o</b</dt><dd><ul> | 
|  | 347 | <li>libLLVMScalarOpts.a</li> | 
|  | 348 | <li>libLLVMSupport.a</li> | 
|  | 349 | <li>libLLVMTarget.a</li> | 
|  | 350 | <li>LLVMCodeGen.o</li> | 
|  | 351 | <li>LLVMCore.o</li> | 
|  | 352 | </ul></dd> | 
|  | 353 | <dt><b>LLVMProfilePaths.o</b</dt><dd><ul> | 
|  | 354 | <li>libLLVMInstrumentation.a</li> | 
|  | 355 | <li>libLLVMSupport.a</li> | 
|  | 356 | <li>LLVMCore.o</li> | 
|  | 357 | </ul></dd> | 
|  | 358 | <dt><b>LLVMScalarOpts.o</b</dt><dd><ul> | 
|  | 359 | <li>libLLVMAnalysis.a</li> | 
|  | 360 | <li>libLLVMSupport.a</li> | 
|  | 361 | <li>libLLVMTarget.a</li> | 
|  | 362 | <li>libLLVMTransformUtils.a</li> | 
|  | 363 | <li>LLVMCore.o</li> | 
|  | 364 | </ul></dd> | 
|  | 365 | <dt><b>LLVMSelectionDAG.o</b</dt><dd><ul> | 
|  | 366 | <li>LLVMCodeGen.o</li> | 
|  | 367 | <li>LLVMCore.o</li> | 
|  | 368 | </ul></dd> | 
|  | 369 | <dt><b>LLVMSkeleton.o</b</dt><dd><ul> | 
|  | 370 | <li>libLLVMTarget.a</li> | 
|  | 371 | <li>LLVMCodeGen.o</li> | 
|  | 372 | <li>LLVMCore.o</li> | 
|  | 373 | </ul></dd> | 
| Chris Lattner | 029e844 | 2006-02-05 06:40:12 +0000 | [diff] [blame] | 374 | <dt><b>LLVMSparc.o</b</dt><dd><ul> | 
| Reid Spencer | e0f33ae | 2004-12-30 23:12:04 +0000 | [diff] [blame] | 375 | <li>libLLVMScalarOpts.a</li> | 
|  | 376 | <li>libLLVMSupport.a</li> | 
|  | 377 | <li>libLLVMTarget.a</li> | 
|  | 378 | <li>LLVMCodeGen.o</li> | 
|  | 379 | <li>LLVMCore.o</li> | 
|  | 380 | </ul></dd> | 
|  | 381 | <dt><b>LLVMSparcV9.o</b</dt><dd><ul> | 
|  | 382 | <li>libLLVMScalarOpts.a</li> | 
|  | 383 | <li>libLLVMSparcV9RegAlloc.a</li> | 
|  | 384 | <li>libLLVMSupport.a</li> | 
|  | 385 | <li>libLLVMTarget.a</li> | 
|  | 386 | <li>LLVMBCWriter.o</li> | 
|  | 387 | <li>LLVMCodeGen.o</li> | 
|  | 388 | <li>LLVMCore.o</li> | 
|  | 389 | <li>LLVMSparcV9InstrSched.o</li> | 
|  | 390 | <li>LLVMSparcV9ModuloSched.o</li> | 
|  | 391 | </ul></dd> | 
|  | 392 | <dt><b>LLVMSparcV9InstrSched.o</b</dt><dd><ul> | 
|  | 393 | <li>libLLVMSupport.a</li> | 
|  | 394 | <li>LLVMCodeGen.o</li> | 
|  | 395 | <li>LLVMCore.o</li> | 
|  | 396 | <li>LLVMSparcV9LiveVar.o</li> | 
|  | 397 | <li>LLVMSparcV9.o</li> | 
|  | 398 | </ul></dd> | 
|  | 399 | <dt><b>LLVMSparcV9LiveVar.o</b</dt><dd><ul> | 
|  | 400 | <li>libLLVMSupport.a</li> | 
|  | 401 | <li>LLVMCodeGen.o</li> | 
|  | 402 | <li>LLVMCore.o</li> | 
|  | 403 | </ul></dd> | 
|  | 404 | <dt><b>LLVMSparcV9ModuloSched.o</b</dt><dd><ul> | 
|  | 405 | <li>libLLVMSupport.a</li> | 
|  | 406 | <li>libLLVMTarget.a</li> | 
|  | 407 | <li>LLVMCodeGen.o</li> | 
|  | 408 | <li>LLVMCore.o</li> | 
|  | 409 | <li>LLVMSparcV9.o</li> | 
|  | 410 | </ul></dd> | 
|  | 411 | <dt><b>LLVMSparcV9RegAlloc.o</b</dt><dd><ul> | 
|  | 412 | <li>libLLVMAnalysis.a</li> | 
|  | 413 | <li>libLLVMSupport.a</li> | 
|  | 414 | <li>LLVMCodeGen.o</li> | 
|  | 415 | <li>LLVMCore.o</li> | 
|  | 416 | <li>LLVMSparcV9LiveVar.o</li> | 
|  | 417 | <li>LLVMSparcV9.o</li> | 
|  | 418 | </ul></dd> | 
|  | 419 | <dt><b>LLVMSupport.o</b</dt><dd><ul> | 
|  | 420 | <li>libLLVMSystem.a</li> | 
|  | 421 | <li>LLVMbzip2.o</li> | 
|  | 422 | </ul></dd> | 
| Reid Spencer | 43ff900 | 2005-01-03 05:46:46 +0000 | [diff] [blame] | 423 | <dt><b>LLVMSystem.o</b</dt><dd></dd> | 
| Reid Spencer | e0f33ae | 2004-12-30 23:12:04 +0000 | [diff] [blame] | 424 | <dt><b>LLVMTarget.o</b</dt><dd><ul> | 
|  | 425 | <li>libLLVMSupport.a</li> | 
|  | 426 | <li>LLVMCore.o</li> | 
|  | 427 | </ul></dd> | 
|  | 428 | <dt><b>LLVMTransformUtils.o</b</dt><dd><ul> | 
|  | 429 | <li>libLLVMAnalysis.a</li> | 
|  | 430 | <li>libLLVMScalarOpts.a</li> | 
|  | 431 | <li>libLLVMSupport.a</li> | 
|  | 432 | <li>LLVMCore.o</li> | 
|  | 433 | </ul></dd> | 
|  | 434 | <dt><b>LLVMTransforms.o</b</dt><dd><ul> | 
|  | 435 | <li>libLLVMAnalysis.a</li> | 
|  | 436 | <li>libLLVMSupport.a</li> | 
|  | 437 | <li>libLLVMTarget.a</li> | 
|  | 438 | <li>libLLVMTransformUtils.a</li> | 
|  | 439 | <li>LLVMCore.o</li> | 
|  | 440 | </ul></dd> | 
|  | 441 | <dt><b>LLVMX86.o</b</dt><dd><ul> | 
|  | 442 | <li>libLLVMScalarOpts.a</li> | 
|  | 443 | <li>libLLVMSupport.a</li> | 
|  | 444 | <li>libLLVMTarget.a</li> | 
|  | 445 | <li>LLVMCodeGen.o</li> | 
|  | 446 | <li>LLVMCore.o</li> | 
|  | 447 | </ul></dd> | 
| Reid Spencer | 43ff900 | 2005-01-03 05:46:46 +0000 | [diff] [blame] | 448 | <dt><b>LLVMbzip2.o</b</dt><dd></dd> | 
| Reid Spencer | e0f33ae | 2004-12-30 23:12:04 +0000 | [diff] [blame] | 449 | <dt><b>LLVMipa.o</b</dt><dd><ul> | 
|  | 450 | <li>libLLVMAnalysis.a</li> | 
|  | 451 | <li>libLLVMSupport.a</li> | 
|  | 452 | <li>LLVMCore.o</li> | 
|  | 453 | </ul></dd> | 
|  | 454 | <dt><b>LLVMipo.o</b</dt><dd><ul> | 
|  | 455 | <li>libLLVMAnalysis.a</li> | 
|  | 456 | <li>libLLVMipa.a</li> | 
|  | 457 | <li>libLLVMScalarOpts.a</li> | 
|  | 458 | <li>libLLVMSupport.a</li> | 
|  | 459 | <li>libLLVMTarget.a</li> | 
|  | 460 | <li>libLLVMTransformUtils.a</li> | 
|  | 461 | <li>LLVMCore.o</li> | 
|  | 462 | </ul></dd> | 
|  | 463 | </dl> | 
|  | 464 | </div> | 
|  | 465 |  | 
|  | 466 | <!-- ======================================================================= --> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 467 | <div class="doc_section"><a name="rot">Linkage Rules Of Thumb</a></div> | 
|  | 468 | <div class="doc_text"> | 
|  | 469 | <p>This section contains various "rules of thumb" about what files you | 
|  | 470 | should link into your programs.</p> | 
|  | 471 | </div> | 
|  | 472 | <!-- ======================================================================= --> | 
| Misha Brukman | 6fb5166 | 2004-11-08 00:22:22 +0000 | [diff] [blame] | 473 | <div class="doc_subsection"><a name="always">Always Link LLVMCore, LLVMSupport, | 
|  | 474 | and LLVMSystem</a></div> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 475 | <div class="doc_text"> | 
| Reid Spencer | 52afa7e | 2004-11-08 00:26:32 +0000 | [diff] [blame] | 476 | <p>No matter what you do with LLVM, the last three entries in the value of | 
|  | 477 | your LLVMLIBS make variable should always be: | 
|  | 478 | <tt>LLVMCore LLVMSupport.a LLVMSystem.a</tt>. There are no <tt>LLVM</tt> | 
|  | 479 | programs that don't depend on these three.</p> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 480 | </div> | 
|  | 481 | <!-- ======================================================================= --> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 482 | <div class="doc_subsection"><a name="onlyone">Never link both archive and | 
|  | 483 | re-linked library</a></div> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 484 | <div class="doc_text"> | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 485 | <p>There is never any point to linking both the re-linked (<tt>.o</tt>) and | 
|  | 486 | the archive (<tt>.a</tt>) versions of a library. Since the re-linked version | 
|  | 487 | includes the entire library, the archive version will not resolve any symbols. | 
| Reid Spencer | 347e288 | 2004-11-08 00:24:43 +0000 | [diff] [blame] | 488 | You could even end up with link error if you place the archive version before | 
| Reid Spencer | 341d714 | 2004-10-31 23:00:25 +0000 | [diff] [blame] | 489 | the re-linked version on the linker's command line.</p> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 490 | </div> | 
|  | 491 | <!-- ======================================================================= --> | 
|  | 492 | <hr> | 
|  | 493 | <div class="doc_footer"> | 
| Reid Spencer | bd72241 | 2004-11-01 09:19:53 +0000 | [diff] [blame] | 494 | <address> | 
|  | 495 | <a href="http://jigsaw.w3.org/css-validator/check/referer"><img | 
|  | 496 | src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"/></a> | 
|  | 497 | <a href="http://validator.w3.org/check/referer"><img | 
|  | 498 | src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a> | 
|  | 499 | <a href="mailto:rspencer@x10sys.com">Reid Spencer</a> | 
|  | 500 | </address> | 
| Reid Spencer | 05fe4b0 | 2006-03-14 05:39:39 +0000 | [diff] [blame] | 501 | <a href="http://llvm.org">The LLVM Compiler Infrastructure</a> | 
| Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 502 | <br>Last modified: $Date$ </div> | 
|  | 503 | </body> | 
|  | 504 | </html> | 
|  | 505 | <!-- vim: sw=2 ts=2 ai | 
|  | 506 | --> |