"compiler-rt" runtime libraries

The compiler-rt project consists of:

All of the code in the compiler-rt project is dual licensed under the MIT license and the UIUC License (a BSD-like license).

Clients

Currently compiler-rt is primarily used by the Clang and LLVM projects as the implementation for the runtime compiler support libraries. For more information on using compiler-rt with Clang, please see the Clang Getting Started page.

Platform Support

builtins is known to work on the following platforms:

Most sanitizer runtimes are supported only on Linux x86-64. See tool-specific pages in Clang docs for more details.

Source Structure

A short explanation of the directory structure of compiler-rt:

For testing it is possible to build a generic library and an optimized library. The optimized library is formed by overlaying the optimized versions onto the generic library. Of course, some architectures have additional functions, so the optimized library may have functions not found in the generic version.

Get it and get involved!

Generally, you need to build LLVM/Clang in order to build compiler-rt. You can build it either together with llvm and clang, or separately.

To build it together, simply add compiler-rt to the -DLLVM_ENABLE_RUNTIMES= option to cmake.

To build it separately, first build LLVM separately to get llvm-config binary, and then run:

Tests for sanitizer runtimes are ported to llvm-lit and are run by make check-all command in LLVM/Clang/compiler-rt build tree.

compiler-rt libraries are installed to the system with make install command in either LLVM/Clang/compiler-rt or standalone compiler-rt build tree.

If you have questions, please ask on the Discourse forums under the Runtime category. Commits to compiler-rt are automatically sent to the llvm-commits mailing list.