Don't use `#cmakedefine` to define values that can be zero.
`#cmakedefine` only sets the definition when the corresponding value in
CMake itself has a truthy value. `0` has a false-y value, so
SWIFT_VERSION_MINOR is undefined for 6.0 resulting in some things
breaking.
This patch automates maintaining the right compatibility override
section names so we don't need to remember to update them by hand with
each version.
The expansions look like
'"__swift" "5" "9" "_hooks"' and
'"__s" "5" "9" "async_hook"'.
Note: The section names can only grow to be 16 characters long. If we
see explosions regarding these names, that could be why.
Certain targets don't support the async calling convention, so we first
add the feature check to avoid breaking the codegen/runtime while doing
gradual rollout for different targets.
Recent Swift uses 2 as the is-Swift bit when running on newer versions, and 1 on older versions. Since it's difficult or impossible to know what we'll be running on at build time, make the selection at runtime.
* cmake: Propagate SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT to overlay builds.
* runtime: Clear the correct bit in getROData()
* test/IRGen/objc_class_export.swift: Allow either is-Swift bit.
* test/stdlib/SwiftObjectNSObject.swift: Allow either name for SwiftObject.