Commit Graph

5 Commits

Author SHA1 Message Date
Evan Wilde
83f44cdf40 Relax watchos test requirements
To help this test run in production environments, I've reduced the
requirements of the test. It used to require that the compiler was
running on an armv7k or arm64_32 watchOS device, which I don't think is
a test configuration that gets hit all that often.

The new requirements are that you're on watchOS or the simulator, and
can produce arm64_32 code. The test only verifies that the emitted asm
is valid, not that it runs, so we don't need to be running on the
specific hardware. Additionally, the test only checks the output of
arm64_32, not of armvk7, so we only require the 64-bit arm backend.

It would be better if we could check for available SDKs though. The test
only requires an SDK, it doesn't need to be run on the simulator or the
watch.
2023-01-11 16:02:26 -08:00
Evan Wilde
4dc6aad926 Fix async_extended_frame_info_watchos test
The optimizer got smarter and stopped emitting a stack frame for the
empty `someAsyncFunction`, so the test started failing. Adding an opaque
function call to the function body forces the function to get set up
properly, so the test starts passing again.

rdar97790231
2023-01-10 11:44:44 -08:00
Meghana Gupta
222c878a01 Disable failing test swift_async_extended_frame_info_watchos.swift 2022-08-02 12:06:35 -07:00
Doug Gregor
f0cd714161 Rework the watchOS concurrency back-deployment async frame pointer.
Introduce a few changes to the logic for watchOS concurrency
back-deployment with respect to the async frame pointer.

* Only apply the change to watchOS device targets, not simulator targets
* Only introduce the override when no specific
  `-swift-async-frame-pointer=<value>` option is provided on the
command line
* Only override the default when deploying to watchOS < 8, and
* Use "never" for the default rather than "always".

This represents a different but safer trade-off than before. 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. So, with this change 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 on watchOS 8 or newer.
2021-10-27 12:04:20 -07:00
Doug Gregor
4aca32c0a4 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.
2021-10-26 22:26:37 -07:00