-
Notifications
You must be signed in to change notification settings - Fork 11
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
Make the unwinding dependency conditional on panic = "unwind"
.
#153
Conversation
Similar to sunfishcode/origin#149, make the unwinding dependency conditional on `panic = "unwind"`.
b3ed6e7
to
be1cdad
Compare
For eyra the unwinding dependency will need to be unconditional as libstd has a hard dependency on it. C-gull should probably also have it unconditionally as it pulls in libstd. |
This appears to be one of those situations where cargo automatically provides us with an unwind library. I've now added a c-gull-unwinding example to test using c-gull and |
libstd by default links against libgcc_s or libunwind depending on the target. Did you check that the example doesn't link against any external dylibs? |
Yes:
and $ nm -C ./example-crates/c-gull-unwinding/target/debug/c-gull-unwinding | grep unwinding
00000000000bc4c0 T <unwinding::unwinder::find_fde::GlobalFinder as unwinding::unwinder::find_fde::FDEFinder>::find_fde
00000000000bb9f0 T <unwinding::unwinder::find_fde::phdr::PhdrFinder as unwinding::unwinder::find_fde::FDEFinder>::find_fde
0000000000098f50 T <unwinding::unwinder::find_fde::registry::Registry as unwinding::unwinder::find_fde::FDEFinder>::find_fde
... |
Does it also not link against libgcc_s or libunwind when using panic=abort? |
|
I mean, it does automatically link in libunwind even with |
Yeah, that is what I meant. libstd needs an unwinder even with panic=abort. |
As an update here, cfg(panic = "abort")` did not work in Cargo.toml after all, so unless there are better options, we may need to go back to making unwinding optional and just asking users to figure out when to enable it. |
And revert #153, since cfg(panic = "unwind")` doesn't work in Cargo.toml.
And revert #153, since cfg(panic = "unwind")` doesn't work in Cargo.toml.
Similar to sunfishcode/origin#149, make the unwinding dependency conditional on
panic = "unwind"
.