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

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 14:04:54 PDT 2020


Author: Jinsong Ji
Date: 2020-07-24T21:04:40Z
New Revision: 3554cf4f382c7f18beb1265f5199651470c438d8

URL: https://github.com/llvm/llvm-project/commit/3554cf4f382c7f18beb1265f5199651470c438d8
DIFF: https://github.com/llvm/llvm-project/commit/3554cf4f382c7f18beb1265f5199651470c438d8.diff

LOG: [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

Added: 
    

Modified: 
    compiler-rt/lib/profile/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/profile/CMakeLists.txt b/compiler-rt/lib/profile/CMakeLists.txt
index 5ff0e10182b4..a968009f9ea9 100644
--- a/compiler-rt/lib/profile/CMakeLists.txt
+++ b/compiler-rt/lib/profile/CMakeLists.txt
@@ -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.


        


More information about the llvm-commits mailing list