Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 1 | <!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 | |
NAKAMURA Takumi | 05d0265 | 2011-04-18 23:59:50 +0000 | [diff] [blame] | 10 | <h1>Advice on Packaging LLVM</h1> |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 11 | <ol> |
| 12 | <li><a href="#overview">Overview</a></li> |
Jeffrey Yasskin | 0ca43f2 | 2010-02-26 18:03:43 +0000 | [diff] [blame] | 13 | <li><a href="#compilation">Compile Flags</a></li> |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 14 | <li><a href="#cxx-features">C++ Features</a></li> |
| 15 | <li><a href="#shared-library">Shared Library</a></li> |
Jeffrey Yasskin | 0ca43f2 | 2010-02-26 18:03:43 +0000 | [diff] [blame] | 16 | <li><a href="#deps">Dependencies</a></li> |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 17 | </ol> |
| 18 | |
| 19 | <!--=========================================================================--> |
NAKAMURA Takumi | 05d0265 | 2011-04-18 23:59:50 +0000 | [diff] [blame] | 20 | <h2><a name="overview">Overview</a></h2> |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 21 | <!--=========================================================================--> |
NAKAMURA Takumi | f5af6ad | 2011-04-23 00:30:22 +0000 | [diff] [blame] | 22 | <div> |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 23 | |
| 24 | <p>LLVM sets certain default configure options to make sure our developers don't |
| 25 | break things for constrained platforms. These settings are not optimal for most |
Jeffrey Yasskin | 2058a71 | 2010-02-26 22:25:06 +0000 | [diff] [blame] | 26 | desktop systems, and we hope that packagers (e.g., Redhat, Debian, MacPorts, |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 27 | etc.) will tweak them. This document lists settings we suggest you tweak. |
| 28 | </p> |
Jeffrey Yasskin | 0ca43f2 | 2010-02-26 18:03:43 +0000 | [diff] [blame] | 29 | |
| 30 | <p>LLVM's API changes with each release, so users are likely to want, for |
| 31 | example, both LLVM-2.6 and LLVM-2.7 installed at the same time to support apps |
| 32 | developed against each. |
| 33 | </p> |
| 34 | </div> |
| 35 | |
| 36 | <!--=========================================================================--> |
NAKAMURA Takumi | 05d0265 | 2011-04-18 23:59:50 +0000 | [diff] [blame] | 37 | <h2><a name="compilation">Compile Flags</a></h2> |
Jeffrey Yasskin | 0ca43f2 | 2010-02-26 18:03:43 +0000 | [diff] [blame] | 38 | <!--=========================================================================--> |
NAKAMURA Takumi | f5af6ad | 2011-04-23 00:30:22 +0000 | [diff] [blame] | 39 | <div> |
Jeffrey Yasskin | 0ca43f2 | 2010-02-26 18:03:43 +0000 | [diff] [blame] | 40 | |
| 41 | <p>LLVM runs much more quickly when it's optimized and assertions are removed. |
| 42 | However, such a build is currently incompatible with users who build without |
| 43 | defining NDEBUG, and the lack of assertions makes it hard to debug problems in |
| 44 | user code. We recommend allowing users to install both optimized and debug |
| 45 | versions 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 Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 65 | </div> |
| 66 | |
| 67 | <!--=========================================================================--> |
NAKAMURA Takumi | 05d0265 | 2011-04-18 23:59:50 +0000 | [diff] [blame] | 68 | <h2><a name="cxx-features">C++ Features</a></h2> |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 69 | <!--=========================================================================--> |
NAKAMURA Takumi | f5af6ad | 2011-04-23 00:30:22 +0000 | [diff] [blame] | 70 | <div> |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 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 |
Jeffrey Yasskin | 3ca304a | 2010-02-26 20:43:33 +0000 | [diff] [blame] | 75 | allow users to build with RTTI enabled and still inherit from LLVM |
| 76 | classes.</dd> |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 77 | </dl> |
| 78 | </div> |
| 79 | |
| 80 | <!--=========================================================================--> |
NAKAMURA Takumi | 05d0265 | 2011-04-18 23:59:50 +0000 | [diff] [blame] | 81 | <h2><a name="shared-library">Shared Library</a></h2> |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 82 | <!--=========================================================================--> |
NAKAMURA Takumi | f5af6ad | 2011-04-23 00:30:22 +0000 | [diff] [blame] | 83 | <div> |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 84 | |
| 85 | <p>Configure with <tt>--enable-shared</tt> to build |
| 86 | <tt>libLLVM-<var>major</var>.<var>minor</var>.(so|dylib)</tt> and link the tools |
| 87 | against it. This saves lots of binary size at the cost of some startup time. |
| 88 | </p> |
| 89 | </div> |
| 90 | |
Jeffrey Yasskin | 0ca43f2 | 2010-02-26 18:03:43 +0000 | [diff] [blame] | 91 | <!--=========================================================================--> |
NAKAMURA Takumi | 05d0265 | 2011-04-18 23:59:50 +0000 | [diff] [blame] | 92 | <h2><a name="deps">Dependencies</a></h2> |
Jeffrey Yasskin | 0ca43f2 | 2010-02-26 18:03:43 +0000 | [diff] [blame] | 93 | <!--=========================================================================--> |
NAKAMURA Takumi | f5af6ad | 2011-04-23 00:30:22 +0000 | [diff] [blame] | 94 | <div> |
Jeffrey Yasskin | 0ca43f2 | 2010-02-26 18:03:43 +0000 | [diff] [blame] | 95 | |
| 96 | <dl> |
| 97 | <dt><tt>--enable-libffi</tt></dt><dd>Depend on <a |
| 98 | href="http://sources.redhat.com/libffi/">libffi</a> to allow the LLVM |
| 99 | interpreter to call external functions.</dd> |
| 100 | <dt><tt>--with-oprofile</tt></dt><dd>Depend on <a |
| 101 | href="http://oprofile.sourceforge.net/doc/devel/index.html">libopagent</a> |
| 102 | (>=version 0.9.4) to let the LLVM JIT tell oprofile about function addresses and |
| 103 | line numbers.</dd> |
| 104 | </dl> |
| 105 | </div> |
| 106 | |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 107 | <!-- *********************************************************************** --> |
| 108 | <hr> |
| 109 | <address> |
| 110 | <a href="http://jigsaw.w3.org/css-validator/check/referer"><img |
| 111 | src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"></a> |
| 112 | <a href="http://validator.w3.org/check/referer"><img |
| 113 | src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a> |
NAKAMURA Takumi | b9a3363 | 2011-04-09 02:13:37 +0000 | [diff] [blame] | 114 | <a href="http://llvm.org/">The LLVM Compiler Infrastructure</a><br> |
Jeffrey Yasskin | 818747c | 2010-02-26 18:07:00 +0000 | [diff] [blame] | 115 | Last modified: $Date$ |
Jeffrey Yasskin | 0c0f4b6 | 2010-02-26 00:54:42 +0000 | [diff] [blame] | 116 | </address> |
| 117 | </body> |
| 118 | </html> |