Skip to content

Commit

Permalink
[compiler-rt][CMake] Remove unused -stdlib when passing -nostdinc++
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jinsong Ji committed Jul 24, 2020
1 parent 4dc3014 commit 3554cf4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler-rt/lib/profile/CMakeLists.txt
Expand Up @@ -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.
Expand Down

0 comments on commit 3554cf4

Please sign in to comment.