1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- function(detect_broken_stack_check_macos_xcode_pairing)
- if (NOT APPLE)
- return()
- endif()
- execute_process(COMMAND sw_vers -productVersion
- OUTPUT_VARIABLE MACOS_VERSION
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- if (MACOS_VERSION VERSION_LESS 10.15)
-
-
-
- return()
- endif()
- execute_process(COMMAND xcodebuild -version
- OUTPUT_VARIABLE XCODE_VERSION
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REGEX MATCH "Xcode [0-9\\.]+" XCODE_VERSION "${XCODE_VERSION}")
- string(REGEX REPLACE "Xcode ([0-9\\.]+)" "\\1" XCODE_VERSION "${XCODE_VERSION}")
- if ((XCODE_VERSION VERSION_EQUAL 11.0) OR
- (XCODE_VERSION VERSION_EQUAL 11.1))
- message(FATAL_ERROR "Detected macOS version: ${MACOS_VERSION} and "
- "Xcode version: ${XCODE_VERSION} which combined exhibit an "
- "-fstack-check bug which can break alignment requirements for at least "
- "AVX instructions as detailed here [1]."
- "\n"
- "This bug affected Xcode 11.0 and 11.1 but only when used with 10.15 "
- "(Catalina), and was fixed in Xcode 11.2. Without the fix in place, "
- "random segfaults will occur in Eigen operations used by Ceres that use "
- "AVX instructions."
- "\n"
- "Please update to at least Xcode 11.2."
- "\n"
- "[1]: https://forums.developer.apple.com/thread/121887")
- endif()
- endfunction()
|