blob: 66bbb64824ecfa21e75ff0abae24c3eb9e63892d [file] [log] [blame]
Howard Hinnantd213ffd2011-05-05 15:27:28 +00001<!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>
Tanya Lattnerd8093df2015-08-05 04:01:26 +000025 <a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
26 <a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
Howard Hinnantd213ffd2011-05-05 15:27:28 +000027 <a href="http://llvm.org/bugs/">Bug Reports</a>
28 <a href="http://llvm.org/svn/llvm-project/libcxxabi/trunk/">Browse SVN</a>
29 <a href="http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/">Browse ViewVC</a>
30 </div>
31</div>
32
33<div id="content">
34 <!--*********************************************************************-->
35 <h1>"libc++abi" C++ Standard Library Support</h1>
36 <!--*********************************************************************-->
37
38 <p>libc++abi is a new implementation of low level support for a standard
39 C++ library.</p>
40
41 <p>All of the code in libc++abi is <a
42 href="http://llvm.org/docs/DeveloperPolicy.html#license">dual licensed</a>
43 under the MIT license and the UIUC License (a BSD-like license).</p>
44
45 <!--=====================================================================-->
46 <h2 id="goals">Features and Goals</h2>
47 <!--=====================================================================-->
48
49 <ul>
50 <li>Correctness as defined by the C++11 standard.</li>
Sylvestre Ledruf59526d2012-07-20 17:21:42 +000051 <li>Provide a portable sublayer to ease the porting of <a href="http://libcxx.llvm.org/">libc++</a></li>
Howard Hinnant628bfc42011-05-19 23:38:38 +000052 <li>On Mac OS X, be ABI compatible with the existing low-level support.</li>
Howard Hinnantd213ffd2011-05-05 15:27:28 +000053 </ul>
54
55 <!--=====================================================================-->
56 <h2 id="requirements">Platform Support</h2>
57 <!--=====================================================================-->
58
59 <p>libc++abi is known to work on the following platforms, using clang.</p>
60
61 <ul>
Howard Hinnantde2b1092012-08-02 22:06:41 +000062 <li>Darwin</li>
Howard Hinnantd213ffd2011-05-05 15:27:28 +000063 </ul>
64
65 <!--=====================================================================-->
66 <h2 id="dir-structure">Current Status</h2>
67 <!--=====================================================================-->
68
Howard Hinnantde2b1092012-08-02 22:06:41 +000069 <p>libc++abi is complete. <a href="spec.html">Here</a> is a
70 list of functionality.</p>
Howard Hinnantd213ffd2011-05-05 15:27:28 +000071
72 <!--=====================================================================-->
73 <h2>Get it and get involved!</h2>
74 <!--=====================================================================-->
75
76 <p>To check out the code, use:</p>
77
78 <ul>
79 <li><code>svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi</code></li>
80 </ul>
81
Dan Alberte11c1a72014-07-03 19:35:48 +000082 <p>To build:</p>
83 <ul>
84 <li>Check out libcxxabi into <code>llvm/projects</code></li>
85 <li><code>cd llvm</code></li>
86 <li><code>mkdir build &amp;&amp; cd build</code></li>
87 <li><code>cmake .. # on linux you may need to prefix with CC=clang CXX=clang++</code></li>
88 <li><code>make</code></li>
89 </ul>
90
91 <p>To do a standalone build:</p>
92 <ul>
Eric Fiselier9a9e9392015-01-22 20:00:06 +000093 <li>
94 Check out the <a href="http://libcxx.llvm.org">libcxx source</a> tree.
95 </li>
Dan Alberte11c1a72014-07-03 19:35:48 +000096 <li><code>cd libcxxabi</code></li>
97 <li><code>mkdir build &amp;&amp; cd build</code></li>
Eric Fiselier9a9e9392015-01-22 20:00:06 +000098 <li><code>cmake -DLIBCXXABI_LIBCXX_PATH=path/to/libcxx .. # on
Dan Albertfd961bd2014-07-10 02:20:11 +000099 linux you may need -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++</code></li>
Dan Alberte11c1a72014-07-03 19:35:48 +0000100 <li><code>make</code></li>
101 </ul>
Eric Fiselierffe1ba22014-10-17 16:32:06 +0000102 <p> By default CMake uses <code>llvm-config</code> to locate the required
103 LLVM sources. If CMake cannot find <code>llvm-config</code> then you must
104 configure CMake using either of the following options.
105 </p>
106 <ul>
Eric Fiselier42ef22b2016-08-28 18:16:18 +0000107 <li><code>-DLLVM_CONFIG_PATH=path/to/llvm-config</code></li>
Eric Fiselierffe1ba22014-10-17 16:32:06 +0000108 <li><code>-DLLVM_PATH=path/to/llvm-source-root</code></li>
109 </ul>
110
111 </p>
Dan Alberte11c1a72014-07-03 19:35:48 +0000112
Dan Albertfd961bd2014-07-10 02:20:11 +0000113 <p>To run the tests:</p>
114 <ul>
Eric Fiselier564b6ea2016-08-28 18:28:51 +0000115 <li><code>make check-cxxabi</code></li>
Dan Albertfd961bd2014-07-10 02:20:11 +0000116 </ul>
117 <p>Note: in a standalone build, the system's libc++ will be used for tests. If
118 the system's libc++ was statically linked against libc++abi (or linked against
119 a different ABI library), this may interfere with test results.</p>
120
Howard Hinnantd213ffd2011-05-05 15:27:28 +0000121 <p>Send discussions to the
Tanya Lattnerd8093df2015-08-05 04:01:26 +0000122 (<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">clang mailing list</a>).</p>
Howard Hinnantd213ffd2011-05-05 15:27:28 +0000123
Marshall Clowc9d6b422014-06-11 16:54:09 +0000124 <!--=====================================================================-->
125 <h2>Frequently asked questions</h2>
126 <!--=====================================================================-->
127
128 <p>Q: Why are the destructors for the standard exception classes defined in libc++abi?
129 They're just empty, can't they be defined inline?</p>
130 <p>A: The destructors for them live in libc++abi because they are "key" functions.
131 The Itanium ABI describes a "key" function as the first virtual declared.
132 And wherever the key function is defined, that is where the <code>type_info</code> gets defined.
133 And in libc++ types are the same type if and only if they have the same <code>type_info</code>
134 (as in there must be only one type info per type in the entire application).
135 And on OS X, libstdc++ and libc++ share these exception types.
136 So to be able to throw in one dylib and catch in another (a <code>std::exception</code> for example),
137 there must be only one <code>std::exception type_info</code> in the entire app.
138 That typeinfo gets laid down beside <code>~exception()</code> in libc++abi (for both libstdc++ and libc++).</p>
139 <p>--Howard Hinnant</p>
Howard Hinnantd213ffd2011-05-05 15:27:28 +0000140
141</div>
142</body>
143</html>