From ec4de787e2f616d2ba1b82e1385554dfbbb8516f Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Mon, 11 Aug 2014 15:12:46 +0000 Subject: [PATCH] Update libc++ docs to include instructions for LIT. Okay, so this actually does more than just that. I've rearranged most of the information on the page to try to make it more helpful and flow better. Essentially, the differences between Mac and Linux, the various ABI libraries, and in-tree versus out-of-tree builds were cluttering things. To clean up, I've done the following: * Only describe the cmake process. buildit doesn't work out of the box on Linux, and we need to stop having duplicates for every process. * Use libc++abi for the default instructions. This works on the major platforms. * Describe both in-tree and out-of-tree builds. Previously it wasn't clear that in-tree builds were even possible for libc++. * Separate the documentation about using libc++ from that about building and testing libc++. llvm-svn: 215358 --- libcxx/www/index.html | 219 ++++++++++++++++++++++++++---------------- 1 file changed, 136 insertions(+), 83 deletions(-) diff --git a/libcxx/www/index.html b/libcxx/www/index.html index ba3f259840ff..c1f3aa56e288 100644 --- a/libcxx/www/index.html +++ b/libcxx/www/index.html @@ -103,13 +103,20 @@

Platform Support

-

libc++ is known to work on the following platforms, using g++-4.2 and - clang (lack of C++11 language support disables some functionality).

+

+ libc++ is known to work on the following platforms, using g++-4.2 and + clang (lack of C++11 language support disables some functionality). Note + that functionality provided by <atomic> is only functional with + clang. +

- +

Current Status

@@ -134,12 +141,6 @@

First please review our Developer's Policy. -

To check out the code, use:

- - -

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 @@ -148,25 +149,106 @@ /usr/lib.

-

- Next: -

- +

To check out the code, use:

+ - +

- That should result in a libc++.1.dylib and libc++.dylib. The safest thing - to do is to use it from where your libcxx is installed instead of replacing - these in your Mac OS. + Note that for an in-tree build, you should check out libcxx to + llvm/projects.

- To use your system-installed libc++ with clang you can: + 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:

+ + +

Out-of-tree build:

+ + +

To run the tests:

+ + +

If you wish to run a subset of the test suite:

+ +

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 funcioning + libc++. +

+ + +

Notes

+ + +

+ Building libc++ with -fno-rtti is not supported. However + linking against it with -fno-rtti is supported. +

+ +

Send discussions to the + clang mailing list.

+ + +

Using libc++ in your programs

+ + + +

FreeBSD and Mac OS X

+ + +

+ To use your system-installed libc++ with clang you can:

- To use your tip-of-trunk libc++ on Mac OS with clang you can: + To use your tip-of-trunk libc++ on Mac OS with clang you can:

-

To run the libc++ test suite (recommended):

+ +

Linux

+ + +

+ 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: +

- -

Notes

- +

+ Alternately, you could just add libc++abi to your libraries list, which in + most situations will give the same result: +

-

-Building libc++ with -fno-rtti is not supported. However linking -against it with -fno-rtti is supported. -

- -

Send discussions to the - (clang mailing list).

+

Bug reports and patches

@@ -226,7 +316,7 @@ mailing list. Please include "libc++" and "PATCH" in your subject.

-

Build on Linux using CMake and libsupc++.

+

Build on Linux using CMake and libsupc++.

@@ -287,44 +377,7 @@ End of search list.

-

Build on Linux using CMake and libc++abi.

- - -

- 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. -

- -

- We can now run CMake: -

-

- 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: - -

-

- - -

Build on Linux using CMake and libcxxrt.

+

Build on Linux using CMake and libcxxrt.