1.. _index: 2 3============================= 4"libc++" C++ Standard Library 5============================= 6 7Overview 8======== 9 10libc++ is a new implementation of the C++ standard library, targeting C++11 and 11above. 12 13* Features and Goals 14 15 * Correctness as defined by the C++11 standard. 16 * Fast execution. 17 * Minimal memory use. 18 * Fast compile times. 19 * ABI compatibility with gcc's libstdc++ for some low-level features 20 such as exception objects, rtti and memory allocation. 21 * Extensive unit tests. 22 23* Design and Implementation: 24 25 * Extensive unit tests 26 * Internal linker model can be dumped/read to textual format 27 * Additional linking features can be plugged in as "passes" 28 * OS specific and CPU specific code factored out 29 30 31Getting Started with libc++ 32--------------------------- 33 34.. toctree:: 35 :maxdepth: 2 36 37 ReleaseNotes 38 UsingLibcxx 39 BuildingLibcxx 40 TestingLibcxx 41 42 43.. toctree:: 44 :hidden: 45 46 FeatureTestMacroTable 47 48Current Status 49-------------- 50 51After its initial introduction, many people have asked "why start a new 52library instead of contributing to an existing library?" (like Apache's 53libstdcxx, GNU's libstdc++, STLport, etc). There are many contributing 54reasons, but some of the major ones are: 55 56* From years of experience (including having implemented the standard 57 library before), we've learned many things about implementing 58 the standard containers which require ABI breakage and fundamental changes 59 to how they are implemented. For example, it is generally accepted that 60 building std::string using the "short string optimization" instead of 61 using Copy On Write (COW) is a superior approach for multicore 62 machines (particularly in C++11, which has rvalue references). Breaking 63 ABI compatibility with old versions of the library was 64 determined to be critical to achieving the performance goals of 65 libc++. 66 67* Mainline libstdc++ has switched to GPL3, a license which the developers 68 of libc++ cannot use. libstdc++ 4.2 (the last GPL2 version) could be 69 independently extended to support C++11, but this would be a fork of the 70 codebase (which is often seen as worse for a project than starting a new 71 independent one). Another problem with libstdc++ is that it is tightly 72 integrated with G++ development, tending to be tied fairly closely to the 73 matching version of G++. 74 75* STLport and the Apache libstdcxx library are two other popular 76 candidates, but both lack C++11 support. Our experience (and the 77 experience of libstdc++ developers) is that adding support for C++11 (in 78 particular rvalue references and move-only types) requires changes to 79 almost every class and function, essentially amounting to a rewrite. 80 Faced with a rewrite, we decided to start from scratch and evaluate every 81 design decision from first principles based on experience. 82 Further, both projects are apparently abandoned: STLport 5.2.1 was 83 released in Oct'08, and STDCXX 4.2.1 in May'08. 84 85Platform and Compiler Support 86----------------------------- 87 88libc++ is known to work on the following platforms, using gcc and 89clang. 90Note that functionality provided by ``<atomic>`` is only functional with clang 91and GCC. 92 93============ ==================== ============ ======================== 94OS Arch Compilers ABI Library 95============ ==================== ============ ======================== 96macOS i386, x86_64 Clang, GCC libc++abi 97FreeBSD 10+ i386, x86_64, ARM Clang, GCC libcxxrt, libc++abi 98Linux i386, x86_64 Clang, GCC libc++abi 99============ ==================== ============ ======================== 100 101The following minimum compiler versions are strongly recommended. 102 103* Clang 3.5 and above 104* GCC 5.0 and above. 105 106The C++03 dialect is only supported for Clang compilers. 107 108C++ Dialect Support 109--------------------- 110 111* C++11 - Complete 112* `C++14 - Complete <http://libcxx.llvm.org/cxx1y_status.html>`__ 113* `C++17 - In Progress <http://libcxx.llvm.org/cxx1z_status.html>`__ 114* `Post C++14 Technical Specifications - In Progress <http://libcxx.llvm.org/ts1z_status.html>`__ 115* :ref:`C++ Feature Test Macro Status <feature-status>` 116 117Notes and Known Issues 118---------------------- 119 120This list contains known issues with libc++ 121 122* Building libc++ with ``-fno-rtti`` is not supported. However 123 linking against it with ``-fno-rtti`` is supported. 124 125 126A full list of currently open libc++ bugs can be `found here`__. 127 128.. __: https://bugs.llvm.org/buglist.cgi?component=All%20Bugs&product=libc%2B%2B&query_format=advanced&resolution=---&order=changeddate%20DESC%2Cassigned_to%20DESC%2Cbug_status%2Cpriority%2Cbug_id&list_id=74184 129 130Design Documents 131---------------- 132 133.. toctree:: 134 :maxdepth: 1 135 136 DesignDocs/AvailabilityMarkup 137 DesignDocs/DebugMode 138 DesignDocs/CapturingConfigInfo 139 DesignDocs/ABIVersioning 140 DesignDocs/ExperimentalFeatures 141 DesignDocs/VisibilityMacros 142 DesignDocs/ThreadingSupportAPI 143 DesignDocs/FileTimeType 144 DesignDocs/FeatureTestMacros 145 DesignDocs/ExtendedCXX03Support 146 147* `<atomic> design <http://libcxx.llvm.org/atomic_design.html>`_ 148* `<type_traits> design <http://libcxx.llvm.org/type_traits_design.html>`_ 149* `Notes by Marshall Clow`__ 150 151.. __: https://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/ 152 153Build Bots and Test Coverage 154---------------------------- 155 156* `LLVM Buildbot Builders <http://lab.llvm.org:8011/console>`_ 157* `Apple Jenkins Builders <http://lab.llvm.org:8080/green/view/Libcxx/>`_ 158* `Windows Appveyor Builders <https://ci.appveyor.com/project/llvm-mirror/libcxx>`_ 159* `Code Coverage Results <http://efcs.ca/libcxx-coverage>`_ 160 161Getting Involved 162================ 163 164First please review our `Developer's Policy <http://llvm.org/docs/DeveloperPolicy.html>`__ 165and `Getting started with LLVM <http://llvm.org/docs/GettingStarted.html>`__. 166 167**Bug Reports** 168 169If you think you've found a bug in libc++, please report it using 170the `LLVM Bugzilla`_. If you're not sure, you 171can post a message to the `libcxx-dev mailing list`_ or on IRC. 172 173**Patches** 174 175If you want to contribute a patch to libc++, the best place for that is 176`Phabricator <http://llvm.org/docs/Phabricator.html>`_. Please add `libcxx-commits` as a subscriber. 177Also make sure you are subscribed to the `libcxx-commits mailing list <http://lists.llvm.org/mailman/listinfo/libcxx-commits>`_. 178 179**Discussion and Questions** 180 181Send discussions and questions to the 182`libcxx-dev mailing list <http://lists.llvm.org/mailman/listinfo/libcxx-dev>`_. 183 184 185 186Quick Links 187=========== 188* `LLVM Homepage <http://llvm.org/>`_ 189* `libc++abi Homepage <http://libcxxabi.llvm.org/>`_ 190* `LLVM Bugzilla <https://bugs.llvm.org/>`_ 191* `libcxx-commits Mailing List`_ 192* `libcxx-dev Mailing List`_ 193* `Browse libc++ Sources <https://github.com/llvm/llvm-project/tree/master/libcxx/>`_ 194