diff --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst
index 0730703fac42..2cbce326f709 100644
--- a/libcxx/docs/BuildingLibcxx.rst
+++ b/libcxx/docs/BuildingLibcxx.rst
@@ -1,3 +1,4 @@
+.. _BuildingLibcxx:
===============
Building libc++
@@ -336,3 +337,72 @@ own copy of libsupc++ and this can lead to subtle problems.
$ make install
You can now run clang with -stdlib=libc++.
+
+
+.. _libcxxrt_ref:
+
+Using libcxxrt on Linux
+------------------------
+
+You will need to keep the source tree of `libcxxrt`_ available
+on your build machine and your copy of the libcxxrt shared library must
+be placed where your linker will find it.
+
+We can now run CMake like:
+
+.. code-block:: bash
+
+ $ CC=clang CXX=clang++ cmake -G "Unix Makefiles" \
+ -DLIBCXX_CXX_ABI=libcxxrt \
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxrt-sources/src \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+
+ $ make cxx
+ $ make install
+
+Unfortunately you can't simply run clang with "-stdlib=libc++" at this point, as
+clang is set up to link for libc++ linked to libsupc++. To get around this
+you'll have to set up your linker yourself (or patch clang). For example,
+
+.. code-block:: bash
+
+ $ clang++ -stdlib=libc++ helloworld.cpp \
+ -nodefaultlibs -lc++ -lcxxrt -lm -lc -lgcc_s -lgcc
+
+Alternately, you could just add libcxxrt to your libraries list, which in most
+situations will give the same result:
+
+.. code-block:: bash
+
+ $ clang++ -stdlib=libc++ helloworld.cpp -lcxxrt
+
+.. _`libcxxrt`: https://github.com/pathscale/libcxxrt/
+
+
+Using a local ABI library installation
+---------------------------------------
+
+.. warning::
+ This is not recommended in almost all cases.
+
+These instructions should only be used when you can't install your ABI library.
+
+Normally you must link libc++ against a ABI shared library that the
+linker can find. If you want to build and test libc++ against an ABI
+library not in the linker's path you needq to set
+``-DLIBCXX_CXX_ABI_LIBRARY_PATH=/path/to/abi/lib`` when configuring CMake.
+
+An example build using libc++abi would look like:
+
+.. code-block:: bash
+
+ $ CC=clang CXX=clang++ cmake \
+ -DLIBCXX_CXX_ABI=libc++abi \
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/path/to/libcxxabi/include" \
+ -DLIBCXX_CXX_ABI_LIBRARY_PATH="/path/to/libcxxabi-build/lib" \
+ path/to/libcxx
+ $ make
+
+When testing libc++ LIT will automatically link against the proper ABI
+library.
diff --git a/libcxx/www/index.html b/libcxx/www/index.html
index 821f25d7e04f..70cf5b60155e 100644
--- a/libcxx/www/index.html
+++ b/libcxx/www/index.html
@@ -166,96 +166,18 @@
- On Mac OS 10.7 (Lion) and later, the easiest way to get this library is to install
- Xcode 4.2 or later. However if you want to install tip-of-trunk from here
- (getting the bleeding edge), read on. However, be warned that Mac OS
- 10.7 will not boot without a valid copy of libc++.1.dylib in
- /usr/lib.
-
-
-
To check out the code, use:
-
-
-
svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
-
-
-
- Note that for an in-tree build, you should check out libcxx to
- llvm/projects.
-
-
-
- The following instructions are for building libc++ on FreeBSD, Linux, or Mac
- using libc++abi as the C++ ABI
- library. On Linux, it is also possible to use
- libsupc++ or libcxxrt.
-
-
-
In-tree build:
-
-
cd where-you-want-to-live
-
Check out libcxx and libcxxabi
- into llvm/projects
-
cd where-you-want-to-build
-
mkdir build && cd build
-
cmake path/to/llvm # Linux may require -DCMAKE_C_COMPILER=clang
- -DCMAKE_CXX_COMPILER=clang++
lit -sv test/re/ # or whichever subset of tests you're interested
- in
-
-
The above is currently quite inconvenient. Sorry! We're working on it!
-
-
More information on using LIT can be found
- here. For more
- general information about the LLVM testing infrastructure, see the
- LLVM Testing Infrastructure
- Guide
-
-
-
- Shared libraries for libc++ should now be present in llvm/build/lib. Note
- that it is safest to use this from its current location rather than
- replacing your system's libc++ (if it has one, if not, go right ahead).
-
-
-
- Mac users, remember to be careful when replacing the system's libc++.
- Your system will not be able to boot without a functioning
- libc++.
-
+ The documentation for building and using libc++ can be found below.
+
+
+ Using libc++
+ Documentation on using the library in your programs
- You will need to keep the source tree of
- libc++abi available on your build
- machine and your copy of the libc++abi shared library must be placed where
- your linker will find it.
-
-
-
- Unfortunately you can't simply run clang with "-stdlib=libc++" at this
- point, as clang is set up to link for libc++ linked to libsupc++. To get
- around this you'll have to set up your linker yourself (or patch clang).
- For example:
-
- Alternately, you could just add libc++abi to your libraries list, which in
- most situations will give the same result:
-
-
-
-
clang++ -stdlib=libc++ helloworld.cpp -lc++abi
-
-
Bug reports and patches
@@ -354,136 +217,6 @@
include [libc++] in the subject and add cfe-commits as a subscriber.
-
-
Build on Linux using CMake and libsupc++.
-
-
-
- You will need libstdc++ in order to provide libsupc++.
-
-
-
- Figure out where the libsupc++ headers are on your system. On Ubuntu this
- is /usr/include/c++/<version> and
- /usr/include/c++/<version>/<target-triple>
-
You can also substitute -DLIBCXX_CXX_ABI=libsupc++
- above, which will cause the library to be linked to libsupc++ instead
- of libstdc++, but this is only recommended if you know that you will
- never need to link against libstdc++ in the same executable as libc++.
- GCC ships libsupc++ separately but only as a static library. If a
- program also needs to link against libstdc++, it will provide its
- own copy of libsupc++ and this can lead to subtle problems.
-
make
-
sudo make install
-
-
- You can now run clang with -stdlib=libc++.
-
-
-
-
-
Build on Linux using CMake and libcxxrt.
-
-
-
- You will need to keep the source tree of
- libcxxrt available
- on your build machine and your copy of the libcxxrt shared library must
- be placed where your linker will find it.
-
- Unfortunately you can't simply run clang with "-stdlib=libc++" at this point, as
- clang is set up to link for libc++ linked to libsupc++. To get around this
- you'll have to set up your linker yourself (or patch clang). For example,
-
- Alternately, you could just add libcxxrt to your libraries list, which in most
- situations will give the same result:
-
-
clang++ -stdlib=libc++ helloworld.cpp -lcxxrt
-
-
-
-
-
-
Using a local ABI library
-
-
- Note: This is not recommended in almost all cases.
- Generally these instructions should only be used when you can't install
- your ABI library.
-
-
- Normally you must link libc++ against a ABI shared library that the
- linker can find. If you want to build and test libc++ against an ABI
- library not in the linker's path you need to set
- -DLIBCXX_CXX_ABI_LIBRARY_PATH=/path/to/abi/lib when
- configuring CMake.
-
-
- An example build using libc++abi would look like:
-
-libc++ uses LIT to configure and run its tests. The primary way to run the
-libc++ tests is by using make check-libcxx. However since libc++
-can be used in any number of possible configurations it is important to
-customize the way LIT builds and runs the tests. This guide provides
-information on how to use LIT directly to test libc++.
-
lit -sv test/std/numerics # Run only the numeric tests
-
-
-
-
Customization Options
-
-
-libc++'s testsuite provides multiple options to configure the way the tests
-are build and run. To use these options you pass them on the LIT command line
-as --param NAME or --param NAME=VALUE. Some options
-have default values specified during CMake's configuration. Passing the option
-on the command line will override the default.
-
-
-
-
-
libcxx_site_config=<path/to/lit.site.cfg>
-
-Specify the site configuration to use when running the tests. This option
-overrides the enviroment variable LIBCXX_SITE_CONFIG
-
-
-
-
-
libcxx_headers=<path/to/headers>
-
-Specify the libc++ headers that are tested. By default the headers in the source
-tree are used.
-
-
-
-
-
libcxx_library=<path/to/libc++.so>
-
-Specify the libc++ library that is tested. By default the library in the build
-directory is used. This option cannot be used when use_system_lib
-is provided.
-
-
-
-
-
use_system_lib=<bool>
-
-Default: False
-Enable or disable testing against the installed version of libc++ library.
-Note: This does not use the installed headers.
-
-
-
-
-
use_lit_shell=<bool>
-
-Enable or disable the use of LIT's internal shell in ShTests. If the enviroment
-variable LIT_USE_INTERNAL_SHELL is present then that is used as the
-default value. Otherwise the default value is True on Windows and
-False on every other platform.
-
-
-
-
-
no_default_flags=<bool>
-
-Default: False
-Disable all default compile and link flags from being added. When this option is
-used only flags specified using the compile_flags and
-link_flags will be used.
-
-
-
-
-
compile_flags="<list-of-args>"
-
-Specify additional compile flags as a space delimited string.
-Note: This options should not be used to change the standard version used.
-
-
-
-
-
link_flags="<list-of-args>"
-
-Specify additional link flags as a space delimited string.
-
-
-
-
-
std=<standard version>
-
-Values: c++98, c++03, c++11, c++14, c++1z
-Change the standard version used when building the tests.
-
-
-
-
-
debug_level=<level>
-
-Values: 0, 1
-Enable the use of debug mode. Level 0 enables assertions and level 1 enables
-assertions and debugging of iterator misuse.
-
-
-
-
-
use_sanitizer=<sanitizer name>
-
-Values: Memory, MemoryWithOrigins, Address, Undefined
-Run the tests using the given sanitizer. If LLVM_USE_SANITIZER
-was given when building libc++ then that sanitizer will be used by default.
-
-
-
-
-
color_diagnostics
-
-Enable the use of colorized compile diagnostics. If the
-color_diagnostics option is specified or the enviroment variable
-LIBCXX_COLOR_DIAGNOSTICS is present then color diagnostics will be
-enabled.
-