Disable the definition and use of swift_async_extendedFramePointerFlags on watchOS

The asm definition of `swift_async_extendedFramePointerFlags` prevents
the use of bitcode with the back-deployment libraries, so remove the
definition and use of this symbol from watchOS binaries entirely.
Instead, always force the async frame bit to be set. This trades off
backtraces on older OS's for debuggability of newer ones. If it causes
problems, it can be disabled via the option
`-swift-async-frame-pointer=never`.

Fixes rdar://84687579.
This commit is contained in:
Doug Gregor
2021-10-26 22:24:12 -07:00
parent 889d65d1d0
commit 4aca32c0a4
3 changed files with 27 additions and 0 deletions

View File

@@ -1984,6 +1984,14 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
}
}
// watchOS does not support auto async frame pointers due to bitcode, so
// silently override "auto" to "always". This approach sacrifies async
// backtraces in older watchOS versions to gain better backtraces in newer
// versions.
if (Triple.isWatchOS() &&
Opts.SwiftAsyncFramePointer == SwiftAsyncFramePointerKind::Auto)
Opts.SwiftAsyncFramePointer = SwiftAsyncFramePointerKind::Always;
return false;
}