Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -548,6 +548,16 @@ filter_available_targets(SAFESTACK_SUPPORTED_ARCH ${ALL_SAFESTACK_SUPPORTED_ARCH}) filter_available_targets(CFI_SUPPORTED_ARCH ${ALL_CFI_SUPPORTED_ARCH}) + + # Disable all tsan builds if the default target is not supported. + # This works around two problems: + # * A tsan'd libcxx is configured despite -fsanitize-thread not being + # supported. This configure step then fails. + # * The check-tsan target tests the default target despite not having built it. + list(FIND TSAN_SUPPORTED_ARCH ${COMPILER_RT_DEFAULT_TARGET_ARCH} ARCH_INDEX) + if(ARCH_INDEX EQUAL -1) + set(TSAN_SUPPORTED_ARCH) + endif() endif() if (MSVC)