From b2acbbc67b6bd46a7194359aca99d5696abb43a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mokijewski?= Date: Fri, 22 Jun 2018 02:33:15 +0200 Subject: [PATCH 1/2] fix undefined_arch error in Xcode 10 beta --- scripts/ios-configure-glog.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/ios-configure-glog.sh b/scripts/ios-configure-glog.sh index e6a15febb90760..9509bd4c447d23 100755 --- a/scripts/ios-configure-glog.sh +++ b/scripts/ios-configure-glog.sh @@ -2,7 +2,19 @@ set -e PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}" -CURRENT_ARCH="${CURRENT_ARCH:-armv7}" +CURRENT_ARCH="${CURRENT_ARCH}" + +if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then + # Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg. + # it's better to rely on platform name as fallback because architecture differs between simulator and device + + if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then + CURRENT_ARCH="x86_64" + else + # arm64 is the current CPU architecture (since the iPhone 5S) + CURRENT_ARCH="arm64" + fi +fi export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)" export CXX="$CC" From 7fbf201aa0fb30e136f2a1bb1448de4549b28d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mokijewski?= Date: Mon, 25 Jun 2018 09:06:35 +0200 Subject: [PATCH 2/2] use armv7 as fallback architecture everything that runs iOS 8 should be supported so we cannot use arm64. arm64 is backward compatible with armv7 --- scripts/ios-configure-glog.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/ios-configure-glog.sh b/scripts/ios-configure-glog.sh index 9509bd4c447d23..3840fc4ebc719c 100755 --- a/scripts/ios-configure-glog.sh +++ b/scripts/ios-configure-glog.sh @@ -11,8 +11,7 @@ if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then CURRENT_ARCH="x86_64" else - # arm64 is the current CPU architecture (since the iPhone 5S) - CURRENT_ARCH="arm64" + CURRENT_ARCH="armv7" fi fi