blob: ed7cfbefd75dae46c2b6166674650a0591caf311 [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>
NAKAMURA Takumi5c6e4df2011-10-31 11:21:59 +00005 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +00006 <title>Advice on Packaging LLVM</title>
7 <link rel="stylesheet" href="llvm.css" type="text/css">
8</head>
9<body>
10
NAKAMURA Takumi05d02652011-04-18 23:59:50 +000011<h1>Advice on Packaging LLVM</h1>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000012<ol>
13 <li><a href="#overview">Overview</a></li>
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000014 <li><a href="#compilation">Compile Flags</a></li>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000015 <li><a href="#cxx-features">C++ Features</a></li>
16 <li><a href="#shared-library">Shared Library</a></li>
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000017 <li><a href="#deps">Dependencies</a></li>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000018</ol>
19
20<!--=========================================================================-->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +000021<h2><a name="overview">Overview</a></h2>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000022<!--=========================================================================-->
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +000023<div>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000024
25<p>LLVM sets certain default configure options to make sure our developers don't
26break things for constrained platforms. These settings are not optimal for most
Jeffrey Yasskin2058a712010-02-26 22:25:06 +000027desktop systems, and we hope that packagers (e.g., Redhat, Debian, MacPorts,
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000028etc.) will tweak them. This document lists settings we suggest you tweak.
29</p>
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000030
31<p>LLVM's API changes with each release, so users are likely to want, for
32example, both LLVM-2.6 and LLVM-2.7 installed at the same time to support apps
33developed against each.
34</p>
35</div>
36
37<!--=========================================================================-->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +000038<h2><a name="compilation">Compile Flags</a></h2>
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000039<!--=========================================================================-->
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +000040<div>
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000041
42<p>LLVM runs much more quickly when it's optimized and assertions are removed.
43However, such a build is currently incompatible with users who build without
44defining NDEBUG, and the lack of assertions makes it hard to debug problems in
45user code. We recommend allowing users to install both optimized and debug
46versions of LLVM in parallel. The following configure flags are relevant:
47</p>
48
49<dl>
50 <dt><tt>--disable-assertions</tt></dt><dd>Builds LLVM with <tt>NDEBUG</tt>
51 defined. Changes the LLVM ABI. Also available by setting
52 <tt>DISABLE_ASSERTIONS=0|1</tt> in <tt>make</tt>'s environment. This defaults
53 to enabled regardless of the optimization setting, but it slows things
54 down.</dd>
55
56 <dt><tt>--enable-debug-symbols</tt></dt><dd>Builds LLVM with <tt>-g</tt>.
57 Also available by setting <tt>DEBUG_SYMBOLS=0|1</tt> in <tt>make</tt>'s
58 environment. This defaults to disabled when optimizing, so you should turn it
59 back on to let users debug their programs.</dd>
60
61 <dt><tt>--enable-optimized</tt></dt><dd>(For svn checkouts) Builds LLVM with
62 <tt>-O2</tt> and, by default, turns off debug symbols. Also available by
63 setting <tt>ENABLE_OPTIMIZED=0|1</tt> in <tt>make</tt>'s environment. This
64 defaults to enabled when not in a checkout.</dd>
65</dl>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000066</div>
67
68<!--=========================================================================-->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +000069<h2><a name="cxx-features">C++ Features</a></h2>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000070<!--=========================================================================-->
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +000071<div>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000072
73<dl>
74 <dt>RTTI</dt><dd>LLVM disables RTTI by default. Add <tt>REQUIRES_RTTI=1</tt>
75 to your environment while running <tt>make</tt> to re-enable it. This will
Jeffrey Yasskin3ca304a2010-02-26 20:43:33 +000076 allow users to build with RTTI enabled and still inherit from LLVM
77 classes.</dd>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000078</dl>
79</div>
80
81<!--=========================================================================-->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +000082<h2><a name="shared-library">Shared Library</a></h2>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000083<!--=========================================================================-->
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +000084<div>
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +000085
86<p>Configure with <tt>--enable-shared</tt> to build
87<tt>libLLVM-<var>major</var>.<var>minor</var>.(so|dylib)</tt> and link the tools
88against it. This saves lots of binary size at the cost of some startup time.
89</p>
90</div>
91
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000092<!--=========================================================================-->
NAKAMURA Takumi05d02652011-04-18 23:59:50 +000093<h2><a name="deps">Dependencies</a></h2>
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000094<!--=========================================================================-->
NAKAMURA Takumif5af6ad2011-04-23 00:30:22 +000095<div>
Jeffrey Yasskin0ca43f22010-02-26 18:03:43 +000096
97<dl>
98<dt><tt>--enable-libffi</tt></dt><dd>Depend on <a
99href="http://sources.redhat.com/libffi/">libffi</a> to allow the LLVM
100interpreter to call external functions.</dd>
101<dt><tt>--with-oprofile</tt></dt><dd>Depend on <a
102href="http://oprofile.sourceforge.net/doc/devel/index.html">libopagent</a>
103(>=version 0.9.4) to let the LLVM JIT tell oprofile about function addresses and
104line numbers.</dd>
105</dl>
106</div>
107
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +0000108<!-- *********************************************************************** -->
109<hr>
110<address>
111 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
112 src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"></a>
113 <a href="http://validator.w3.org/check/referer"><img
114 src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a>
NAKAMURA Takumib9a33632011-04-09 02:13:37 +0000115 <a href="http://llvm.org/">The LLVM Compiler Infrastructure</a><br>
Jeffrey Yasskin818747c2010-02-26 18:07:00 +0000116 Last modified: $Date$
Jeffrey Yasskin0c0f4b62010-02-26 00:54:42 +0000117</address>
118</body>
119</html>