[CMake] Remove -stdlib= which is unused when passing -nostdinc++

This avoids the warnings when building with LLVM_ENABLE_LIBCXX
which automatically adds -stdlib=libc++ to CMAKE_CXX_FLAGS.

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

llvm-svn: 323969
This commit is contained in:
Jonas Hahnfeld 2018-02-01 13:57:24 +00:00
parent 9d9a86535e
commit 44ef345c50
2 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,8 @@ set(LIBFUZZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH)
list(APPEND LIBFUZZER_CFLAGS -nostdinc++ -D_LIBCPP_ABI_VERSION=Fuzzer)
# Remove -stdlib= which is unused when passing -nostdinc++.
string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
endif()
append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer LIBFUZZER_CFLAGS)

View File

@ -37,6 +37,9 @@ set(MSAN_UNITTEST_COMMON_CFLAGS
-Werror=sign-compare
-Wno-gnu-zero-variadic-macro-arguments
)
# Remove -stdlib= which is unused when passing -nostdinc++.
string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(MSAN_UNITTEST_INSTRUMENTED_CFLAGS
${MSAN_UNITTEST_COMMON_CFLAGS}
-fsanitize=memory