-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add -Zuse-sync-unwind #117744
Add -Zuse-sync-unwind #117744
Conversation
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
For compact unwind info there is also the issue that compact unwinding only supports 3 different personality functions, all of which are used by apple itself ( |
Yes, if want to compact unwind you also must use |
ping @wesleywiser |
r? @bjorn3 Can you help take a look? |
@@ -95,11 +95,12 @@ pub fn sanitize_attrs<'ll>( | |||
|
|||
/// Tell LLVM to emit or not emit the information necessary to unwind the stack for the function. | |||
#[inline] | |||
pub fn uwtable_attr(llcx: &llvm::Context) -> &Attribute { | |||
pub fn uwtable_attr(llcx: &llvm::Context, use_sync_unwind: Option<bool>) -> &Attribute { | |||
// NOTE: We should determine if we even need async unwind tables, as they | |||
// take have more overhead and if we can use sync unwind tables we | |||
// probably should. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@durin42 do you think unconditionally (or by default) using sync only unwind tables would work?
Can you link some more material on the advantages and disadvantages of sync unwind vs async unwind? What are the advantages of async unwind? |
@Nilstrieb I'm not an expert on async unwind but I found some links. https://maskray.me/blog/2020-11-08-stack-unwinding I understand that async unwind is mainly used to support unwinding in function prologue/epilogue. It may be used by tools such as profiling tools (but usually frame pointer should be used). this is achieved by add more cfi to eh_frame, so there is an impact on binary size. |
24d5856
to
ff2d246
Compare
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt These commits modify compiler targets. These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This flag specifies whether LLVM generates async unwind or sync unwind.
ff2d246
to
12784c3
Compare
what do I need to do to move this PR forward? |
@bors r+ |
Add -Zuse-sync-unwind Currently Rust uses async unwind by default, but async unwind will bring non-negligible size overhead. it would be nice to allow users to choose this. In addition, async unwind currently prevents LLVM from generate compact unwind for MachO, if one wishes to generate compact unwind for MachO, then also needs this flag.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#117744 (Add -Zuse-sync-unwind) - rust-lang#118649 (Make inductive cycles in coherence ambiguous always) - rust-lang#118979 (Use `assert_unsafe_precondition` for `char::from_u32_unchecked`) - rust-lang#119562 (Rename `pointer` field on `Pin`) - rust-lang#119619 (mir-opt and custom target fixes) - rust-lang#119632 (Fix broken build for ESP IDF due to rust-lang#119026) - rust-lang#119712 (Adding alignment to the cases to test for specific error messages.) - rust-lang#119734 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#117744 (Add -Zuse-sync-unwind) - rust-lang#118649 (Make inductive cycles in coherence ambiguous always) - rust-lang#118979 (Use `assert_unsafe_precondition` for `char::from_u32_unchecked`) - rust-lang#119619 (mir-opt and custom target fixes) - rust-lang#119632 (Fix broken build for ESP IDF due to rust-lang#119026) - rust-lang#119712 (Adding alignment to the cases to test for specific error messages.) - rust-lang#119734 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#117744 - quininer:add-z-sync-uw, r=bjorn3 Add -Zuse-sync-unwind Currently Rust uses async unwind by default, but async unwind will bring non-negligible size overhead. it would be nice to allow users to choose this. In addition, async unwind currently prevents LLVM from generate compact unwind for MachO, if one wishes to generate compact unwind for MachO, then also needs this flag.
Currently Rust uses async unwind by default, but async unwind will bring non-negligible size overhead. it would be nice to allow users to choose this.
In addition, async unwind currently prevents LLVM from generate compact unwind for MachO, if one wishes to generate compact unwind for MachO, then also needs this flag.