Skip to content

Commit b87b263

Browse files
committed
Bump the deployment target for the compiler to macOS 13.0
Bump the deployment target from macOS 10.13-aligned versions to macOS 13.0-aligned versions. This allows us to stop linking CoreFoundation in the swift runtime, which was previously required for availability checking. It also lets us align the deployment target on x86_64 with arm64, which was 11.0. Finally, it is a prerequisite to being able to build swift using the macOS 15 beta SDKs. (cherry picked from commit ad82d86) (cherry picked from commit cd71e31)
1 parent c90b291 commit b87b263

File tree

10 files changed

+36
-25
lines changed

10 files changed

+36
-25
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,16 +556,16 @@ option(SWIFT_ALLOW_LINKING_SWIFT_CONTENT_IN_DARWIN_TOOLCHAIN
556556
This is needed to support Apple internal configurations."
557557
FALSE)
558558

559-
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "10.13" CACHE STRING
559+
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "13.0" CACHE STRING
560560
"Minimum deployment target version for OS X")
561561

562-
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS "11.0" CACHE STRING
562+
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS "16.0" CACHE STRING
563563
"Minimum deployment target version for iOS")
564564

565-
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS "11.0" CACHE STRING
565+
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS "16.0" CACHE STRING
566566
"Minimum deployment target version for tvOS")
567567

568-
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "4.0" CACHE STRING
568+
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "9.0" CACHE STRING
569569
"Minimum deployment target version for watchOS")
570570

571571
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_XROS "1.0" CACHE STRING

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ macro(configure_sdks_darwin)
110110
set(appletvos_arch "arm64")
111111
set(watchos_arch "armv7k" "arm64_32")
112112

113-
set(macosx_ver "10.13")
114-
set(iphoneos_ver "11.0")
115-
set(appletvos_ver "11.0")
116-
set(watchos_ver "4.0")
113+
set(macosx_ver "13.0")
114+
set(iphoneos_ver "16.0")
115+
set(appletvos_ver "16.0")
116+
set(watchos_ver "9.0")
117117

118118
set(macosx_vendor "apple")
119119
set(iphoneos_vendor "apple")

cmake/modules/DarwinSDKs.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ set(SUPPORTED_OSX_ARCHS "x86_64;arm64")
1818
set(SUPPORTED_XROS_ARCHS "arm64;arm64e")
1919
set(SUPPORTED_XROS_SIMULATOR_ARCHS "arm64")
2020

21+
if(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS VERSION_GREATER_EQUAL 7.0)
22+
list(REMOVE_ITEM SUPPORTED_WATCHOS_SIMULATOR_ARCHS "i386")
23+
endif()
24+
if(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS VERSION_GREATER_EQUAL 9.0)
25+
list(REMOVE_ITEM SUPPORTED_WATCHOS_ARCHS "armv7k")
26+
endif()
27+
2128
is_sdk_requested(OSX swift_build_osx)
2229
if(swift_build_osx)
2330
configure_sdk_darwin(

test/embedded/lit.local.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ config.substitutions = list(config.substitutions)
44
if config.target_sdk_name == 'macosx':
55
def do_fixup(key, value):
66
if isinstance(value, str):
7-
value = value.replace("-apple-macosx10.13", "-apple-macos14")
7+
value = value.replace("-apple-macosx13.0", "-apple-macos14")
88
elif isinstance(value, SubstituteCaptures):
9-
value.substitution = value.substitution.replace("-apple-macosx10.13", "-apple-macos14")
9+
value.substitution = value.substitution.replace("-apple-macosx13.0", "-apple-macos14")
1010
return (key, value)
1111

1212
config.substitutions = [do_fixup(a, b) for (a, b) in config.substitutions]

utils/build-presets.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ build-ninja
695695
# to LLVM_USE_RUNTIMES to build compiler-rt (#60993), so we can leverage
696696
# the value for SANITIZER_MIN_OSX_VERSION set in cmake_product.py
697697
extra-cmake-options=
698-
-DCLANG_COMPILER_RT_CMAKE_ARGS:STRING="-DSANITIZER_MIN_OSX_VERSION:STRING=10.13"
698+
-DCLANG_COMPILER_RT_CMAKE_ARGS:STRING="-DSANITIZER_MIN_OSX_VERSION:STRING=13.0"
699699

700700
# Do not build swift or cmark
701701
skip-build-swift

utils/build-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def apply_default_arguments(toolchain, args):
424424
for target in targets
425425
if (not target.platform.is_darwin or
426426
target.platform.sdk_supports_architecture(
427-
target.arch, args.darwin_xcrun_toolchain))
427+
target.arch, args.darwin_xcrun_toolchain, args))
428428
]
429429

430430
# Include the Darwin module-only architectures in the CMake options.

utils/build-script-impl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ KNOWN_SETTINGS=(
101101

102102
## Darwin Options
103103
darwin-crash-reporter-client "" "whether to enable CrashReporter integration, default is 1 on Darwin platforms, 0 otherwise"
104-
darwin-deployment-version-ios "11.0" "minimum deployment target version for iOS"
105-
darwin-deployment-version-osx "10.13" "minimum deployment target version for OS X"
106-
darwin-deployment-version-tvos "11.0" "minimum deployment target version for tvOS"
107-
darwin-deployment-version-watchos "4.0" "minimum deployment target version for watchOS"
104+
darwin-deployment-version-ios "16.0" "minimum deployment target version for iOS"
105+
darwin-deployment-version-osx "13.0" "minimum deployment target version for OS X"
106+
darwin-deployment-version-tvos "16.0" "minimum deployment target version for tvOS"
107+
darwin-deployment-version-watchos "9.0" "minimum deployment target version for watchOS"
108108
darwin-deployment-version-xros "1.0" "minimum deployment target version for xrOS"
109109
darwin-install-extract-symbols "" "whether to extract symbols with dsymutil during installations"
110110
darwin-install-extract-symbols-use-just-built-dsymutil "1" "whether we should extract symbols using the just built dsymutil"

utils/build_swift/build_swift/defaults.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
SWIFT_ANALYZE_CODE_COVERAGE = 'false'
5353

5454
DARWIN_XCRUN_TOOLCHAIN = 'default'
55-
DARWIN_DEPLOYMENT_VERSION_OSX = '10.13'
56-
DARWIN_DEPLOYMENT_VERSION_IOS = '11.0'
57-
DARWIN_DEPLOYMENT_VERSION_TVOS = '11.0'
58-
DARWIN_DEPLOYMENT_VERSION_WATCHOS = '4.0'
55+
DARWIN_DEPLOYMENT_VERSION_OSX = '13.0'
56+
DARWIN_DEPLOYMENT_VERSION_IOS = '16.0'
57+
DARWIN_DEPLOYMENT_VERSION_TVOS = '16.0'
58+
DARWIN_DEPLOYMENT_VERSION_WATCHOS = '9.0'
5959
DARWIN_DEPLOYMENT_VERSION_XROS = '1.0'
6060

6161
UNIX_INSTALL_PREFIX = '/usr'

utils/gyb_foundation_support.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def ObjectiveCBridgeableImplementationForNSValue(Type):
1212
_getObjCTypeEncoding({Type}.self)) == 0,
1313
"NSValue does not contain the right type to bridge to {Type}")
1414
result = {Type}()
15-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {{
15+
if #available(OSX 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) {{
1616
source.getValue(&result!, size: MemoryLayout<{Type}>.size)
1717
}} else {{
1818
source.getValue(&result!)
@@ -27,7 +27,7 @@ def ObjectiveCBridgeableImplementationForNSValue(Type):
2727
return false
2828
}}
2929
result = {Type}()
30-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {{
30+
if #available(OSX 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) {{
3131
source.getValue(&result!, size: MemoryLayout<{Type}>.size)
3232
}} else {{
3333
source.getValue(&result!)
@@ -42,7 +42,7 @@ def ObjectiveCBridgeableImplementationForNSValue(Type):
4242
_getObjCTypeEncoding({Type}.self)) == 0,
4343
"NSValue does not contain the right type to bridge to {Type}")
4444
var result = {Type}()
45-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {{
45+
if #available(OSX 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) {{
4646
unwrappedSource.getValue(&result, size: MemoryLayout<{Type}>.size)
4747
}} else {{
4848
unwrappedSource.getValue(&result)

utils/swift_build_support/swift_build_support/targets.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
import os
1212
import platform
1313

14+
1415
from . import cmake
1516
from . import shell
1617

1718
try:
19+
from build_swift.build_swift.versions import Version
1820
from build_swift.build_swift.wrappers import xcrun
1921
except ImportError:
22+
from build_swift.versions import Version
2023
from build_swift.wrappers import xcrun
2124

2225

@@ -113,7 +116,7 @@ def uses_host_tests(self):
113116
"""
114117
return self.is_embedded and not self.is_simulator
115118

116-
def sdk_supports_architecture(self, arch, toolchain):
119+
def sdk_supports_architecture(self, arch, toolchain, args):
117120
"""
118121
Convenience function for checking whether the SDK supports the
119122
target architecture.
@@ -122,7 +125,8 @@ def sdk_supports_architecture(self, arch, toolchain):
122125
# The names match up with the xcrun SDK names.
123126
xcrun_sdk_name = self.name
124127

125-
if (xcrun_sdk_name == 'watchos' and arch == 'armv7k'):
128+
if (xcrun_sdk_name == 'watchos' and arch == 'armv7k' and
129+
Version(args.darwin_deployment_version_watchos) < Version('9.0')):
126130
return True
127131

128132
sdk_path = xcrun.sdk_path(sdk=xcrun_sdk_name, toolchain=toolchain)

0 commit comments

Comments
 (0)