Howard Hinnant | d213ffd | 2011-05-05 15:27:28 +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"> |
| 7 | <title>"libc++abi" C++ Standard Library Support</title> |
| 8 | <link type="text/css" rel="stylesheet" href="menu.css"> |
| 9 | <link type="text/css" rel="stylesheet" href="content.css"> |
| 10 | </head> |
| 11 | |
| 12 | <body> |
| 13 | <div id="menu"> |
| 14 | <div> |
| 15 | <a href="http://llvm.org/">LLVM Home</a> |
| 16 | </div> |
| 17 | |
| 18 | <div class="submenu"> |
| 19 | <label>libc++abi Info</label> |
| 20 | <a href="/index.html">About</a> |
| 21 | </div> |
| 22 | |
| 23 | <div class="submenu"> |
| 24 | <label>Quick Links</label> |
Sylvestre Ledru | 38e306d | 2018-09-20 08:01:16 +0000 | [diff] [blame] | 25 | <a href="https://libcxx.llvm.org/">libc++</a> |
Eric Fiselier | dd73082 | 2018-09-22 19:52:12 +0000 | [diff] [blame] | 26 | <a href="http://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev</a> |
| 27 | <a href="http://lists.llvm.org/mailman/listinfo/libcxx-commits">libcxx-commits</a> |
Howard Hinnant | d213ffd | 2011-05-05 15:27:28 +0000 | [diff] [blame] | 28 | <a href="http://llvm.org/bugs/">Bug Reports</a> |
| 29 | <a href="http://llvm.org/svn/llvm-project/libcxxabi/trunk/">Browse SVN</a> |
| 30 | <a href="http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/">Browse ViewVC</a> |
| 31 | </div> |
| 32 | </div> |
| 33 | |
| 34 | <div id="content"> |
| 35 | <!--*********************************************************************--> |
| 36 | <h1>"libc++abi" C++ Standard Library Support</h1> |
| 37 | <!--*********************************************************************--> |
| 38 | |
| 39 | <p>libc++abi is a new implementation of low level support for a standard |
| 40 | C++ library.</p> |
| 41 | |
| 42 | <p>All of the code in libc++abi is <a |
| 43 | href="http://llvm.org/docs/DeveloperPolicy.html#license">dual licensed</a> |
| 44 | under the MIT license and the UIUC License (a BSD-like license).</p> |
| 45 | |
| 46 | <!--=====================================================================--> |
| 47 | <h2 id="goals">Features and Goals</h2> |
| 48 | <!--=====================================================================--> |
| 49 | |
| 50 | <ul> |
| 51 | <li>Correctness as defined by the C++11 standard.</li> |
Sylvestre Ledru | f59526d | 2012-07-20 17:21:42 +0000 | [diff] [blame] | 52 | <li>Provide a portable sublayer to ease the porting of <a href="http://libcxx.llvm.org/">libc++</a></li> |
Howard Hinnant | 628bfc4 | 2011-05-19 23:38:38 +0000 | [diff] [blame] | 53 | <li>On Mac OS X, be ABI compatible with the existing low-level support.</li> |
Howard Hinnant | d213ffd | 2011-05-05 15:27:28 +0000 | [diff] [blame] | 54 | </ul> |
| 55 | |
| 56 | <!--=====================================================================--> |
| 57 | <h2 id="requirements">Platform Support</h2> |
| 58 | <!--=====================================================================--> |
| 59 | |
| 60 | <p>libc++abi is known to work on the following platforms, using clang.</p> |
| 61 | |
| 62 | <ul> |
Howard Hinnant | de2b109 | 2012-08-02 22:06:41 +0000 | [diff] [blame] | 63 | <li>Darwin</li> |
Howard Hinnant | d213ffd | 2011-05-05 15:27:28 +0000 | [diff] [blame] | 64 | </ul> |
| 65 | |
| 66 | <!--=====================================================================--> |
| 67 | <h2 id="dir-structure">Current Status</h2> |
| 68 | <!--=====================================================================--> |
| 69 | |
Howard Hinnant | de2b109 | 2012-08-02 22:06:41 +0000 | [diff] [blame] | 70 | <p>libc++abi is complete. <a href="spec.html">Here</a> is a |
| 71 | list of functionality.</p> |
Howard Hinnant | d213ffd | 2011-05-05 15:27:28 +0000 | [diff] [blame] | 72 | |
| 73 | <!--=====================================================================--> |
| 74 | <h2>Get it and get involved!</h2> |
| 75 | <!--=====================================================================--> |
| 76 | |
| 77 | <p>To check out the code, use:</p> |
| 78 | |
| 79 | <ul> |
| 80 | <li><code>svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi</code></li> |
| 81 | </ul> |
| 82 | |
Dan Albert | e11c1a7 | 2014-07-03 19:35:48 +0000 | [diff] [blame] | 83 | <p>To build:</p> |
| 84 | <ul> |
| 85 | <li>Check out libcxxabi into <code>llvm/projects</code></li> |
| 86 | <li><code>cd llvm</code></li> |
| 87 | <li><code>mkdir build && cd build</code></li> |
| 88 | <li><code>cmake .. # on linux you may need to prefix with CC=clang CXX=clang++</code></li> |
| 89 | <li><code>make</code></li> |
| 90 | </ul> |
| 91 | |
| 92 | <p>To do a standalone build:</p> |
| 93 | <ul> |
Eric Fiselier | 9a9e939 | 2015-01-22 20:00:06 +0000 | [diff] [blame] | 94 | <li> |
| 95 | Check out the <a href="http://libcxx.llvm.org">libcxx source</a> tree. |
| 96 | </li> |
Dan Albert | e11c1a7 | 2014-07-03 19:35:48 +0000 | [diff] [blame] | 97 | <li><code>cd libcxxabi</code></li> |
| 98 | <li><code>mkdir build && cd build</code></li> |
Eric Fiselier | 9a9e939 | 2015-01-22 20:00:06 +0000 | [diff] [blame] | 99 | <li><code>cmake -DLIBCXXABI_LIBCXX_PATH=path/to/libcxx .. # on |
Dan Albert | fd961bd | 2014-07-10 02:20:11 +0000 | [diff] [blame] | 100 | linux you may need -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++</code></li> |
Dan Albert | e11c1a7 | 2014-07-03 19:35:48 +0000 | [diff] [blame] | 101 | <li><code>make</code></li> |
| 102 | </ul> |
Eric Fiselier | ffe1ba2 | 2014-10-17 16:32:06 +0000 | [diff] [blame] | 103 | <p> By default CMake uses <code>llvm-config</code> to locate the required |
| 104 | LLVM sources. If CMake cannot find <code>llvm-config</code> then you must |
| 105 | configure CMake using either of the following options. |
| 106 | </p> |
| 107 | <ul> |
Eric Fiselier | 42ef22b | 2016-08-28 18:16:18 +0000 | [diff] [blame] | 108 | <li><code>-DLLVM_CONFIG_PATH=path/to/llvm-config</code></li> |
Eric Fiselier | ffe1ba2 | 2014-10-17 16:32:06 +0000 | [diff] [blame] | 109 | <li><code>-DLLVM_PATH=path/to/llvm-source-root</code></li> |
| 110 | </ul> |
| 111 | |
| 112 | </p> |
Dan Albert | e11c1a7 | 2014-07-03 19:35:48 +0000 | [diff] [blame] | 113 | |
Dan Albert | fd961bd | 2014-07-10 02:20:11 +0000 | [diff] [blame] | 114 | <p>To run the tests:</p> |
| 115 | <ul> |
Eric Fiselier | 564b6ea | 2016-08-28 18:28:51 +0000 | [diff] [blame] | 116 | <li><code>make check-cxxabi</code></li> |
Dan Albert | fd961bd | 2014-07-10 02:20:11 +0000 | [diff] [blame] | 117 | </ul> |
| 118 | <p>Note: in a standalone build, the system's libc++ will be used for tests. If |
| 119 | the system's libc++ was statically linked against libc++abi (or linked against |
| 120 | a different ABI library), this may interfere with test results.</p> |
| 121 | |
Howard Hinnant | d213ffd | 2011-05-05 15:27:28 +0000 | [diff] [blame] | 122 | <p>Send discussions to the |
Eric Fiselier | dd73082 | 2018-09-22 19:52:12 +0000 | [diff] [blame] | 123 | (<a href="http://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev mailing list</a>).</p> |
Howard Hinnant | d213ffd | 2011-05-05 15:27:28 +0000 | [diff] [blame] | 124 | |
Marshall Clow | c9d6b42 | 2014-06-11 16:54:09 +0000 | [diff] [blame] | 125 | <!--=====================================================================--> |
| 126 | <h2>Frequently asked questions</h2> |
| 127 | <!--=====================================================================--> |
| 128 | |
| 129 | <p>Q: Why are the destructors for the standard exception classes defined in libc++abi? |
| 130 | They're just empty, can't they be defined inline?</p> |
| 131 | <p>A: The destructors for them live in libc++abi because they are "key" functions. |
| 132 | The Itanium ABI describes a "key" function as the first virtual declared. |
| 133 | And wherever the key function is defined, that is where the <code>type_info</code> gets defined. |
| 134 | And in libc++ types are the same type if and only if they have the same <code>type_info</code> |
| 135 | (as in there must be only one type info per type in the entire application). |
| 136 | And on OS X, libstdc++ and libc++ share these exception types. |
| 137 | So to be able to throw in one dylib and catch in another (a <code>std::exception</code> for example), |
| 138 | there must be only one <code>std::exception type_info</code> in the entire app. |
| 139 | That typeinfo gets laid down beside <code>~exception()</code> in libc++abi (for both libstdc++ and libc++).</p> |
| 140 | <p>--Howard Hinnant</p> |
Howard Hinnant | d213ffd | 2011-05-05 15:27:28 +0000 | [diff] [blame] | 141 | |
| 142 | </div> |
| 143 | </body> |
| 144 | </html> |