Skip to content

Conversation

@ladipro
Copy link
Member

@ladipro ladipro commented Aug 4, 2025

Certain build environments may use version 4 of EH frame handlers and hit the same issue that prompted adding the __CxxFrameHandler3 stub. This change is adding two more stubs, __CxxFrameHandler4 and __GSHandlerCheck_EH4, and makes sure they are not folded (have distinct addresses in the resulting binary) by returning distinct values.

None of these functions will ever execute. They are a workaround for a compiler design issue which will take some time to resolve.

Copilot AI review requested due to automatic review settings August 4, 2025 12:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds additional exception handling stubs to resolve linker issues in newer build environments that use version 4 of EH frame handlers. The change extends the existing workaround for compiler design issues by adding two new stub functions that return distinct values to prevent function folding.

  • Add __CxxFrameHandler4 stub function returning 1
  • Add __GSHandlerCheck_EH4 stub function returning 2
  • Update comment to reflect multiple stubs instead of single stub

@ladipro
Copy link
Member Author

ladipro commented Aug 4, 2025

cc @gurry

ladipro and others added 2 commits August 4, 2025 14:18
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Ladi Prosek <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Ladi Prosek <[email protected]>
@gurry gurry requested review from a team, gurry and wmmc88 August 4, 2025 12:37
Copy link
Collaborator

@wmmc88 wmmc88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one small nit on constifying it since the feature has long since been stabilized. Otherwise LGTM.

this is blocked on #406 going in first, but that should be resolved shortly

@gurry gurry added this pull request to the merge queue Aug 6, 2025
Merged via the queue into microsoft:main with commit 935d41a Aug 6, 2025
118 checks passed
@leon-xd leon-xd mentioned this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants