blob: 2d6d0861826b071a0d5f6c4adef3e9bd3d4da576 [file] [log] [blame]
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3<html>
4<head>
5 <title>Advice on Packaging LLVM</title>
6 <link rel="stylesheet" href="llvm.css" type="text/css">
7</head>
8<body>
9
10<div class="doc_title">Advice on Packaging LLVM</div>
11<ol>
12 <li><a href="#overview">Overview</a></li>
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000013 <li><a href="#compilation">Compile Flags</a></li>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000014 <li><a href="#cxx-features">C++ Features</a></li>
15 <li><a href="#shared-library">Shared Library</a></li>
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000016 <li><a href="#deps">Dependencies</a></li>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000017</ol>
18
19<!--=========================================================================-->
20<div class="doc_section"><a name="overview">Overview</a></div>
21<!--=========================================================================-->
22<div class="doc_text">
23
24<p>LLVM sets certain default configure options to make sure our developers don't
25break things for constrained platforms. These settings are not optimal for most
26desktop systems, and we hope that packagers (i.e., Redhat, Debian, MacPorts,
27etc.) will tweak them. This document lists settings we suggest you tweak.
28</p>
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000029
30<p>LLVM's API changes with each release, so users are likely to want, for
31example, both LLVM-2.6 and LLVM-2.7 installed at the same time to support apps
32developed against each.
33</p>
34</div>
35
36<!--=========================================================================-->
37<div class="doc_section"><a name="compilation">Compile Flags</a></div>
38<!--=========================================================================-->
39<div class="doc_text">
40
41<p>LLVM runs much more quickly when it's optimized and assertions are removed.
42However, such a build is currently incompatible with users who build without
43defining NDEBUG, and the lack of assertions makes it hard to debug problems in
44user code. We recommend allowing users to install both optimized and debug
45versions of LLVM in parallel. The following configure flags are relevant:
46</p>
47
48<dl>
49 <dt><tt>--disable-assertions</tt></dt><dd>Builds LLVM with <tt>NDEBUG</tt>
50 defined. Changes the LLVM ABI. Also available by setting
51 <tt>DISABLE_ASSERTIONS=0|1</tt> in <tt>make</tt>'s environment. This defaults
52 to enabled regardless of the optimization setting, but it slows things
53 down.</dd>
54
55 <dt><tt>--enable-debug-symbols</tt></dt><dd>Builds LLVM with <tt>-g</tt>.
56 Also available by setting <tt>DEBUG_SYMBOLS=0|1</tt> in <tt>make</tt>'s
57 environment. This defaults to disabled when optimizing, so you should turn it
58 back on to let users debug their programs.</dd>
59
60 <dt><tt>--enable-optimized</tt></dt><dd>(For svn checkouts) Builds LLVM with
61 <tt>-O2</tt> and, by default, turns off debug symbols. Also available by
62 setting <tt>ENABLE_OPTIMIZED=0|1</tt> in <tt>make</tt>'s environment. This
63 defaults to enabled when not in a checkout.</dd>
64</dl>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000065</div>
66
67<!--=========================================================================-->
68<div class="doc_section"><a name="cxx-features">C++ Features</a></div>
69<!--=========================================================================-->
70<div class="doc_text">
71
72<dl>
73 <dt>RTTI</dt><dd>LLVM disables RTTI by default. Add <tt>REQUIRES_RTTI=1</tt>
74 to your environment while running <tt>make</tt> to re-enable it. This will
75 allow users to build with RTTI enabled and inherit from LLVM classes.</dd>
76 <dt>Exceptions</dt><dd>LLVM disables exceptions by default. Add
77 <tt>REQUIRES_EH=1</tt> to your environment while running <tt>make</tt> to
78 re-enable them. This will allow users to link LLVM and exception-using code.
79 It also re-enables RTTI.</dd>
80</dl>
81</div>
82
83<!--=========================================================================-->
84<div class="doc_section"><a name="shared-library">Shared Library</a></div>
85<!--=========================================================================-->
86<div class="doc_text">
87
88<p>Configure with <tt>--enable-shared</tt> to build
89<tt>libLLVM-<var>major</var>.<var>minor</var>.(so|dylib)</tt> and link the tools
90against it. This saves lots of binary size at the cost of some startup time.
91</p>
92</div>
93
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000094<!--=========================================================================-->
95<div class="doc_section"><a name="deps">Dependencies</a></div>
96<!--=========================================================================-->
97<div class="doc_text">
98
99<dl>
100<dt><tt>--enable-libffi</tt></dt><dd>Depend on <a
101href="http://sources.redhat.com/libffi/">libffi</a> to allow the LLVM
102interpreter to call external functions.</dd>
103<dt><tt>--with-oprofile</tt></dt><dd>Depend on <a
104href="http://oprofile.sourceforge.net/doc/devel/index.html">libopagent</a>
105(>=version 0.9.4) to let the LLVM JIT tell oprofile about function addresses and
106line numbers.</dd>
107</dl>
108</div>
109
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +0000110<!-- *********************************************************************** -->
111<hr>
112<address>
113 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
114 src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"></a>
115 <a href="http://validator.w3.org/check/referer"><img
116 src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a>
117 <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
118 Last modified: $Date: 2009-01-01 23:10:51 -0800 (Thu, 01 Jan 2009) $
119</address>
120</body>
121</html>