Index: compiler-rt/trunk/lib/fuzzer/CMakeLists.txt =================================================================== --- compiler-rt/trunk/lib/fuzzer/CMakeLists.txt +++ compiler-rt/trunk/lib/fuzzer/CMakeLists.txt @@ -35,6 +35,8 @@ 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) Index: compiler-rt/trunk/lib/msan/tests/CMakeLists.txt =================================================================== --- compiler-rt/trunk/lib/msan/tests/CMakeLists.txt +++ compiler-rt/trunk/lib/msan/tests/CMakeLists.txt @@ -37,6 +37,9 @@ -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