Skip to content

[6.2][SUA][IRGen] Add stub for swift_coroFrameAlloc that weakly links against the runtime function #80769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

t-rasmud
Copy link
Contributor

@t-rasmud t-rasmud commented Apr 11, 2025

  • Explanation:
    This commit modifies IRGen to emit a stub function __swift_coroFrameAllocStub instead of the newly introduced swift-rt function swift_coroFrameAlloc. The stub checks whether the runtime has the symbol swift_coroFrameAlloc and dispatches to it if it exists, uses malloc otherwise. This ensures the ability to back deploy the feature to older OS targets.
  • Issues:
    rdar://145239850
  • Original PRs:
    [SUA][IRGen] Add stub for swift_coroFrameAlloc that weakly links against the runtime function #79889
  • Risk:
    The risk is low because we ran SWBs to test that
    1. When the feature is enabled, the newly introduces stub emits the correct runtime function swift_coroFrameAlloc when the symbol is available.
    2. If the swift_coroFrameAlloc symbol is not found, the stub falls back to editing malloc
  • Testing:
    Ran the following SWBs to test changes and found no regressions:
    rdar://148941793 (TMO SWB (Apr 9) with rt)
    rdar://149082640 (TMO reverted rt)
  • Reviewers:
    aschwaighofer

…nst the runtime function (#79889)

* [SUA][IRGen] Add stub for swift_coroFrameAlloc that weakly links against the runtime function

This commit modifies IRGen to emit a stub function `__swift_coroFrameAllocStub` instead of the
newly introduced swift-rt function `swift_coroFrameAlloc`. The stub checks whether the runtime has the symbol
`swift_coroFrameAlloc` and dispatches to it if it exists, uses `malloc` otherwise. This ensures the
ability to back deploy the feature to older OS targets.

rdar://145239850
(cherry picked from commit 5e2f20b)
@t-rasmud t-rasmud requested a review from a team as a code owner April 11, 2025 18:42
@t-rasmud
Copy link
Contributor Author

@swift-ci test

@t-rasmud t-rasmud added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Apr 13, 2025
@t-rasmud
Copy link
Contributor Author

@swift-ci test Linux platform

@t-rasmud t-rasmud changed the title [SUA][IRGen] Add stub for swift_coroFrameAlloc that weakly links against the runtime function [6.2][SUA][IRGen] Add stub for swift_coroFrameAlloc that weakly links against the runtime function Apr 15, 2025
@t-rasmud t-rasmud merged commit 942eddf into release/6.2 Apr 15, 2025
5 checks passed
@t-rasmud t-rasmud deleted the cherry-pick-tmo-stub branch April 15, 2025 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants