diff options
| author | Howard Hinnant <hhinnant@apple.com> | 2013-02-08 19:10:36 +0000 |
|---|---|---|
| committer | Howard Hinnant <hhinnant@apple.com> | 2013-02-08 19:10:36 +0000 |
| commit | af00dc0420993de24b3913f04f632e4375bd8b47 (patch) | |
| tree | 3f3d4a4688e9477194e3176bc9fd8068a58a33e5 /libcxx | |
| parent | 50232e50d8e405e0cabc2f1f2451eb76f0420c12 (diff) | |
| download | bcm5719-llvm-af00dc0420993de24b3913f04f632e4375bd8b47.tar.gz bcm5719-llvm-af00dc0420993de24b3913f04f632e4375bd8b47.zip | |
Michael van der Westhuizen: Update instructions for building on Linux.
llvm-svn: 174733
Diffstat (limited to 'libcxx')
| -rw-r--r-- | libcxx/www/index.html | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/libcxx/www/index.html b/libcxx/www/index.html index 091b0bace5d..d95d384b6d9 100644 --- a/libcxx/www/index.html +++ b/libcxx/www/index.html @@ -260,6 +260,81 @@ End of search list. </p> <!--=====================================================================--> + <h2>Build on Linux using CMake and libc++abi.</h2> + <!--=====================================================================--> + + <p> + You will need to keep the source tree of <a href="http://libcxxabi.llvm.org">libc++abi</a> + available on your build machine and your copy of the libc++abi shared library must + be placed where your linker will find it. + </p> + + <p> + We can now run CMake: + <ul> + <li><code>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></code></li> + <li><code>make</code></li> + <li><code>sudo make install</code></li> + </ul> + <p> + 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, + <ul> + <li><code>clang++ -stdlib=libc++ helloworld.cpp -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc</code></li> + </ul> + Alternately, you could just add libc++abi to your libraries list, which in most + situations will give the same result: + <ul> + <li><code>clang++ -stdlib=libc++ helloworld.cpp -lc++abi</code></li> + </ul> + </p> + </p> + + <!--=====================================================================--> + <h2>Build on Linux using CMake and libcxxrt.</h2> + <!--=====================================================================--> + + <p> + You will need to keep the source tree of + <a href="https://github.com/pathscale/libcxxrt/">libcxxrt</a> available + on your build machine and your copy of the libcxxrt shared library must + be placed where your linker will find it. + </p> + + <p> + We can now run CMake: + <ul> + <li><code>CC=clang CXX=clang++ cmake -G "Unix Makefiles" + -DLIBCXX_CXX_ABI=libcxxrt + -DLIBCXX_LIBCXXABI_INCLUDE_PATHS="<libcxxrt-source-dir>/src" + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX=/usr + <libc++-source-dir></code></li> + <li><code>make</code></li> + <li><code>sudo make install</code></li> + </ul> + <p> + 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, + <ul> + <li><code>clang++ -stdlib=libc++ helloworld.cpp -nodefaultlibs -lc++ -lcxxrt -lm -lc -lgcc_s -lgcc</code></li> + </ul> + Alternately, you could just add libcxxrt to your libraries list, which in most + situations will give the same result: + <ul> + <li><code>clang++ -stdlib=libc++ helloworld.cpp -lcxxrt</code></li> + </ul> + </p> + </p> + + <!--=====================================================================--> <h2>Design Documents</h2> <!--=====================================================================--> |

