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

Eric Fiselier eric at efcs.ca
Tue Feb 10 12:53:35 PST 2015


Hi mclow.lists, danalbert, jroelofs,

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.

http://reviews.llvm.org/D7542

Files:
  CMakeLists.txt
  cmake/Modules/GetCompilerRTOptions.cmake
  lib/CMakeLists.txt
  test/libcxx/clang_utils.py
  test/libcxx/compiler.py
  test/libcxx/test/config.py

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7542.19703.patch
Type: text/x-patch
Size: 23166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150210/a50994ac/attachment.bin>


More information about the cfe-commits mailing list