Use the `%target-swift-5.1-abi-triple` substitution to compile the tests for
deployment to the minimum OS versions required for use of _Concurrency APIs,
instead of disabling availability checking.
This fixes linker warnings that look like this:
```
ld: warning: object file (libswiftCompatibility56.a) was built for newer 'macOS' version (XYZ) than being linked (ABC)
```
These were caused by the compatibility binary being incorrectly built with a newer `-target` than desired: the CMake logic was overriding the requested minimum macOS deployment version (10.9) with a much newer macOS SDK version.
rdar://137565964
When I did https://github.com/swiftlang/swift/pull/74920 I forgot to update test/Concurrency/Backdeploy/linking_maccatalyst.swift the same way linking.swift got updated.
rdar://132710925
The _Builtin_float symbols were moved twice, most recently from the OS Darwin library, but previously they were in the embedded @rpath Darwin library. @_originallyDefinedIn doesn't support multiple install names, but it can be replaced with -module-abi-name, and then multiple $ld$previous$ symbols can be used.
Update the Platform and Concurrency magic symbols to use $ld$previous$ everywhere.
rdar://130107191
These tests were targeting 10.9 or 10.10, but the minimum deployment target now supported by Xcode is 10.13. Bump them up to match:
test/Concurrency/Backdeploy/linking.swift
test/Concurrency/Backdeploy/linking_maccatalyst.swift
test/Runtime/stable-bit-backward-deployment.swift
* Enable running tests from test/Concurrency/ directory in freestanding/minimal presets
* Mark failing Concurrency tests as XFAIL/SKIP on freestanding/minimal
This patch updates the concurrency backdeployment test to handle the
inclusion of the Swift 5.6 compatibility library.
macOS12 will have the 5.6 library applied to it, so the
_swift_FORCE_LOAD_$_swiftCompatibility56 symbol is defined weakly.
The weakly-imported symbol was getting optimized out, then put back in
as a strongly-imported symbol. This is no good. The symbol is a
declaration though, so it can't be "used" directly. Instead, we assign
it to another global and "use" it. That avoids the optimizations and
should be fine. Even if that symbol is a nullptr because it doesn't
exist, we are taking the pointer to it, which should be fine for all
situations.
This allows applications that back-deploy but only use concurrency in
newer code to load and execute properly, even when the concurrency library
is not available. Fixes rdar://84877644.
@objc actors implicitly inherit from the new, hidden
`SwiftNativeNSObject` class that inherits from `NSObject` yet provides
Swift-native reference counting, which is important for the actor
runtime's handling of zombies. However, `SwiftNativeNSObject` is only
available in the Swift runtime in newer OS versions (e.g., macOS
12.0/iOS 15.0), and is available in the back-deployed _Concurrency
library, but there is no stable place to link against for
back-deployed code. Tricky, tricky.
When back-deploying @objc actors, record `NSObject` as the superclass
in the metadata in the binary, because we cannot reference
`SwiftNativeNSObject`. Then, emit a static initializer to
dynamically look up `SwiftNativeNSObject` by name (which will find it
in either the back-deployment library, on older systems, or in the
runtime for newer systems), then swizzle that in as the superclass of
the @objc actor.
Fixes rdar://83919973.
SwiftNativeNSObject is part of the core runtime on OS versions that
also have the concurrency library, so we need to include a copy of
it with the back-deployed concurrency library.
With these magic symbols, programs that link against the _Concurrency
module with a deployment target prior to iOS 15 / macOS 12 / watchOS 8
will reference `libswift_Concurrency.dylib` via rpath.
Fixes rdar://81187835.