[CMake] Avoid passing -rtlib=compiler-rt when using compiler-rt

We build libc++ and libc++abi with -nodefaultlibs, so -rtlib=compiler-rt
has no effect and results in an 'argument unused during compilation'
warning which breaks the build when using -Werror. We can therefore drop
-rtlib=compiler-rt without any functional change; note that the actual
compiler-rt linking is handled by HandleCompilerRT.

Differential Revision: https://reviews.llvm.org/D58084

llvm-svn: 353786
This commit is contained in:
Petr Hosek 2019-02-12 01:35:29 +00:00
parent 43d6122f73
commit 5300d84116
2 changed files with 0 additions and 8 deletions

View File

@ -485,10 +485,6 @@ endif()
# Configure compiler.
include(config-ix)
if (LIBCXX_USE_COMPILER_RT)
list(APPEND LIBCXX_LINK_FLAGS "-rtlib=compiler-rt")
endif()
# Configure coverage options.
if (LIBCXX_GENERATE_COVERAGE)
include(CodeCoverage)

View File

@ -262,10 +262,6 @@ if (LIBCXXABI_HAS_NOSTDINCXX_FLAG)
string(REPLACE "-stdlib=libstdc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
if (LIBCXXABI_USE_COMPILER_RT)
list(APPEND LIBCXXABI_LINK_FLAGS "-rtlib=compiler-rt")
endif()
# Let the library headers know they are currently being used to build the
# library.
add_definitions(-D_LIBCXXABI_BUILDING_LIBRARY)