Chris Lattner | ff5380f | 2009-06-30 22:56:43 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 | <!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ --> |
| 4 | <html> |
| 5 | <head> |
| 6 | <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
Chris Lattner | c134674 | 2009-07-01 17:16:20 +0000 | [diff] [blame] | 7 | <title>"compiler-rt" Runtime Library</title> |
Chris Lattner | ff5380f | 2009-06-30 22:56:43 +0000 | [diff] [blame] | 8 | <link type="text/css" rel="stylesheet" href="menu.css"> |
| 9 | <link type="text/css" rel="stylesheet" href="content.css"> |
| 10 | </head> |
Chris Lattner | 135bcdf | 2009-07-02 21:34:35 +0000 | [diff] [blame] | 11 | |
Chris Lattner | ff5380f | 2009-06-30 22:56:43 +0000 | [diff] [blame] | 12 | <body> |
| 13 | <!--#include virtual="menu.html.incl"--> |
| 14 | <div id="content"> |
| 15 | <!--*********************************************************************--> |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 16 | <h1>"compiler-rt" runtime libraries</h1> |
Chris Lattner | ff5380f | 2009-06-30 22:56:43 +0000 | [diff] [blame] | 17 | <!--*********************************************************************--> |
| 18 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 19 | <p>The compiler-rt project consists of: |
| 20 | <ul> |
| 21 | <li> |
| 22 | <p><b>builtins</b> - a simple library that provides an implementation |
| 23 | of the low-level target-specific hooks required by code generation and |
| 24 | other runtime components. For example, when compiling for a 32-bit target, |
Chris Lattner | ff5380f | 2009-06-30 22:56:43 +0000 | [diff] [blame] | 25 | converting a double to a 64-bit unsigned integer is compiling into a runtime |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 26 | call to the "__fixunsdfdi" function. The builtins library provides |
| 27 | optimized implementations of this and other low-level routines, either in |
| 28 | target-independent C form, or as a heavily-optimized assembly.</p> |
| 29 | <p>builtins provides full support for the libgcc interfaces on supported |
| 30 | targets and high performance hand tuned implementations of commonly used |
| 31 | functions like __floatundidf in assembly that are dramatically faster than |
| 32 | the libgcc implementations. It should be very easy to bring builtins to |
| 33 | support a new target by adding the new routines needed by that target.</p> |
| 34 | </li> |
| 35 | <li> |
| 36 | <b>sanitizer runtimes</b> - runtime libraries that are required to run |
| 37 | the code with sanitizer instrumentation. This includes runtimes for: |
| 38 | <ul> |
| 39 | <li><a href="http://clang.llvm.org/docs/AddressSanitizer.html">AddressSanitizer</a></li> |
| 40 | <li><a href="http://clang.llvm.org/docs/ThreadSanitizer.html">ThreadSanitizer</a></li> |
| 41 | <li><a href="http://clang.llvm.org/docs/UsersManual.html#opt-fsanitize-undefined">UndefinedBehaviorSanitizer</a></li> |
| 42 | <li><a href="http://clang.llvm.org/docs/MemorySanitizer.html">MemorySanitizer</a></li> |
| 43 | <li><a href="http://clang.llvm.org/docs/LeakSanitizer.html">LeakSanitizer</a></li> |
| 44 | <li><a href="http://clang.llvm.org/docs/DataFlowSanitizer.html">DataFlowSanitizer</a></li> |
| 45 | </ul> |
| 46 | </li> |
| 47 | <li> |
| 48 | <b>profile</b> - library which is used to collect coverage information. |
| 49 | </li> |
| 50 | <li> |
| 51 | <b>BlocksRuntime</b> - a target-independent implementation of Apple "Blocks" |
| 52 | runtime interfaces. |
| 53 | </li> |
| 54 | </ul> |
| 55 | </p> |
Chris Lattner | eb561be | 2009-07-02 21:29:19 +0000 | [diff] [blame] | 56 | |
Chris Lattner | 4b12196 | 2010-11-16 21:34:56 +0000 | [diff] [blame] | 57 | <p>All of the code in the compiler-rt project is <a |
| 58 | href="http://llvm.org/docs/DeveloperPolicy.html#license">dual licensed</a> |
| 59 | under the MIT license and the UIUC License (a BSD-like license).</p> |
Daniel Dunbar | 0ec64ce | 2011-12-07 18:43:12 +0000 | [diff] [blame] | 60 | |
| 61 | <!--=====================================================================--> |
| 62 | <h2 id="users">Clients</h2> |
| 63 | <!--=====================================================================--> |
| 64 | |
| 65 | <p>Currently compiler-rt is primarily used by |
| 66 | the <a href="http://clang.llvm.org">Clang</a> |
| 67 | and <a href="http://llvm.org">LLVM</a> projects as the implementation for |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 68 | the runtime compiler support libraries. For more information on using |
| 69 | compiler-rt with Clang, please see the Clang |
Daniel Dunbar | 0ec64ce | 2011-12-07 18:43:12 +0000 | [diff] [blame] | 70 | <a href="http://clang.llvm.org/get_started.html">Getting Started</a> |
| 71 | page.</p> |
Chris Lattner | ff5380f | 2009-06-30 22:56:43 +0000 | [diff] [blame] | 72 | |
| 73 | <!--=====================================================================--> |
Edward O'Callaghan | f361ff1 | 2009-08-04 04:48:38 +0000 | [diff] [blame] | 74 | <h2 id="requirements">Platform Support</h2> |
| 75 | <!--=====================================================================--> |
| 76 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 77 | <p><b>builtins</b> is known to work on the following platforms:</p> |
| 78 | <ul> |
| 79 | <li>Machine Architectures: i386, X86-64, SPARC64, ARM, PowerPC, PowerPC 64.</li> |
| 80 | <li>OS: AuroraUX, DragonFlyBSD, FreeBSD, NetBSD, Linux, Darwin.</li> |
| 81 | </ul> |
Edward O'Callaghan | f361ff1 | 2009-08-04 04:48:38 +0000 | [diff] [blame] | 82 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 83 | <p>Most sanitizer runtimes are supported only on Linux x86-64. See tool-specific |
| 84 | pages in <a href="http://clang.llvm.org/docs/index.html">Clang docs</a> for more |
| 85 | details.</p> |
Edward O'Callaghan | f361ff1 | 2009-08-04 04:48:38 +0000 | [diff] [blame] | 86 | |
| 87 | <!--=====================================================================--> |
Edward O'Callaghan | f998156 | 2009-08-03 01:26:42 +0000 | [diff] [blame] | 88 | <h2 id="dir-structure">Source Structure</h2> |
| 89 | <!--=====================================================================--> |
| 90 | |
| 91 | <p>A short explanation of the directory structure of compiler-rt:</p> |
| 92 | |
| 93 | <p>For testing it is possible to build a generic library and an optimized library. |
| 94 | The optimized library is formed by overlaying the optimized versions onto the generic library. |
| 95 | Of course, some architectures have additional functions, |
| 96 | so the optimized library may have functions not found in the generic version.</p> |
| 97 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 98 | <ul> |
| 99 | <li> include/ contains headers that can be included in user programs (for example, |
| 100 | users may directly call certain function from sanitizer runtimes).</li> |
| 101 | <li> lib/ contains libraries implementations. </li> |
| 102 | <li> lib/builtins is a generic portable implementation of <b>builtins</b> routines.</li> |
| 103 | <li> lib/builtins/(arch) has optimized versions of some routines |
| 104 | for the supported architectures.</li> |
| 105 | <li> test/ contains test suites for compiler-rt runtimes.</li> |
Edward O'Callaghan | f998156 | 2009-08-03 01:26:42 +0000 | [diff] [blame] | 106 | </ul> |
| 107 | |
Chris Lattner | ff5380f | 2009-06-30 22:56:43 +0000 | [diff] [blame] | 108 | <!--=====================================================================--> |
| 109 | <h2>Get it and get involved!</h2> |
| 110 | <!--=====================================================================--> |
| 111 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 112 | <p>Generally, you need to build LLVM/Clang in order to build compiler-rt. You can |
| 113 | either follow the Clang's |
| 114 | <a href="http://clang.llvm.org/get_started.html">Getting Started</a> page, or |
| 115 | <a href="http://llvm.org/docs/CMake.html#quick-start">build LLVM</a> |
| 116 | separately to get llvm-config binary, and then run: |
| 117 | |
Chris Lattner | c134674 | 2009-07-01 17:16:20 +0000 | [diff] [blame] | 118 | <ul> |
| 119 | <li>svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt</li> |
Edward O'Callaghan | 2d05d96 | 2009-09-23 05:04:26 +0000 | [diff] [blame] | 120 | <li>mkdir build</li> |
| 121 | <li>cd build</li> |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 122 | <li>cmake ../compiler-rt -DLLVM_CONFIG_PATH=/path/to/llvm-config</li> |
Chris Lattner | c134674 | 2009-07-01 17:16:20 +0000 | [diff] [blame] | 123 | <li>make</li> |
Chris Lattner | 1bb4c38 | 2010-05-04 05:19:07 +0000 | [diff] [blame] | 124 | </ul> |
| 125 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 126 | <p>Tests for sanitizer runtimes are ported to |
| 127 | <a href="http://llvm.org/docs/CommandGuide/lit.html">llvm-lit</a> and are |
| 128 | run by <b>make check-all</b> command in LLVM/Clang/compiler-rt build tree.</p> |
Chris Lattner | 1bb4c38 | 2010-05-04 05:19:07 +0000 | [diff] [blame] | 129 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 130 | <p>compiler-rt libraries are installed to the system with <b>make install</b> |
| 131 | command in either LLVM/Clang/compiler-rt or standalone |
| 132 | compiler-rt build tree.</p> |
Chris Lattner | 1bb4c38 | 2010-05-04 05:19:07 +0000 | [diff] [blame] | 133 | |
Chris Lattner | c134674 | 2009-07-01 17:16:20 +0000 | [diff] [blame] | 134 | <p>compiler-rt doesn't have its own mailing list, if you have questions please |
| 135 | email the <a |
| 136 | href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">llvmdev</a> mailing |
| 137 | list. Commits to the compiler-rt SVN module are automatically sent to the |
| 138 | <a |
| 139 | href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">llvm-commits</a> |
| 140 | mailing list.</p> |
Chris Lattner | ff5380f | 2009-06-30 22:56:43 +0000 | [diff] [blame] | 141 | </div> |
| 142 | </body> |
| 143 | </html> |