Hi mclow.lists, EricWF,

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

http://reviews.llvm.org/D4766

Files:
  www/index.html
Index: www/index.html
===================================================================
--- www/index.html
+++ www/index.html
@@ -103,13 +103,17 @@
   <h2 id="requirements">Platform Support</h2>
   <!--=====================================================================-->
 
-   <p>libc++ is known to work on the following platforms, using g++-4.2 and
-      clang (lack of C++11 language support disables some functionality).</p>
+  <p>
+    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 functinality provided by &lt;atomic&gt; is only functional with
+    clang.
+  </p>
 
-    <ul>
-     <li>Mac OS X i386</li>
-     <li>Mac OS X x86_64</li>
-    </ul>
+  <ul>
+    <li>Mac OS X i386</li>
+    <li>Mac OS X x86_64</li>
+  </ul>
 
   <!--=====================================================================-->
   <h2 id="dir-structure">Current Status</h2>
@@ -134,79 +138,149 @@
   <p>First please review our
      <a href="http://llvm.org/docs/DeveloperPolicy.html";>Developer's Policy</a>.
 
+  <p>
+     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 <code>libc++.1.dylib</code> in
+     <code>/usr/lib</code>.
+  </p>
+
   <p>To check out the code, use:</p>
 
   <ul>
   <li><code>svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx</code></li>
   </ul>
 
   <p>
-     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 <code>libc++.1.dylib</code> in
-     <code>/usr/lib</code>.
+    Note that for an in-tree build, you should checkout out libcxx to
+    llvm/projects.
   </p>
 
   <p>
-     Next:
+    The following instructions are for building libc++ on Mac or Linux using
+    <a href="http://libcxxabi.llvm.org/";>libc++abi</a> as the C++ ABI library.
+    On Linux, it is also possible to use
+    <a href="#libsupc++">libsupc++</a> or <a href="#libcxxrt">libcxxrt</a>.
   </p>
-  
+
+  <p>In-tree build:</p>
   <ul>
-    <li><code>cd libcxx/lib</code></li>
-    <li><code>export TRIPLE=-apple-</code></li>
-    <li><code>./buildit</code></li>
-    <li><code>ln -sf libc++.1.dylib libc++.dylib</code></li>
+    <li>Check out libcxx and <a href="http://libcxxabi.llvm.org/";>libcxxabi</a>
+      into llvm/projects</li>
+    <li><code>cd llvm</code></li>
+    <li><code>mkdir build &amp;&amp; cd build</code></li>
+    <li><code>cmake .. # Linux may require -DCMAKE_C_COMPILER=clang
+        -DCMAKE_CXX_COMPILER=clang++</code></li>
+    <li><code>make cxx</code></li>
   </ul>
-  
+
+  <p>Out-of-tree build:</p>
+  <ul>
+    <li>Check out libcxx</li>
+    <li>If not on a Mac, also check out
+      <a href="http://libcxxabi.llvm.org/";>libcxxabi</a></li>
+    <li><code>cd libcxx</code></li>
+    <li><code>mkdir build &amp;&amp; cd build</code></li>
+    <li><code>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++</code></li>
+    <li><code>make</code></li>
+  </ul>
+
+  <p>To run the tests:</p>
+  <ul>
+  <li><code>make check-libcxx</code></li>
+  </ul>
+
+  <p>If you wish to run a subset of the test suite:</p>
+  <ul>
+    <li><code>cd path/to/libcxx/libcxx</code></li>
+    <li><code>alias lit='python path/to/llvm/utils/lit/lit.py'</code></li>
+    <li><code>ln -s path/to/build/dir/projects/libcxx/test/lit.site.cfg
+        test/lit.site.cfg</code></li>
+    <li><code>lit -sv test/re/ # or whichever subset of tests you're interested
+        in</code></li>
+  </ul>
+  <p>The above is currently quite inconvenient. Sorry! We're working on it!</p>
+
+  <p>
+    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).
+  </p>
+
+  <!--=====================================================================-->
+  <h3>Notes</h3>
+  <!--=====================================================================-->
+
   <p>
-     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.
+    Building libc++ with <code>-fno-rtti</code> is not supported.  However
+    linking against it with <code>-fno-rtti</code> is supported.
   </p>
 
+  <p>Send discussions to the
+    <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev";>clang mailing list</a>.</p>
+
+  <!--=====================================================================-->
+  <h2>Using libc++ in your programs</h2>
+  <!--=====================================================================-->
+
+  <!--=====================================================================-->
+  <h3>Mac OS X</h3>
+  <!--=====================================================================-->
+
   <p>
-  To use your system-installed libc++ with clang you can:
+    To use your system-installed libc++ with clang you can:
   </p>
 
   <ul>
     <li><code>clang++ -stdlib=libc++ test.cpp</code></li>
     <li><code>clang++ -std=c++11 -stdlib=libc++ test.cpp</code></li>
   </ul>
 
   <p>
-  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:
   </p>
 
   <ul>
-    <li><code>export DYLD_LIBRARY_PATH=&lt;path-to-libcxx&gt;/lib</code>
+    <li><code>export DYLD_LIBRARY_PATH=path/to/build/lib</code>
     <li><code>clang++ -std=c++11 -stdlib=libc++ -nostdinc++
          -I&lt;path-to-libcxx&gt;/include -L&lt;path-to-libcxx&gt;/lib
          test.cpp</code></li>
   </ul>
 
-  <p>To run the libc++ test suite (recommended):</p>
+  <!--=====================================================================-->
+  <h3>Linux</h3>
+  <!--=====================================================================-->
+
+  <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>
+    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:
+  </p>
 
   <ul>
-  <li><code>cd libcxx/test</code></li>
-  <li><code>./testit</code></li>
-     <ul>
-       <li>You can alter the command line options <code>testit</code> uses
-       with <code>export OPTIONS="whatever you need"</code></li>
-     </ul>
+    <li><code>clang++ -stdlib=libc++ helloworld.cpp -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc</code></li>
   </ul>
 
-  <!--=====================================================================-->
-  <h3>Notes</h3>
-  <!--=====================================================================-->
-
-<p>
-Building libc++ with <code>-fno-rtti</code> is not supported.  However linking
-against it with <code>-fno-rtti</code> is supported.
-</p>
+  <p>
+    Alternately, you could just add libc++abi to your libraries list, which in
+    most situations will give the same result:
+  </p>
 
-  <p>Send discussions to the
-  (<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev";>clang mailing list</a>).</p>
+  <ul>
+    <li><code>clang++ -stdlib=libc++ helloworld.cpp -lc++abi</code></li>
+  </ul>
 
   <!--=====================================================================-->
   <h2>Bug reports and patches</h2>
@@ -226,7 +300,7 @@
 </p>
 
   <!--=====================================================================-->
-  <h2>Build on Linux using CMake and libsupc++.</h2>
+  <h2 id="libsupc++">Build on Linux using CMake and libsupc++.</h2>
   <!--=====================================================================-->
 
   <p>
@@ -287,44 +361,7 @@
   </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="&lt;libc++abi-source-dir&gt;/include"
-                -DCMAKE_BUILD_TYPE=Release
-                -DCMAKE_INSTALL_PREFIX=/usr
-                &lt;libc++-source-dir&gt;</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>
+  <h2 id="libcxxrt">Build on Linux using CMake and libcxxrt.</h2>
   <!--=====================================================================-->
 
   <p>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to