Closed 0e6f8740-1d2a-4afc-85fd-df25c3a603fd closed 1 year ago
Actually, no it won't. In the Leopard case, xcodebuild just spins. It doesn't return the error code for us to check against.
I suspect this might be addressed by:
commit 1ca6b63db98947398999c21f40d5231ec49efc74 Author: Chris Bieneman beanz@apple.com Date: Fri Aug 19 22:22:35 2016 +0000
[CMake] Support building on OS X without Xcode installation
This should resolve llvm/llvm-project#23536 . This patch has two parts.
First we need to check the error code from xcodebuild when querying for SDKs, second if the OS X SDK is not discovered, we ensure that /usr/include exists and use / as the OS X sysroot.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279336 91177308-0d34-0410-b5e6-96231b3b80d8
Old build issue
Extended Description
Leopard's final Xcode version (3.1.4) has a bug whereby executing 'xcodebuild -version -sdk macosx.internal' will spin. This is done as part of the cmake-based build system which prevents the build from happening:
$ pstree -w 00479 -+- 00479 macports sh -c cd "/opt/local/var/macports/build/_Users_jeremy_src_macports_dports_jeremyhu_lang_llvm-3.8/clang-3.8/work/build" && /opt/local/bin/cmake -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_OSX_ARCHITECTURES="x86_64;i386" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_RPATH=/opt/local/lib -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_MODULE_PATH=/opt/local/share/cmake/Modules -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev -DLLVM_BUILD_LLVM_DYLIB=ON -DCMAKE_INSTALL_PREFIX="/opt/local/libexec/llvm-3.8" -DLLVM_ENABLE_RTTI=ON -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_ENABLE_FFI=ON -DFFI_INCLUDE_DIR=/opt/local/include -DFFI_LIBRARY_DIR=/opt/local/lib -DCLANG_INCLUDE_TESTS=OFF -DLLVM_BUILD_RUNTIME=ON -DLIBCXX_INSTALL_LIBRARY=OFF -DLIBCXX_ENABLE_SHARED=OFF -DLLVM_ENABLE_BACKTRACES=OFF -DLLVM_ENABLE_ASSERTIONS=ON -DCLANG_ENABLE_STATIC_ANALYZER=ON -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.5" -DCMAKE_OSX_SYSROOT="/" ../trunk -+- 00485 macports /opt/local/bin/cmake -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_OSX_ARCHITECTURES=x86_64;i386 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_RPATH=/opt/local/lib -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_SYSTEM_PREFIX_PATH=/opt/local;/usr -DCMAKE_MODULE_PATH=/opt/local/share/cmake/Modules -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev -DLLVM_BUILD_LLVM_DYLIB=ON -DCMAKE_INSTALL_PREFIX=/opt/local/libexec/llvm-3.8 -DLLVM_ENABLE_RTTI=ON -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_ENABLE_FFI=ON -DFFI_INCLUDE_DIR=/opt/local/include -DFFI_LIBRARY_DIR=/opt/local/lib -DCLANG_INCLUDE_TESTS=OFF -DLLVM_BUILD_RUNTIME=ON -DLIBCXX_INSTALL_LIBRARY=OFF -DLIBCXX_ENABLE_SHARED=OFF -DLLVM_ENABLE_BACKTRACES=OFF -DLLVM_ENABLE_ASSERTIONS=ON -DCLANG_ENABLE_STATIC_ANALYZER=ON -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_OSX_DEPLOYMENT_TARGET=10.5 -DCMAKE_OSX_SYSROOT=/ ../trunk --- 00524 macports /Developer/usr/bin/xcodebuild -version -sdk macosx.internal Path
This seems to be coming from projects/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake:
function(find_darwin_sdk_dir var sdk_name)
Let's first try the internal SDK, otherwise use the public SDK.
execute_process( COMMAND xcodebuild -version -sdk ${sdk_name}.internal Path OUTPUT_VARIABLE var_internal OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_FILE /dev/null ) if("" STREQUAL "${var_internal}") execute_process( COMMAND xcodebuild -version -sdk ${sdk_name} Path OUTPUT_VARIABLE var_internal OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_FILE /dev/null ) endif() set(${var} ${var_internal} PARENT_SCOPE) endfunction()
It would be good to conditionalize that to only execute on Snow Leopard and later.