This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Use "-stdlib=libc++" when possible instead of '-nodefaultlibs' in the test suite.
AbandonedPublic

Authored by EricWF on Oct 15 2015, 6:37 PM.

Details

Summary

Currently we use '-nodefaultlibs' when building and running the libc++ tests. However we should prefer using '-stdlib=libc++'.
This patch automatically detects when the test suite can use "-stdlib=libc++" and prefers it when possible.

We use -stdlib=libc++ when the following are true:

  1. CXX is clang or apple clang.
  2. 'cxx_abi' is set to 'none'. This means that libc++ handles the ABI library dependency on its own.
  3. We are using the default unwinder (ie not libunwind).

Diff Detail

Event Timeline

EricWF updated this revision to Diff 37553.Oct 15 2015, 6:37 PM
EricWF retitled this revision from to [libcxx] Use "-stdlib=libc++" when possible instead of '-nodefaultlibs' in the test suite..
EricWF updated this object.
EricWF added reviewers: mclow.lists, danalbert, jroelofs.
EricWF added a subscriber: cfe-commits.
jroelofs added inline comments.Oct 16 2015, 8:19 AM
test/libcxx/test/config.py
364

Maybe it makes sense to name this 'auto' instead of 'none'?

EricWF added inline comments.Dec 15 2015, 11:00 PM
test/libcxx/test/config.py
364

I don't think so. I think the CMake option LIBCXX_CXX_ABI should learn "auto" instead of "none". Once CMake knows the correct library it can pass that on to the test suite. Currently CMake passes "none" when it knows "libc++.so" exports the ABI library symbols directly.

EricWF updated this revision to Diff 43084.Dec 16 2015, 4:09 PM

Update diff against ToT.

jroelofs added inline comments.Dec 16 2015, 4:22 PM
test/libcxx/test/config.py
364

ohh, I see now.

EricWF abandoned this revision.Dec 27 2016, 10:46 PM

This is long dead.