[compiler-rt][CMake] Remove unused -stdlib when passing -nostdinc++

We added -nostdinc++ to clang_rt.profile in https://reviews.llvm.org/D84205.
This will cause warnings when building with LLVM_ENABLE_LIBCXX,
and failure if with Werror on.

This patch is to fix it by removing unused -stdlib,
similar to what we have done in https://reviews.llvm.org/D42238.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D84543
This commit is contained in:
Jinsong Ji 2020-07-24 20:55:52 +00:00
parent 4dc3014c51
commit 3554cf4f38
1 changed files with 2 additions and 0 deletions

View File

@ -113,6 +113,8 @@ endif()
# We don't use the C++ Standard Library here, so avoid including it by mistake.
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ EXTRA_FLAGS)
# Remove -stdlib= which is unused when passing -nostdinc++.
string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# This appears to be a C-only warning banning the use of locals in aggregate
# initializers. All other compilers accept this, though.