From 44256db8243ab43df7332e1a867be5b33919a3a3 Mon Sep 17 00:00:00 2001 From: Sergey Bogolepov Date: Thu, 15 Jul 2021 12:56:34 +0700 Subject: [PATCH] [K/N] Update minimal Xcode version The next LLVM version will be 11.1.0, and we need to be sure that Xcode supports bitcode of this version. So we bump minimal Xcode version to 12.5, which should be OK, because by the time Kotlin 1.6.0 comes out, Xcode 12.5 will be around 6 month old. Also this commit simplifies tarball naming. --- kotlin-native/README.md | 4 +- kotlin-native/konan/konan.properties | 127 ++++++++++---------- kotlin-native/tools/scripts/update_xcode.sh | 20 +-- 3 files changed, 74 insertions(+), 77 deletions(-) diff --git a/kotlin-native/README.md b/kotlin-native/README.md index d890b7362fe..6eca020325f 100644 --- a/kotlin-native/README.md +++ b/kotlin-native/README.md @@ -27,7 +27,7 @@ More information can be found in the overviews of [Kotlin/Native](https://kotlinlang.org/docs/native-overview.html) and [Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatform.html). -On macOS Kotlin/Native requires Xcode 11 or newer. +On macOS Kotlin/Native requires Xcode 12.5 or newer. ## Building from source @@ -35,7 +35,7 @@ Prerequisites: * configure Kotlin build as [specified in main readme](../ReadMe.md#build-environment-requirements) * at the root directory of the repository, create `local.properties` file with `kotlin.native.enabled=true` line -* on macOS install Xcode 12 or newer +* on macOS install Xcode 12.5 or newer * on Fedora 26+ ```yum install ncurses-compat-libs``` may be needed * on recent Ubuntu ```apt install libncurses5``` is needed diff --git a/kotlin-native/konan/konan.properties b/kotlin-native/konan/konan.properties index 920128b6142..6e2670dc129 100644 --- a/kotlin-native/konan/konan.properties +++ b/kotlin-native/konan/konan.properties @@ -26,7 +26,7 @@ airplaneMode = false # if true, ignores Xcode version check. ignoreXcodeVersionCheck = false -minimalXcodeVersion=11.0 +minimalXcodeVersion=12.5 downloadingAttempts = 10 downloadingAttemptIntervalMs = 3000 @@ -99,14 +99,14 @@ optInCacheableTargets = \ # Mac OS X. # Can be an absolute path instead of predefined value. llvmHome.macos_x64 = $llvm.macos_x64.dev -targetToolchain.macos_x64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64 = target-toolchain-xcode_12_5 libffiDir.macos_x64 = libffi-3.2.1-3-darwin-macos -additionalToolsDir.macos_x64 = xcode-addon-xcode_12_2-macos_x64 +additionalToolsDir.macos_x64 = xcode-addon-xcode_12_5 -targetToolchain.macos_arm64-macos_x64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_arm64-macos_x64 = target-toolchain-xcode_12_5 targetTriple.macos_x64 = x86_64-apple-macos -targetSysRoot.macos_x64 = target-sysroot-xcode_12_2-macos_x64 +targetSysRoot.macos_x64 = target-sysroot-xcode_12_5-macosx targetCpu.macos_x64 = core2 clangFlags.macos_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir clangNooptFlags.macos_x64 = -O1 @@ -126,24 +126,24 @@ runtimeDefinitions.macos_x64 = KONAN_OSX=1 KONAN_MACOSX=1 KONAN_X64=1 KONAN_OBJC dependencies.macos_x64 = \ lldb-4-macos -target-sysroot-xcode_12_2-macos_x64.default = \ +target-sysroot-xcode_12_5-macosx.default = \ remote:internal -target-toolchain-xcode_12_2-macos_x64.default = \ +target-toolchain-xcode_12_5.default = \ remote:internal -xcode-addon-xcode_12_2-macos_x64.default = \ +xcode-addon-xcode_12_5.default = \ remote:internal # macOS Apple Silicon llvmHome.macos_arm64 = $llvm.macos_arm64.dev -targetToolchain.macos_arm64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_arm64 = target-toolchain-xcode_12_5 libffiDir.macos_arm64 = libffi-3.3-1-macos-arm64 -additionalToolsDir.macos_arm64 = xcode-addon-xcode_12_2-macos_x64 +additionalToolsDir.macos_arm64 = xcode-addon-xcode_12_5 -targetToolchain.macos_x64-macos_arm64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-macos_arm64 = target-toolchain-xcode_12_5 targetTriple.macos_arm64 = arm64-apple-macos -targetSysRoot.macos_arm64 = target-sysroot-xcode_12_2-macos_x64 +targetSysRoot.macos_arm64 = target-sysroot-xcode_12_5-macosx # TODO: Check Clang behaviour. targetCpu.macos_arm64 = cyclone clangFlags.macos_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir @@ -167,25 +167,25 @@ dependencies.macos_arm64 = \ lldb-4-macos -target-sysroot-xcode_12_2-macos_arm64.default = \ +target-sysroot-xcode_12_5-macos_arm64.default = \ remote:internal -target-toolchain-xcode_12_2-macos_arm64.default = \ +target-toolchain-xcode_12_5-macos_arm64.default = \ remote:internal -xcode-addon-xcode_12_2-macos_arm64.default = \ +xcode-addon-xcode_12_5-macos_arm64.default = \ remote:internal # Apple's 32-bit iOS. -targetToolchain.macos_x64-ios_arm32 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-ios_arm32 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-ios_arm32 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-ios_arm32 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-ios_arm32.default = \ +target-sysroot-xcode_12_5-ios_arm32.default = \ remote:internal targetTriple.ios_arm32 = armv7-apple-ios # Shared with 64-bit version. -targetSysRoot.ios_arm32 = target-sysroot-xcode_12_2-ios_arm64 +targetSysRoot.ios_arm32 = target-sysroot-xcode_12_5-iphoneos targetCpu.ios_arm32 = generic clangFlags.ios_arm32 = -cc1 -emit-obj -disable-llvm-optzns -x ir clangNooptFlags.ios_arm32 = -O1 @@ -208,14 +208,14 @@ runtimeDefinitions.ios_arm32 = KONAN_OBJC_INTEROP=1 KONAN_IOS KONAN_ARM32=1 \ KONAN_NO_64BIT_ATOMIC=1 KONAN_NO_UNALIGNED_ACCESS=1 # Apple's 64-bit iOS. -targetToolchain.macos_x64-ios_arm64 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-ios_arm64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-ios_arm64 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-ios_arm64 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-ios_arm64.default = \ +target-sysroot-xcode_12_5-iphoneos.default = \ remote:internal targetTriple.ios_arm64 = arm64-apple-ios -targetSysRoot.ios_arm64 = target-sysroot-xcode_12_2-ios_arm64 +targetSysRoot.ios_arm64 = target-sysroot-xcode_12_5-iphoneos targetCpu.ios_arm64 = cyclone clangFlags.ios_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir clangNooptFlags.ios_arm64 = -O1 @@ -237,14 +237,14 @@ runtimeDefinitions.ios_arm64 = KONAN_OBJC_INTEROP=1 KONAN_IOS=1 KONAN_ARM64=1 \ additionalCacheFlags.ios_arm64 = -Xembed-bitcode-marker # Apple's iOS simulator. -targetToolchain.macos_x64-ios_x64 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-ios_x64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-ios_x64 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-ios_x64 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-ios_x64.default = \ +target-sysroot-xcode_12_5-iphonesimulator.default = \ remote:internal targetTriple.ios_x64 = x86_64-apple-ios-simulator -targetSysRoot.ios_x64 = target-sysroot-xcode_12_2-ios_x64 +targetSysRoot.ios_x64 = target-sysroot-xcode_12_5-iphonesimulator targetCpu.ios_x64 = core2 clangFlags.ios_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir clangNooptFlags.ios_x64 = -O1 @@ -263,14 +263,14 @@ runtimeDefinitions.ios_x64 = KONAN_OBJC_INTEROP=1 KONAN_IOS=1 KONAN_X64=1 \ # iOS simulator on Apple Silicon -targetToolchain.macos_x64-ios_simulator_arm64 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-ios_simulator_arm64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-ios_simulator_arm64 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-ios_simulator_arm64 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-ios_simulator_arm64.default = \ +target-sysroot-xcode_12_5-ios_simulator_arm64.default = \ remote:internal targetTriple.ios_simulator_arm64 = arm64-apple-ios-simulator -targetSysRoot.ios_simulator_arm64 = target-sysroot-xcode_12_2-ios_x64 +targetSysRoot.ios_simulator_arm64 = target-sysroot-xcode_12_5-iphonesimulator targetCpu.ios_simulator_arm64 = cyclone clangFlags.ios_simulator_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir clangNooptFlags.ios_simulator_arm64 = -O1 @@ -288,14 +288,14 @@ runtimeDefinitions.ios_simulator_arm64 = KONAN_OBJC_INTEROP=1 KONAN_IOS=1 KONAN_ KONAN_CORE_SYMBOLICATION=1 # Apple's tvOS simulator. -targetToolchain.macos_x64-tvos_x64 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-tvos_x64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-tvos_x64 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-tvos_x64 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-tvos_x64.default = \ +target-sysroot-xcode_12_5-appletvsimulator.default = \ remote:internal targetTriple.tvos_x64 = x86_64-apple-tvos-simulator -targetSysRoot.tvos_x64 = target-sysroot-xcode_12_2-tvos_x64 +targetSysRoot.tvos_x64 = target-sysroot-xcode_12_5-appletvsimulator targetCpu.tvos_x64 = core2 clangFlags.tvos_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir -target-cpu $targetCpu.tvos_x64 clangNooptFlags.tvos_x64 = -O1 @@ -313,14 +313,14 @@ runtimeDefinitions.tvos_x64 = KONAN_OBJC_INTEROP=1 KONAN_TVOS=1 KONAN_X64=1 \ KONAN_CORE_SYMBOLICATION=1 # Apple's tvOS simulator. -targetToolchain.macos_x64-tvos_simulator_arm64 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-tvos_simulator_arm64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-tvos_simulator_arm64 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-tvos_simulator_arm64 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-tvos_simulator_arm64.default = \ +target-sysroot-xcode_12_5-tvos_simulator_arm64.default = \ remote:internal targetTriple.tvos_simulator_arm64 = arm64-apple-tvos-simulator -targetSysRoot.tvos_simulator_arm64 = target-sysroot-xcode_12_2-tvos_x64 +targetSysRoot.tvos_simulator_arm64 = target-sysroot-xcode_12_5-appletvsimulator targetCpu.tvos_simulator_arm64 = cyclone clangFlags.tvos_simulator_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir clangNooptFlags.tvos_simulator_arm64 = -O1 @@ -338,14 +338,14 @@ runtimeDefinitions.tvos_simulator_arm64 = KONAN_OBJC_INTEROP=1 KONAN_TVOS=1 KONA KONAN_CORE_SYMBOLICATION=1 # Apple's 64-bit tvOS. -targetToolchain.macos_x64-tvos_arm64 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-tvos_arm64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-tvos_arm64 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-tvos_arm64 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-tvos_arm64.default = \ +target-sysroot-xcode_12_5-appletvos.default = \ remote:internal targetTriple.tvos_arm64 = arm64-apple-tvos -targetSysRoot.tvos_arm64 = target-sysroot-xcode_12_2-tvos_arm64 +targetSysRoot.tvos_arm64 = target-sysroot-xcode_12_5-appletvos targetCpu.tvos_arm64 = cyclone clangFlags.tvos_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir clangNooptFlags.tvos_arm64 = -O1 @@ -363,14 +363,14 @@ runtimeDefinitions.tvos_arm64 = KONAN_OBJC_INTEROP=1 KONAN_TVOS=1 KONAN_ARM64=1 KONAN_REPORT_BACKTRACE_TO_IOS_CRASH_LOG=1 MACHSIZE=64 # watchOS armv7k -targetToolchain.macos_x64-watchos_arm32 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-watchos_arm32 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-watchos_arm32 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-watchos_arm32 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-watchos_arm32.default = \ +target-sysroot-xcode_12_5-watchos.default = \ remote:internal targetTriple.watchos_arm32 = armv7k-apple-watchos -targetSysRoot.watchos_arm32 = target-sysroot-xcode_12_2-watchos_arm32 +targetSysRoot.watchos_arm32 = target-sysroot-xcode_12_5-watchos targetCpu.watchos_arm32 = cortex-a7 clangFlags.watchos_arm32 = -cc1 -emit-obj -disable-llvm-passes -x ir clangNooptFlags.watchos_arm32 = -O1 @@ -390,14 +390,11 @@ runtimeDefinitions.watchos_arm32 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS KONAN_ARM3 MACHSIZE=32 KONAN_NO_64BIT_ATOMIC=1 KONAN_NO_UNALIGNED_ACCESS=1 # watchOS arm64_32 -targetToolchain.macos_x64-watchos_arm64 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-watchos_arm64 = target-toolchain-xcode_12_2-macos_x64 - -target-sysroot-xcode_12_2-watchos_arm64.default = \ - remote:internal +targetToolchain.macos_x64-watchos_arm64 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-watchos_arm64 = target-toolchain-xcode_12_5 targetTriple.watchos_arm64 = arm64_32-apple-watchos -targetSysRoot.watchos_arm64 = target-sysroot-xcode_12_2-watchos_arm32 +targetSysRoot.watchos_arm64 = target-sysroot-xcode_12_5-watchos targetCpu.watchos_arm64 = cortex-a7 clangFlags.watchos_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir -mllvm -aarch64-watch-bitcode-compatibility \ -mllvm -arm-bitcode-compatibility -mllvm -fast-isel=false -mllvm -global-isel=false @@ -418,14 +415,14 @@ runtimeDefinitions.watchos_arm64 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS KONAN_ARM3 MACHSIZE=32 KONAN_NO_64BIT_ATOMIC=1 KONAN_NO_UNALIGNED_ACCESS=1 # Apple's watchOS i386 simulator. -targetToolchain.macos_x64-watchos_x86 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-watchos_x86 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-watchos_x86 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-watchos_x86 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-watchos_x86.default = \ +target-sysroot-xcode_12_5-watchsimulator.default = \ remote:internal targetTriple.watchos_x86 = i386-apple-watchos-simulator -targetSysRoot.watchos_x86 = target-sysroot-xcode_12_2-watchos_x86 +targetSysRoot.watchos_x86 = target-sysroot-xcode_12_5-watchsimulator # -target-cpu pentium4 makes sure that code-generator knows which CPU flavour to emit code for. # Can be seen on optimized build and FP tests, where value is passed on stack # by Kotlin and taken from SSE registers by C code. @@ -447,14 +444,14 @@ runtimeDefinitions.watchos_x86 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS=1 KONAN_NO_6 KONAN_X86=1 KONAN_CORE_SYMBOLICATION=1 # watchOS x86_64 simulator. -targetToolchain.macos_x64-watchos_x64 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-watchos_x64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-watchos_x64 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-watchos_x64 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-watchos_x64.default = \ +target-sysroot-xcode_12_5-watchos_x64.default = \ remote:internal targetTriple.watchos_x64 = x86_64-apple-watchos-simulator -targetSysRoot.watchos_x64 = target-sysroot-xcode_12_2-watchos_x86 +targetSysRoot.watchos_x64 = target-sysroot-xcode_12_5-watchsimulator targetCpu.watchos_x64 = core2 clangFlags.watchos_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir -target-cpu $targetCpu.watchos_x64 clangNooptFlags.watchos_x64 = -O1 @@ -472,14 +469,14 @@ runtimeDefinitions.watchos_x64 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS=1 \ KONAN_X64=1 KONAN_CORE_SYMBOLICATION=1 # watchOS Apple Silicon simulator. -targetToolchain.macos_x64-watchos_simulator_arm64 = target-toolchain-xcode_12_2-macos_x64 -targetToolchain.macos_arm64-watchos_simulator_arm64 = target-toolchain-xcode_12_2-macos_x64 +targetToolchain.macos_x64-watchos_simulator_arm64 = target-toolchain-xcode_12_5 +targetToolchain.macos_arm64-watchos_simulator_arm64 = target-toolchain-xcode_12_5 -target-sysroot-xcode_12_2-watchos_simulator_arm64.default = \ +target-sysroot-xcode_12_5-watchos_simulator_arm64.default = \ remote:internal targetTriple.watchos_simulator_arm64 = arm64-apple-watchos-simulator -targetSysRoot.watchos_simulator_arm64 = target-sysroot-xcode_12_2-watchos_x86 +targetSysRoot.watchos_simulator_arm64 = target-sysroot-xcode_12_5-watchsimulator targetCpu.watchos_simulator_arm64 = cyclone clangFlags.watchos_simulator_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir clangNooptFlags.watchos_simulator_arm64 = -O1 diff --git a/kotlin-native/tools/scripts/update_xcode.sh b/kotlin-native/tools/scripts/update_xcode.sh index 5952c7fe634..c1cc248dc2f 100755 --- a/kotlin-native/tools/scripts/update_xcode.sh +++ b/kotlin-native/tools/scripts/update_xcode.sh @@ -2,17 +2,17 @@ set -e # "brew install coreutils" for grealpath. -KONAN_TOOLCHAIN_VERSION=xcode_12_2 +KONAN_TOOLCHAIN_VERSION=xcode_12_5 SDKS="macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator" -TARBALL_macosx=target-sysroot-$KONAN_TOOLCHAIN_VERSION-macos_x64 -TARBALL_iphoneos=target-sysroot-$KONAN_TOOLCHAIN_VERSION-ios_arm64 -TARBALL_iphonesimulator=target-sysroot-$KONAN_TOOLCHAIN_VERSION-ios_x64 -TARBALL_appletvos=target-sysroot-$KONAN_TOOLCHAIN_VERSION-tvos_arm64 -TARBALL_appletvsimulator=target-sysroot-$KONAN_TOOLCHAIN_VERSION-tvos_x64 -TARBALL_watchos=target-sysroot-$KONAN_TOOLCHAIN_VERSION-watchos_arm32 -TARBALL_watchsimulator=target-sysroot-$KONAN_TOOLCHAIN_VERSION-watchos_x86 -TARBALL_xcode=target-toolchain-$KONAN_TOOLCHAIN_VERSION-macos_x64 -TARBALL_xcode_addon=xcode-addon-$KONAN_TOOLCHAIN_VERSION-macos_x64 +TARBALL_macosx=target-sysroot-$KONAN_TOOLCHAIN_VERSION-macosx +TARBALL_iphoneos=target-sysroot-$KONAN_TOOLCHAIN_VERSION-iphoneos +TARBALL_iphonesimulator=target-sysroot-$KONAN_TOOLCHAIN_VERSION-iphonesimulator +TARBALL_appletvos=target-sysroot-$KONAN_TOOLCHAIN_VERSION-appletvos +TARBALL_appletvsimulator=target-sysroot-$KONAN_TOOLCHAIN_VERSION-appletvsimulator +TARBALL_watchos=target-sysroot-$KONAN_TOOLCHAIN_VERSION-watchos +TARBALL_watchsimulator=target-sysroot-$KONAN_TOOLCHAIN_VERSION-watchsimulator +TARBALL_xcode=target-toolchain-$KONAN_TOOLCHAIN_VERSION +TARBALL_xcode_addon=xcode-addon-$KONAN_TOOLCHAIN_VERSION OUT=`pwd` for s in $SDKS; do