Advice on Packaging LLVM¶
Overview¶
LLVM sets certain default configure options to make sure our developers don’t break things for constrained platforms. These settings are not optimal for most desktop systems, and we hope that packagers (e.g., Redhat, Debian, MacPorts, etc.) will tweak them. This document lists settings we suggest you tweak.
LLVM’s API changes with each release, so users are likely to want, for example, both LLVM-2.6 and LLVM-2.7 installed at the same time to support apps developed against each.
Compile Flags¶
LLVM runs much more quickly when it’s optimized and assertions are removed.
However, such a build is currently incompatible with users who build without
defining NDEBUG, and the lack of assertions makes it hard to debug problems
in user code.  We recommend allowing users to install both optimized and debug
versions of LLVM in parallel.  The following configure flags are relevant:
- --disable-assertions
- Builds LLVM with - NDEBUGdefined. Changes the LLVM ABI. Also available by setting- DISABLE_ASSERTIONS=0|1in- make’s environment. This defaults to enabled regardless of the optimization setting, but it slows things down.
- --enable-debug-symbols
- Builds LLVM with - -g. Also available by setting- DEBUG_SYMBOLS=0|1in- make’s environment. This defaults to disabled when optimizing, so you should turn it back on to let users debug their programs.
- --enable-optimized
- (For git checkouts) Builds LLVM with - -O2and, by default, turns off debug symbols. Also available by setting- ENABLE_OPTIMIZED=0|1in- make’s environment. This defaults to enabled when not in a checkout.
C++ Features¶
- RTTI
- LLVM disables RTTI by default. Add - REQUIRES_RTTI=1to your environment while running- maketo re-enable it. This will allow users to build with RTTI enabled and still inherit from LLVM classes.
Dependencies¶
- --enable-libffi
- Depend on libffi to allow the LLVM interpreter to call external functions. 
--with-oprofile
Depend on libopagent (>=version 0.9.4) to let the LLVM JIT tell oprofile about function addresses and line numbers.
