This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Update libc++ docs to include instructions for LIT.
ClosedPublic

Authored by danalbert on Aug 1 2014, 6:42 PM.

Details

Summary

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

Diff Detail

Event Timeline

danalbert updated this revision to Diff 12136.Aug 1 2014, 6:42 PM
danalbert retitled this revision from to [libcxx] Update libc++ docs to include instructions for LIT..
danalbert updated this object.
danalbert edited the test plan for this revision. (Show Details)
danalbert added reviewers: mclow.lists, EricWF.
danalbert added a subscriber: Unknown Object (MLST).
EricWF edited edge metadata.Aug 1 2014, 7:21 PM

You can build libc++ in-tree? I did not know that!

  1. I like that we are documenting the uniform CMake build system as the primary one. I'm not sure we should remove the buildit documentation right away though.
  2. I agree that we should move towards using libc++abi as the primary ABI on linux as opposed to libsupc++ even though it must be explicitly linked.
  3. I'm interested to hear what Mac users think about this patch. The documentation seems to reflect how I build and test libc++ on linux but that may not be the case on OS X.

I'll go through the actual instructions step-by-step tonight to do and in-tree build and out-of-tree build just to make sure nothing was omitted.

P.S. Sorry about hijacking this to deal with other documentation issues.

www/index.html
107–110

I don't have access to a mac with g++-4.2 but is that still supported? libc++ requires a c++11 compiler to build so I'm skeptical GCC 4.2 works.
Along the same lines I don't think the comment about lack of C++11 is correct. I think we should update this to say that a C++11 compiler is required to build libc++.

114–115

When do you think we can say we officially support linux?

155–159

While I like documenting the CMake build system as the primary one since it is uniform across all systems should we be so quick to remove the documentation for the buildit script?

202–207

I'm very happy to see these instructions make it into the documentation. Since we are encouraging people to modify the source tree can we set up SVN to ignore libcxx/test/lit.site.cfg? (ex like a .gitignore file)

  1. I'm interested to hear what Mac users think about this patch. The documentation seems to reflect how I build and test libc++ on linux but that may not be the case on OS X.

AIUI this works for Mac as well. It may not be what has become the typical flow for them, but this is probably more because the docs never mentioned anything other than buildit for Mac.

www/index.html
107–110

_Building_ libc++ requires a C++11 compiler (for that matter, I think it requires clang specifically). I believe this paragraph is actually about users of libc++, which is still supported for older standard versions, and from gcc.

114–115

I considered adding them. A few of the remaining test failures seem like blockers to me (though they might be innocuous, I haven't investigated).

155–159

I was wondering this myself. It's still present in the system, though perhaps that's not obvious enough. I expect that this probably has a wide range of users, but again I wonder how many of them use it simply because it was what the docs said first. As with testit, it's also non-parallel.

Anyone have a good reason we should keep it in the docs?

thakis added a subscriber: thakis.Aug 2 2014, 4:55 PM

Awesome :-)

www/index.html
159–160

s/checkout/check/
(there's already an "out" right after it)

209

How much work is it to not require people to change lit.site.cfg? The ln -s is a bit gnarly, it'd be nice if it wouldn't have to be in the docs.

mclow.lists edited edge metadata.Aug 4 2014, 11:02 AM

Mostly good; a few comments.
I'd like to see more about using lit :-)

www/index.html
109

Typo: 'functinality'.

216

I would add something here about using DYLD_LIBRARY_PATH to interpose the newly built dylib (say, for testing purposes).

Should probably remind people that (on a Mac) blindly copying these dylibs to /usr/lib will, if any error occurs, result in a system that will not boot.

danalbert added inline comments.Aug 4 2014, 2:02 PM
www/index.html
209

I haven't really looked in to that yet. One obvious solution is to just have cmake do the symlink for you (probably by generating the lit.site.cfg in place and creating the symlink in build/test/). It'll be another patch though. I'll make sure I update the docs when I do fix this.

216

The former is down below under "Using libc++ in your programs" (not obvious from the diff, but pretty clear on the webpage). I've added the extra warning for Mac.

danalbert updated this revision to Diff 12179.Aug 4 2014, 2:35 PM
danalbert edited edge metadata.

Addressed some review comments.

emaste added a subscriber: emaste.Aug 6 2014, 1:19 PM
emaste added inline comments.
www/index.html
114

Also:
<li>FreeBSD 10+ i386</li>
<li>FreeBSD 10+ amd64</li>
<li>FreeBSD 10+ arm</li>

I could add these in a separate commit.

164–167

on FreeBSD, Linux, or Mac

tests have some issues on FreeBSD at the moment

254

these instructions are valid for FreeBSD too

emaste: Thanks. I wasn't sure about the status of this stuff for any of the BSDs.

emaste added a comment.Aug 6 2014, 1:29 PM

@danalbert: For background, we switched to Clang + libc++ in FreeBSD 10.0 (released Jan 2014) on i386/amd64/arm. GCC and libstdc++ are not installed by default. Work is ongoing for mips, powerpc, and sparc.

danalbert updated this revision to Diff 12254.Aug 6 2014, 2:39 PM
  • Don't forget FreeBSD!
EricWF accepted this revision.Aug 10 2014, 2:19 PM
EricWF edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Aug 10 2014, 2:19 PM
danalbert closed this revision.Aug 11 2014, 8:22 AM

Submitted as r215358.