index.html revision 2d1fdb26e458c4ddc04155c1d421bced3ba90cd0
1ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
28a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com          "http://www.w3.org/TR/html4/strict.dtd">
3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
48a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com<html>
5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com<head>
6ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
78a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <title>"compiler-rt" Runtime Library</title>
88a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <link type="text/css" rel="stylesheet" href="menu.css">
9ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com  <link type="text/css" rel="stylesheet" href="content.css">
108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com</head>
118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com<body>
138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com<!--#include virtual="menu.html.incl"-->
148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com<div id="content">
157ffb1b21abcc7bbed5a0fc711f6dd7b9dbb4f577ctguil@chromium.org  <!--*********************************************************************-->
168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <h1>"compiler-rt" runtime libraries</h1>
178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <!--*********************************************************************-->
188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  
198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <p>The compiler-rt project consists of:
208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <ul>
218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <li>
228a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <p><b>builtins</b> - a simple library that provides an implementation
238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    of the low-level target-specific hooks required by code generation and
24e9cd27d4a3c92393cc6c79d4d6f93d266411d95erobertphillips@google.com    other runtime components.  For example, when compiling for a 32-bit target,
258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    converting a double to a 64-bit unsigned integer is compiling into a runtime
268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    call to the "__fixunsdfdi" function.  The builtins library provides
278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    optimized implementations of this and other low-level routines, either in
288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    target-independent C form, or as a heavily-optimized assembly.</p>
298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <p>builtins provides full support for the libgcc interfaces on supported
308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    targets and high performance hand tuned implementations of commonly used
318a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    functions like __floatundidf in assembly that are dramatically faster than
328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    the libgcc implementations. It should be very easy to bring builtins to
338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    support a new target by adding the new routines needed by that target.</p>
348a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  </li>
358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <li>
368a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <b>sanitizer runtimes</b> - runtime libraries that are required to run
378a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    the code with sanitizer instrumentation. This includes runtimes for:
388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <ul>
398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <li><a href="http://clang.llvm.org/docs/AddressSanitizer.html">AddressSanitizer</a></li>
408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <li><a href="http://clang.llvm.org/docs/ThreadSanitizer.html">ThreadSanitizer</a></li>
418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <li><a href="http://clang.llvm.org/docs/UsersManual.html#opt-fsanitize-undefined">UndefinedBehaviorSanitizer</a></li>
428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <li><a href="http://clang.llvm.org/docs/MemorySanitizer.html">MemorySanitizer</a></li>
438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <li><a href="http://clang.llvm.org/docs/LeakSanitizer.html">LeakSanitizer</a></li>
448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <li><a href="http://clang.llvm.org/docs/DataFlowSanitizer.html">DataFlowSanitizer</a></li>
458a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    </ul>
468a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  </li>
478a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <li>
488a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <b>profile</b> - library which is used to collect coverage information.
498a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  </li>
508a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <li>
518a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <b>BlocksRuntime</b> - a target-independent implementation of Apple "Blocks"
528a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    runtime interfaces.
538a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  </li>
548a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  </ul>
558a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  </p>
568a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
578a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <p>All of the code in the compiler-rt project is <a 
588a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com     href="http://llvm.org/docs/DeveloperPolicy.html#license">dual licensed</a>
598a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com     under the MIT license and the UIUC License (a BSD-like license).</p>
608a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
618a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <!--=====================================================================-->
628a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <h2 id="users">Clients</h2>
638a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <!--=====================================================================-->
648a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
658a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <p>Currently compiler-rt is primarily used by
668a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    the <a href="http://clang.llvm.org">Clang</a>
67b530ef5869c5c64af8f3b3c62ed7711fe4325c9creed@google.com    and <a href="http://llvm.org">LLVM</a> projects as the implementation for
688a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    the runtime compiler support libraries. For more information on using
698a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    compiler-rt with Clang, please see the Clang
708a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <a href="http://clang.llvm.org/get_started.html">Getting Started</a>
718a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    page.</p>
723467ee06d31798b2673364ef4f7abd83619b21ddreed@google.com  
733467ee06d31798b2673364ef4f7abd83619b21ddreed@google.com  <!--=====================================================================-->
743467ee06d31798b2673364ef4f7abd83619b21ddreed@google.com  <h2 id="requirements">Platform Support</h2>
758a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <!--=====================================================================-->
768a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
778a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com   <p><b>builtins</b> is known to work on the following platforms:</p>
788a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com   <ul>
798a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com   <li>Machine Architectures: i386, X86-64, SPARC64, ARM, PowerPC, PowerPC 64.</li>
808a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com   <li>OS: AuroraUX, DragonFlyBSD, FreeBSD, NetBSD, Linux, Darwin.</li>
818a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com   </ul>
828a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
838a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com   <p>Most sanitizer runtimes are supported only on Linux x86-64. See tool-specific
848a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com   pages in <a href="http://clang.llvm.org/docs/index.html">Clang docs</a> for more
850da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com   details.</p>
860da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com
870da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com  <!--=====================================================================-->
880da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com  <h2 id="dir-structure">Source Structure</h2>
890da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com  <!--=====================================================================-->
900da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com
910da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com   <p>A short explanation of the directory structure of compiler-rt:</p>
920da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com
930da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com   <p>For testing it is possible to build a generic library and an optimized library.
940da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com       The optimized library is formed by overlaying the optimized versions onto the generic library.
950da41dbf5bdf9614a3d2f1d3ebd959221bbac44breed@android.com       Of course, some architectures have additional functions,
968a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com       so the optimized library may have functions not found in the generic version.</p>
971271d78e8ff4cda0622a24dcec6063b50f6be051reed@google.com
981271d78e8ff4cda0622a24dcec6063b50f6be051reed@google.com   <ul>
991271d78e8ff4cda0622a24dcec6063b50f6be051reed@google.com    <li> include/ contains headers that can be included in user programs (for example,
1001271d78e8ff4cda0622a24dcec6063b50f6be051reed@google.com         users may directly call certain function from sanitizer runtimes).</li>
101e9cd27d4a3c92393cc6c79d4d6f93d266411d95erobertphillips@google.com    <li> lib/ contains libraries implementations. </li>
1021271d78e8ff4cda0622a24dcec6063b50f6be051reed@google.com    <li> lib/builtins is a generic portable implementation of <b>builtins</b> routines.</li>
1031271d78e8ff4cda0622a24dcec6063b50f6be051reed@google.com    <li> lib/builtins/(arch) has optimized versions of some routines
104046f1f6ff4b2b3f4571a9562e74f41e82419a4a1commit-bot@chromium.org         for the supported architectures.</li>
105046f1f6ff4b2b3f4571a9562e74f41e82419a4a1commit-bot@chromium.org    <li> test/ contains test suites for compiler-rt runtimes.</li>
106046f1f6ff4b2b3f4571a9562e74f41e82419a4a1commit-bot@chromium.org   </ul>
107046f1f6ff4b2b3f4571a9562e74f41e82419a4a1commit-bot@chromium.org    
108046f1f6ff4b2b3f4571a9562e74f41e82419a4a1commit-bot@chromium.org  <!--=====================================================================-->
109046f1f6ff4b2b3f4571a9562e74f41e82419a4a1commit-bot@chromium.org  <h2>Get it and get involved!</h2>
110046f1f6ff4b2b3f4571a9562e74f41e82419a4a1commit-bot@chromium.org  <!--=====================================================================-->
1111271d78e8ff4cda0622a24dcec6063b50f6be051reed@google.com  
1121271d78e8ff4cda0622a24dcec6063b50f6be051reed@google.com  <p>Generally, you need to build LLVM/Clang in order to build compiler-rt. You can
1131271d78e8ff4cda0622a24dcec6063b50f6be051reed@google.com  either follow the Clang's
1141271d78e8ff4cda0622a24dcec6063b50f6be051reed@google.com  <a href="http://clang.llvm.org/get_started.html">Getting Started</a> page, or
115aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  <a href="http://llvm.org/docs/CMake.html#quick-start">build LLVM</a>
116aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  separately to get llvm-config binary, and then run:
117aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org
118aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  <ul>
119aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  <li>svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt</li>
120aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  <li>mkdir build</li>
121e9cd27d4a3c92393cc6c79d4d6f93d266411d95erobertphillips@google.com  <li>cd build</li>
122aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  <li>cmake /compiler-rt -DLLVM_CONFIG_PATH=/path/to/llvm-config</li>
123aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  <li>make</li>
124aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  </ul>
125e9cd27d4a3c92393cc6c79d4d6f93d266411d95erobertphillips@google.com
1268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <p>Tests for sanitizer runtimes are ported to
1278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  <a href="http://llvm.org/docs/CommandGuide/lit.html">llvm-lit</a> and are
1287fc0e0a75a99ac5ea2e5d03ab3a00cacabacfa09skia.committer@gmail.com  run by <b>make check-all</b> command in LLVM/Clang/compiler-rt build tree.</p>
129aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org
130aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  <p>compiler-rt libraries are installed to the system with <b>make install</b>
131aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  command in either LLVM/Clang/compiler-rt or standalone
132aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3commit-bot@chromium.org  compiler-rt build tree.</p>
1337af56bee17764a0c118c8856a035bb3d27766969humper@google.com
1347af56bee17764a0c118c8856a035bb3d27766969humper@google.com  <p>compiler-rt doesn't have its own mailing list, if you have questions please
1358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com     email the <a
1368a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">llvmdev</a> mailing
1378a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    list.  Commits to the compiler-rt SVN module are automatically sent to the
1388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    <a 
1398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com  href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">llvm-commits</a>
1408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    mailing list.</p>
1418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com</div>
1428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com</body>
1438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com</html>
1448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com