This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Attempt to manually link compiler-rt libraries in CMake and LIT.
AbandonedPublic

Authored by EricWF on Feb 10 2015, 12:53 PM.

Details

Summary

Using -nodefaultlibs on some platforms prevents the required compiler-rt libraries from being linked to libc++. Sanitizers are currently not supported on OS X due to this problem.
This patch adds functionality in libcxx/test/libcxx/clang_utils.py that attempts to manually find the compiler-rt libraries and generate a list of required libraries.
CMake queries clang_utils.py to get a list of the required compiler-rt libraries by way of the GetCompilerRTOptions CMake module.
config.py also uses clang_utils.py to properly link compiler-rt while running the tests.

Note: This patch is needed to link the code coverage libraries on both linux and OS X.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 19703.Feb 10 2015, 12:53 PM
EricWF retitled this revision from to [libc++] Attempt to manually link compiler-rt libraries in CMake and LIT..
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added reviewers: mclow.lists, danalbert, jroelofs.
EricWF added a subscriber: Unknown Object (MLST).
EricWF updated this revision to Diff 19705.Feb 10 2015, 1:13 PM

Fix library link order in cmake.

EricWF updated this revision to Diff 19710.Feb 10 2015, 2:01 PM

Misc changes

EricWF updated this revision to Diff 19711.Feb 10 2015, 2:03 PM

Updated with wrong patch. Fixing.

EricWF updated this revision to Diff 19712.Feb 10 2015, 2:14 PM

Cleanup exception handling in clang_utils.py.

EricWF abandoned this revision.Mar 6 2015, 8:30 AM

There doesn't seem to be much interest in this patch and it comes with an increase in complexity. Abandoning.