This is an archive of the discontinued LLVM Phabricator instance.

Create new library 'libc++experimental.a' for packaging TS symbols.
ClosedPublic

Authored by EricWF on May 2 2016, 11:13 PM.

Details

Summary

Out-of-line symbols for <experimental/...> headers are not ABI or API stable and cannot live in the 'libc++.dylib'. Currently they have nowhere to live. I would like to add a new library target libc++experimental.a to fix this.

Previously I had suggested different libraries for different TS's (libc++filesystem.a, 'libc++LFTS.a`, ect). I no longer think this is the right approach.
Instead c++experimental will hold *all* TS implementations as a single monolithic library. I see two main benefits to this:

  1. Users only have to know about and manually link one library.
  2. It makes it easy to implement TS's with one or two out-of-line symbols. (Ex. PMRs)

c++experimental provides NO ABI compatibility. Symbols can freely be added/removed/changed without concern for ABI stability.
I will add documentation for this after landing this patch (but before adding anything to it).

c++experimental only builds as a static library. By default CMake will build/test this library but will *NOT* install it.

This patch adds the CMake and LIT logic needed to build/test the new library. Once this lands I plan on using it to implement parts of <experimental/memory_resource>.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 55947.May 2 2016, 11:13 PM
EricWF retitled this revision from to Create new library 'libc++experimental.a' for packaging TS symbols..
EricWF updated this object.
EricWF added a reviewer: mclow.lists.
EricWF added subscribers: danalbert, beanz, bcraig and 3 others.

Adding cfe-commits to the subscribers.

mclow.lists accepted this revision.May 3 2016, 1:16 PM
mclow.lists edited edge metadata.

I like this approach. LGTM.

This revision is now accepted and ready to land.May 3 2016, 1:16 PM

Q: Should the .a file get installed into /lib when you do a make install?

That will make it easier to link against.

EricWF added a comment.May 3 2016, 2:27 PM

Q: Should the .a file get installed into /lib when you do a make install?

That will make it easier to link against.

For now the install rule is off by default. -DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON will install it alongside libc++.so.
We can turn it ON by default once the library actually contains some code.

EricWF closed this revision.May 3 2016, 2:36 PM