LLVM-3.8.1

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.10 platform.

Package Information

  • Download (HTTP): http://llvm.org/releases/3.8.1/llvm-3.8.1.src.tar.xz

  • Download MD5 sum: 538467e6028bbc9259b1e6e015d25845

  • Download size: 16 MB

  • Estimated disk space required: 1.3 GB (with Clang, add 6.1 GB for tests)

  • Estimated build time: 49 SBU (with Clang, add 15 SBU for tests)

Optional Downloads

Clang

Compiler RT

LLVM Dependencies

Recommended

Optional

Doxygen-1.8.11, Graphviz-2.38.0, libxml2-2.9.4, texlive-20160523b (or install-tl-unx), Valgrind-3.11.0, Zip-3.0, OCaml, and Sphinx

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.8.1.src.tar.xz -C tools &&
tar -xf ../compiler-rt-3.8.1.src.tar.xz -C projects &&

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

Install LLVM by running the following commands:

mkdir -v build &&
cd       build &&

CC=gcc CXX=g++                              \
cmake -DCMAKE_INSTALL_PREFIX=/usr           \
      -DLLVM_ENABLE_FFI=ON                  \
      -DCMAKE_BUILD_TYPE=Release            \
      -DBUILD_SHARED_LIBS=ON                \
      -DLLVM_TARGETS_TO_BUILD="host;AMDGPU" \
      -Wno-dev ..                           &&
make

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

cmake -DLLVM_ENABLE_SPHINX=ON         \
      -DSPHINX_WARNINGS_AS_ERRORS=OFF \
      -Wno-dev ..                     &&
make docs-llvm-html  docs-llvm-man

If you have downloaded the optional packages, the clang documentation can be built too:

make docs-clang-html docs-clang-man

To test the results, issue: make check-all. Note that the Address Sanitizer tests are known to fail currently.

Now, as the root user:

make install

If you have built the documentation, install it by running the following command as the root user:

install -v -m644 docs/man/* /usr/share/man/man1             &&
install -v -d -m755 /usr/share/doc/llvm-3.8.1/llvm-html     &&
cp -Rv docs/html/* /usr/share/doc/llvm-3.8.1/llvm-html

The clang documentation can be installed in the same way (again as the root user):

install -v -m644 tools/clang/docs/man/* /usr/share/man/man1 &&
install -v -d -m755 /usr/share/doc/llvm-3.8.1/clang-html    &&
cp -Rv tools/clang/docs/html/* /usr/share/doc/llvm-3.8.1/clang-html

Command Explanations

-DLLVM_ENABLE-FFI=ON: This switch enables LLVM to use libffi. Remove if you did not install libffi.

-DCMAKE_BUILD_TYPE=Release: This switch enables compiler optimizations in order to speed up the code and reduce its size. It also disables some compile checks, not necessary on a production system.

-DBUILD_SHARED_LIBS=ON: This switch enables building all the LLVM libraries as shared libraries instead of static.

-DLLVM_TARGETS_TO_BUILD="host;AMDGPU": This switch enables building for the same target as the host, and also for the r600 AMD GPU used by the Mesa r600 and radeonsi drivers. Default is all. You can use a semicolon separated list. Valid targets are: host, X86, Sparc, PowerPC, ARM, AArch64, Mips, Hexagon, Xcore, MSP430, NVPTX, SystemZ, AMDGPU, BPF, CppBackend, or all.

-DLLVM_BUILD_LLVM_DYLIB=ON: if used instead of -DBUILD_SHARED_LIBS=ON, builds libraries as static and links all of them into an unique shared one.

-DLLVM_ENABLE_DOXYGEN: Enables the generation of browsable HTML documentation if you have installed Doxygen-1.8.11. You should run make doxygen-html afterwards, and install the generated documentation manually.

Contents

Installed Programs: bugpoint, c-index-test, clang, clang++ (symlinks to clang-<version>), clang-<version>, clang-check, clang-cl, clang-format, git-clang-format, llc, lli, llvm-ar, llvm-as, llvm-bcanalyzer, llvm-config, llvm-cov, llvm-c-test, llvm-cxxdump, llvm-diff, llvm-dis, llvm-dsymutil, llvm-dwarfdump, llvm-dwp, llvm-extract, llvm-lib (symlink to llvm-ar), llvm-link, llvm-lto, llvm-mc, llvm-mcmarkup, llvm-nm, llvm-objdump, llvm-pdbdump, llvm-profdata, llvm-ranlib (symlink to llvm-ar), llvm-readobj, llvm-rtdyld, llvm-size, llvm-split, llvm-stress, llvm-symbolizer, llvm-tblgen, obj2yaml, opt, sancov, scan-build, scan-view, verify-uselistorder, and yaml2obj
Installed Libraries: BugpointPasses.so, libclang*.so (21 libraries), libLLVM*.so (53 libraries), libLTO.so, and LLVMHello.so
Installed Directories: /usr/include/{clang,clang-c,llvm,llvm-c}, /usr/lib/clang, and /usr/share/{clang,llvm,scan-build,scan-view,doc/llvm-3.8.1}

Short Descriptions

bugpoint

is the automatic test case reduction tool.

clang

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

clang-format

is a tool to format C/C++/Java/JavaScript/Objective-C/Protobuf code.

llc

is the LLVM static compiler.

lli

is used to directly execute programs from LLVM bitcode.

llvm-ar

is the LLVM archiver.

llvm-as

is the LLVM assembler.

llvm-bcanalyzer

is the LLVM bitcode analyzer.

llvm-config

Prints LLVM compilation options.

llvm-cov

is used to emit coverage information.

llvm-c-test

is a bytecode disassembler.

llvm-cxxdump

is used as a C++ ABI Data Dumper.

llvm-diff

is the LLVM structural 'diff'.

llvm-dis

is the LLVM disassembler.

llvm-dsymutil

is a tool used to manipulate archived DWARF debug symbol files, compatible with the Darwin command dsymutil.

llvm-dwarfdump

prints the content of DWARF sections in object files.

llvm-dwp

merges split DWARF files.

llvm-extract

is used to extract a function from an LLVM module.

llvm-link

is the LLVM linker.

llvm-lto

is the LLVM LTO (link time optimization) linker.

llvm-mc

is a standalone machine code assembler/disassembler.

llvm-nm

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

llvm-objdump

is an LLVM object file dumper.

llvm-pdbdump

is used as PDB Dumper.

llvm-profdata

is a small tool to manipulate and print profile data files.

llvm-ranlib

is used to generate an index for a LLVM archive.

llvm-readobj

displays low-level format-specific information about object files.

llvm-rtdyld

is the LLVM MC-JIT tool.

llvm-size

is the LLVM object size dumper.

llvm-split

is the LLVM module splitter.

llvm-stress

is used to generate random .ll files.

llvm-symbolizer

converts adresses into source code locations.

llvm-tblgen

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

obj2yaml

takes an object file,and produces a YAML representation of the file.

opt

is the LLVM optimizer.

sancov

is the sanitizer coverage processing tool.

scan-build

is a Perl script that invokes the Clang static analyzer.

scan-view

is a viewer for Clang static analyzer results.

verify-uselistorder

is the LLVM tool to verify use-list order.

yaml2obj

takes a YAML representation of an object file and converts it to an binary file.

Last updated on 2016-08-27 01:42:41 -0700