Skip to content
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

Only add CFI instructions for panic=unwind build #40

Merged
merged 2 commits into from
Oct 21, 2024
Merged

Only add CFI instructions for panic=unwind build #40

merged 2 commits into from
Oct 21, 2024

Conversation

nbdd0121
Copy link
Owner

@nbdd0121 nbdd0121 commented Oct 21, 2024

Fix #39

CFI directives are omitted when panic=abort is used.

@nbdd0121
Copy link
Owner Author

@bjorn3 @sunfishcode would you mind doing a quick review? Thanks!

Copy link
Contributor

@sunfishcode sunfishcode left a comment

Choose a reason for hiding this comment

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

This looks good, thanks! I was worried fixing this would require duplicating a bunch of code, but this macro approach looks reasonable. I can also confirm that this works in the Eyra build.

Copy link

@bjorn3 bjorn3 left a comment

Choose a reason for hiding this comment

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

I was thinking if LTO could cause problems when unwinding is compiled as panic=unwind and the executable as panic=abort, but then I remembered that we no longer make all functions panic=abort when doing LTO when any crate is panic=abort to handle extern "C-unwind" safely.

@nbdd0121 nbdd0121 merged commit f4b2326 into trunk Oct 21, 2024
10 checks passed
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.

Regression: error: this directive must appear between .cfi_startproc and .cfi_endproc directives
3 participants