Disable the definition and use of swift_async_extendedFramePointerFlags on watchOS #39935
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The asm definition of
swift_async_extendedFramePointerFlags
prevents the use of bitcode with the back-deployment libraries on watchOS, so remove the definition and use of this symbol from watchOS binaries entirely. This affects whether the async bit is set in frame pointers. Setting the async bit in the frame pointer can cause older APIs (such as backtrace APIs in the OS) to crash when they encounter such frame pointers, but we cannot dynamically set it withoutswift_async_extendedFramePointerFlags
. So, we never set the bit when back-deploying for watchOS device, to avoid said crashes.The trade-off here is that a back-deployed watchOS app will never have the async frame pointer bit set, so async backtraces will be unavailable even when running such an app on watchOS 8 or newer. Moving the deployment target forward to watchOS 8, or running under the simulator for watchOS 8, will restore async back traces.
One can override this behavior with the option
-swift-async-frame-pointer=always
, which statically sets the async bit in the frame pointer. This restores async back traces on watchOS 8, but can lead to the aforementioned crashes on older versions. This approach may be suitable for debugging but is unlikely to be a good idea when deploying.Fixes rdar://84687579.