index.rst 6.6 KB

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