[PATCH] [compiler-rt] Fix OS X build failure with Command Line Tools and without full Xcode installation

Kuba Brecka kuba.brecka at gmail.com
Sat Feb 14 08:31:51 PST 2015


On OS X, if you don't have a full Xcode installation, but just the Command Line Tools package, xcrun and xcodebuild don't return a valid SDK root path.  In these cases, let's use "/" as the SDK root (which is where the headers and libraries are installed).

See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150202/256851.html.

http://reviews.llvm.org/D7641

Files:
  CMakeLists.txt
  make/platform/clang_darwin.mk

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -295,6 +295,9 @@
   string(REGEX MATCH "-mmacosx-version-min="
          MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}")
   set(SANITIZER_COMMON_SUPPORTED_DARWIN_OS osx)
+  if (NOT OSX_SDK_DIR) # Probably a Command Line Tools setup
+    set(OSX_SDK_DIR "/")
+  endif()
   if (IOSSIM_SDK_DIR AND NOT MACOSX_VERSION_MIN_FLAG)
     list(APPEND SANITIZER_COMMON_SUPPORTED_DARWIN_OS iossim)
   endif()
Index: make/platform/clang_darwin.mk
===================================================================
--- make/platform/clang_darwin.mk
+++ make/platform/clang_darwin.mk
@@ -64,6 +64,9 @@
 DSYMUTIL := $(call XCRun,dsymutil)
 
 OSX_SDK := $(call XCRunSdkPath,macosx)
+ifeq ($(OSX_SDK),)
+OSX_SDK := /
+endif
 IOS_SDK := $(call XCRunSdkPath,iphoneos)
 IOSSIM_SDK := $(call XCRunSdkPath,iphonesimulator)

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7641.19965.patch
Type: text/x-patch
Size: 932 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150214/2dd33a8d/attachment.bin>


More information about the llvm-commits mailing list