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