Skip to content

Commit

Permalink
[CMake] Avoid passing -rtlib=compiler-rt when using compiler-rt
Browse files Browse the repository at this point in the history
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
  • Loading branch information
petrhosek committed Feb 12, 2019
1 parent 43d6122 commit 5300d84
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions libcxx/CMakeLists.txt
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions libcxxabi/CMakeLists.txt
Expand Up @@ -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)
Expand Down

0 comments on commit 5300d84

Please sign in to comment.