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.