Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -225,6 +225,17 @@ # Warnings to turn off for all libraries, not just sanitizers. append_string_if(COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG -Wno-unused-parameter CMAKE_C_FLAGS CMAKE_CXX_FLAGS) +if (CMAKE_LINKER MATCHES "link.exe$") + # We put empty object files in archives, which causes MSVC's linker to + # complain about these objects not defining any previously undefined + # symbols. Since we do it on purpose, this only creates noise during + # the build process, so we suppress the warnings here. Ideally, we would + # pass this flag only for the libraries that need it, but CMake doesn't + # seem to have a way to set linker flags for individual static libraries, + # so we enable the suppression flag for the whole compiler-rt project. + append("/IGNORE:4221" CMAKE_STATIC_LINKER_FLAGS) +endif() + add_subdirectory(include) set(COMPILER_RT_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/projects/libcxx)