[PATCH] D74501: [TSan] Add CMake check for minimal SDK requirements on Darwin

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 10:54:59 PST 2020


yln updated this revision to Diff 246787.
yln added a comment.

Add comment explaining that we use macOS to check aligned SDK versions.  Improve error message.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74501/new/

https://reviews.llvm.org/D74501

Files:
  compiler-rt/lib/tsan/CMakeLists.txt


Index: compiler-rt/lib/tsan/CMakeLists.txt
===================================================================
--- compiler-rt/lib/tsan/CMakeLists.txt
+++ compiler-rt/lib/tsan/CMakeLists.txt
@@ -114,6 +114,14 @@
 add_compiler_rt_component(tsan)
 
 if(APPLE)
+  # Ideally we would check the SDK version for the actual platform we are
+  # building for here.  To make our lifes easier we assume the host SDK setup is
+  # sane and use the macOS SDK version as a proxy for aligned SDKs.
+  find_darwin_sdk_version(macosx_sdk_version "macosx")
+  if ("${macosx_sdk_version}" VERSION_LESS 10.12)
+    message(FATAL_ERROR "Building the TSan runtime requires at least macOS SDK 10.12 (or aligned SDK on other platforms)")
+  endif()
+
   add_asm_sources(TSAN_ASM_SOURCES rtl/tsan_rtl_amd64.S rtl/tsan_rtl_aarch64.S)
 
   set(TSAN_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74501.246787.patch
Type: text/x-patch
Size: 864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200226/680a5085/attachment.bin>


More information about the llvm-commits mailing list