1*f4a2713aSLionel Sambuc======================== 2*f4a2713aSLionel SambucAdvice on Packaging LLVM 3*f4a2713aSLionel Sambuc======================== 4*f4a2713aSLionel Sambuc 5*f4a2713aSLionel Sambuc.. contents:: 6*f4a2713aSLionel Sambuc :local: 7*f4a2713aSLionel Sambuc 8*f4a2713aSLionel SambucOverview 9*f4a2713aSLionel Sambuc======== 10*f4a2713aSLionel Sambuc 11*f4a2713aSLionel SambucLLVM sets certain default configure options to make sure our developers don't 12*f4a2713aSLionel Sambucbreak things for constrained platforms. These settings are not optimal for most 13*f4a2713aSLionel Sambucdesktop systems, and we hope that packagers (e.g., Redhat, Debian, MacPorts, 14*f4a2713aSLionel Sambucetc.) will tweak them. This document lists settings we suggest you tweak. 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel SambucLLVM's API changes with each release, so users are likely to want, for example, 17*f4a2713aSLionel Sambucboth LLVM-2.6 and LLVM-2.7 installed at the same time to support apps developed 18*f4a2713aSLionel Sambucagainst each. 19*f4a2713aSLionel Sambuc 20*f4a2713aSLionel SambucCompile Flags 21*f4a2713aSLionel Sambuc============= 22*f4a2713aSLionel Sambuc 23*f4a2713aSLionel SambucLLVM runs much more quickly when it's optimized and assertions are removed. 24*f4a2713aSLionel SambucHowever, such a build is currently incompatible with users who build without 25*f4a2713aSLionel Sambucdefining ``NDEBUG``, and the lack of assertions makes it hard to debug problems 26*f4a2713aSLionel Sambucin user code. We recommend allowing users to install both optimized and debug 27*f4a2713aSLionel Sambucversions of LLVM in parallel. The following configure flags are relevant: 28*f4a2713aSLionel Sambuc 29*f4a2713aSLionel Sambuc``--disable-assertions`` 30*f4a2713aSLionel Sambuc Builds LLVM with ``NDEBUG`` defined. Changes the LLVM ABI. Also available 31*f4a2713aSLionel Sambuc by setting ``DISABLE_ASSERTIONS=0|1`` in ``make``'s environment. This 32*f4a2713aSLionel Sambuc defaults to enabled regardless of the optimization setting, but it slows 33*f4a2713aSLionel Sambuc things down. 34*f4a2713aSLionel Sambuc 35*f4a2713aSLionel Sambuc``--enable-debug-symbols`` 36*f4a2713aSLionel Sambuc Builds LLVM with ``-g``. Also available by setting ``DEBUG_SYMBOLS=0|1`` in 37*f4a2713aSLionel Sambuc ``make``'s environment. This defaults to disabled when optimizing, so you 38*f4a2713aSLionel Sambuc should turn it back on to let users debug their programs. 39*f4a2713aSLionel Sambuc 40*f4a2713aSLionel Sambuc``--enable-optimized`` 41*f4a2713aSLionel Sambuc (For svn checkouts) Builds LLVM with ``-O2`` and, by default, turns off 42*f4a2713aSLionel Sambuc debug symbols. Also available by setting ``ENABLE_OPTIMIZED=0|1`` in 43*f4a2713aSLionel Sambuc ``make``'s environment. This defaults to enabled when not in a 44*f4a2713aSLionel Sambuc checkout. 45*f4a2713aSLionel Sambuc 46*f4a2713aSLionel SambucC++ Features 47*f4a2713aSLionel Sambuc============ 48*f4a2713aSLionel Sambuc 49*f4a2713aSLionel SambucRTTI 50*f4a2713aSLionel Sambuc LLVM disables RTTI by default. Add ``REQUIRES_RTTI=1`` to your environment 51*f4a2713aSLionel Sambuc while running ``make`` to re-enable it. This will allow users to build with 52*f4a2713aSLionel Sambuc RTTI enabled and still inherit from LLVM classes. 53*f4a2713aSLionel Sambuc 54*f4a2713aSLionel SambucShared Library 55*f4a2713aSLionel Sambuc============== 56*f4a2713aSLionel Sambuc 57*f4a2713aSLionel SambucConfigure with ``--enable-shared`` to build 58*f4a2713aSLionel Sambuc``libLLVM-<major>.<minor>.(so|dylib)`` and link the tools against it. This 59*f4a2713aSLionel Sambucsaves lots of binary size at the cost of some startup time. 60*f4a2713aSLionel Sambuc 61*f4a2713aSLionel SambucDependencies 62*f4a2713aSLionel Sambuc============ 63*f4a2713aSLionel Sambuc 64*f4a2713aSLionel Sambuc``--enable-libffi`` 65*f4a2713aSLionel Sambuc Depend on `libffi <http://sources.redhat.com/libffi/>`_ to allow the LLVM 66*f4a2713aSLionel Sambuc interpreter to call external functions. 67*f4a2713aSLionel Sambuc 68*f4a2713aSLionel Sambuc``--with-oprofile`` 69*f4a2713aSLionel Sambuc 70*f4a2713aSLionel Sambuc Depend on `libopagent 71*f4a2713aSLionel Sambuc <http://oprofile.sourceforge.net/doc/devel/index.html>`_ (>=version 0.9.4) 72*f4a2713aSLionel Sambuc to let the LLVM JIT tell oprofile about function addresses and line 73*f4a2713aSLionel Sambuc numbers. 74