[compiler-rt] r240688 - [Sanitizer] Set minimum supported Mac OS X version to 10.9, if it wasn't specified explicitly.

Alexey Samsonov vonosmas at gmail.com
Thu Jun 25 13:43:35 PDT 2015


Author: samsonov
Date: Thu Jun 25 15:43:35 2015
New Revision: 240688

URL: http://llvm.org/viewvc/llvm-project?rev=240688&view=rev
Log:
[Sanitizer] Set minimum supported Mac OS X version to 10.9, if it wasn't specified explicitly.

-fsanitize=vptr is a UBSan feature that doesn't work on older Mac OS X
versions, and we don't want to penalize users that use modern OS with
default configuration. Those who want to target older OS versions, can
specify that versions explicitly.

Modified:
    compiler-rt/trunk/CMakeLists.txt

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=240688&r1=240687&r2=240688&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Thu Jun 25 15:43:35 2015
@@ -297,17 +297,19 @@ if(APPLE)
          MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}")
   if(MACOSX_VERSION_MIN_FLAG)
     set(SANITIZER_MIN_OSX_VERSION "${CMAKE_MATCH_1}")
-    if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7")
-      message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}")
-    endif()
+  elseif(CMAKE_OSX_DEPLOYMENT_TARGET)
+    set(SANITIZER_MIN_OSX_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET})
   else()
-    set(SANITIZER_MIN_OSX_VERSION 10.7)
+    set(SANITIZER_MIN_OSX_VERSION 10.9)
     if(IOSSIM_SDK_DIR)
       list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim)
     endif()
   endif()
+  if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7")
+    message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}")
+  endif()
 
-  set(CMAKE_OSX_DEPLOYMENT_TARGET "") # We're setting the flag manually below.
+  set(CMAKE_OSX_DEPLOYMENT_TARGET "") # We evaluate target OS X version above.
   set(DARWIN_osx_CFLAGS -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}
     -stdlib=libc++)
   set(DARWIN_iossim_CFLAGS





More information about the llvm-commits mailing list