Index: www/index.html =================================================================== --- www/index.html +++ www/index.html @@ -103,13 +103,20 @@
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. +
-First please review our Developer's Policy. +
+ 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:
- 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
.
+ Note that for an in-tree build, you should check out libcxx to
+ llvm/projects.
- Next: + 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 libcxx/lib
export TRIPLE=-apple-
./buildit
ln -sf libc++.1.dylib libc++.dylib
cd llvm
mkdir build && cd build
cmake .. # Linux may require -DCMAKE_C_COMPILER=clang
+ -DCMAKE_CXX_COMPILER=clang++
make cxx
Out-of-tree build:
+cd libcxx
mkdir build && cd build
cmake -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_LIBCXXABI_INCLUDE_PATHS=path/to/libcxxabi/include
+ -DLIT_EXECUTABLE=path/to/llvm/utils/lit/lit.py .. # Linux may require
+ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
make
To run the tests:
+make check-libcxx
If you wish to run a subset of the test suite:
+cd path/to/libcxx/libcxx
alias lit='python path/to/llvm/utils/lit/lit.py'
ln -s path/to/build/dir/projects/libcxx/test/lit.site.cfg
+ test/lit.site.cfg
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). +
+- 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. + Mac users, remember to be careful when replacing the system's libc++. + Your system will not be able to boot without a funcioning + libc++.
+ +
+ Building libc++ with -fno-rtti
is not supported. However
+ linking against it with -fno-rtti
is supported.
+
Send discussions to the + clang mailing list.
+ + +- To use your system-installed libc++ with clang you can: + 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:
export DYLD_LIBRARY_PATH=<path-to-libcxx>/lib
+ export DYLD_LIBRARY_PATH=path/to/build/lib
clang++ -std=c++11 -stdlib=libc++ -nostdinc++
-I<path-to-libcxx>/include -L<path-to-libcxx>/lib
test.cpp
To run the libc++ test suite (recommended):
+ ++ 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: +
cd libcxx/test
./testit
testit
uses
- with export OPTIONS="whatever you need"
clang++ -stdlib=libc++ helloworld.cpp -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc
-Building libc++ with -fno-rtti
is not supported. However linking
-against it with -fno-rtti
is supported.
-
+ Alternately, you could just add libc++abi to your libraries list, which in + most situations will give the same result: +
-Send discussions to the - (clang mailing list).
+clang++ -stdlib=libc++ helloworld.cpp -lc++abi
@@ -287,44 +377,7 @@
-- 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: -
CC=clang CXX=clang++ cmake -G "Unix Makefiles"
- -DLIBCXX_CXX_ABI=libcxxabi
- -DLIBCXX_LIBCXXABI_INCLUDE_PATHS="<libc++abi-source-dir>/include"
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- <libc++-source-dir>
make
sudo 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, -
clang++ -stdlib=libc++ helloworld.cpp -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc
clang++ -stdlib=libc++ helloworld.cpp -lc++abi