Introduction to LLVM

The LLVM package contains a collection of modular and reusable compiler and toolchain technologies. The Low Level Virtual Machine (LLVM) Core libraries provide a modern source and target-independent optimizer, along with code generation support for many popular CPUs (as well as some less common ones!). These libraries are built around a well specified code representation known as the LLVM intermediate representation ("LLVM IR").

The optional Clang and Compiler RT packages provide a new C, C++, Objective C and Objective C++ front-ends and runtime libraries for the LLVM.

This package is known to build and work properly using an LFS-7.6 systemd platform.

Package Information

  • Download (HTTP): http://llvm.org/releases/3.5.0/llvm-3.5.0.src.tar.gz

  • Download MD5 sum: d6987305a1a0e58e128c1374cd3b8fef

  • Download size: 12 MB

  • Estimated disk space required: 707 MB (1.3 GB with Clang) (11.4 GB with Clang and documentation)

  • Estimated build time: 32 SBU (57.1 SBU with Clang and tests) (96 SBU with Clang and all documentation)

Optional Downloads


Compiler RT

LLVM Dependencies



Doxygen-1.8.8, Graphviz-2.38.0, libxml2-2.9.1, texlive-20140525, Zip-3.0, OCaml, Sphinx and Valgrind-3.10.0

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/llvm

Installation of LLVM

If you have downloaded the optional packages, install them into the source tree by running the following commands:

tar -xf ../cfe-3.5.0.src.tar.gz -C tools &&
tar -xf ../compiler-rt-3.5.0.src.tar.gz -C projects &&

mv tools/cfe-3.5.0.src tools/clang &&
mv projects/compiler-rt-3.5.0 projects/compiler-rt

Install LLVM by running the following commands:

sed -e 's:/docs/llvm:/share/doc/llvm-3.5.0:' \
    -i Makefile.config.in &&

CC=gcc CXX=g++                         \
./configure --prefix=/usr              \
            --sysconfdir=/etc          \
            --enable-libffi            \
            --enable-optimized         \
            --enable-shared            \
            --disable-assertions       &&

If you have installed Sphinx and wish to generate manual pages, issue the following command:

make -C docs -f Makefile.sphinx man

To test the results, issue: make check.

Now, as the root user:

make install &&

for file in /usr/lib/lib{clang,LLVM,LTO}*.a
  test -f $file && chmod -v 644 $file

If you had Python-2.7.8 installed and you have built Clang, install the Clang Analyzer by running the following command as the root user:

install -v -dm755 /usr/lib/clang-analyzer &&
for prog in scan-build scan-view
  cp -rfv tools/clang/tools/$prog /usr/lib/clang-analyzer/
  ln -sfv ../lib/clang-analyzer/$prog/$prog /usr/bin/
done &&
ln -sfv /usr/bin/clang /usr/lib/clang-analyzer/scan-build/ &&
mv -v /usr/lib/clang-analyzer/scan-build/scan-build.1 /usr/share/man/man1/

If you have built manual pages, install them by running the following command as the root user:

install -v -m644 docs/_build/man/* /usr/share/man/man1/

Command Explanations

sed -e ...: This sed fixes location of the installed documentation.

--enable-libffi: This switch enables LLVM to use libffi. Remove if you did not install libffi.

--enable-optimized: This switch enables compiler optimizations in order to speed up the code and reduce its size.

--enable-shared: This switch enables building of the LLVM shared library which contains all of static libraries linked into single library.

--disable-assertions: Disable some compile checks, not necessary on a production system.


Installed Programs: bugpoint, c-index-test, clang, clang++ (symlink), clang-check, clang-format, clang-tblgen, llc, lli, lli-child-target, llvm-ar, llvm-as, llvm-bcanalyzer, llvm-config, llvm-cov, llvm-diff, llvm-dis, llvm-dwarfdump, llvm-extract, llvm-link, llvm-mc, llvm-mcmarkup, llvm-nm, llvm-objdump, llvm-ranlib (symlink), llvm-readobj, llvm-rtdyld, llvm-size, llvm-stress, llvm-symbolizer, llvm-tblgen, macho-dump, opt, scan-build (symlink) and scan-view (symlink)
Installed Libraries: BugpointPasses.so, libclang.so, libLLVM-3.5.0.so, libLTO.so, LLVMHello.so and numerous static libraries in /usr/lib
Installed Directories: /usr/include/clang, /usr/include/clang-c, /usr/include/llvm, /usr/include/llvm-c, /usr/lib/clang, /usr/lib/clang-analyzer, /usr/share/doc/html/clang, /usr/share/doc/llvm-3.5.0, and /usr/share/doc/ps

Short Descriptions


is the automatic test case reduction tool.


is the Clang C, C++, and Objective-C compiler.


is the LLVM static compiler.


is used to directly execute programs from LLVM bitcode.


is the LLVM archiver.


is the LLVM assembler.


is the LLVM bitcode analyzer.


Prints LLVM compilation options.


is used to emit coverage information.


is the LLVM structural 'diff'.


is the LLVM disassembler.


is used to extract a function from an LLVM module.


is the LLVM linker.


is used to list LLVM bitcode and object file's symbol table.


is used to generate index for LLVM archive.


is used to generate random .ll files.


is the LLVM Target Description To C++ Code Generator.


is the LLVM optimizer.


is a Perl script that invokes the Clang static analyzer.


contains the LLVM API functions.

Last updated on 2014-09-14 18:57:10 -0700