[PATCH] D16583: [tsan] If the default target is not supported, don't build other targets either.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 07:59:15 PST 2016


dsanders created this revision.
dsanders added reviewers: dvyukov, hans.
dsanders added a subscriber: llvm-commits.

This is a workaround to a problem in the 3.8 release that affects MIPS and
possibly other targets where the default is not supported but a sibling is
supported.

When TSAN_SUPPORTED_ARCH is not empty, cmake currently attempts to build a
tsan'd libcxx as well as test tsan for the default target regardless of whether
the default target is supported or not. This causes problems on MIPS32 since
tsan is supported for MIPS64 but not MIPS32.

There should be a better way to fix this but my attempts at a better solution
have run into difficulties (mostly related to preventing lit from testing the
default target). This at least solves the problem for now.

PR26278

http://reviews.llvm.org/D16583

Files:
  cmake/config-ix.cmake

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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16583.45993.patch
Type: text/x-patch
Size: 819 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160126/3ff91b66/attachment.bin>


More information about the llvm-commits mailing list