-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Linker error for cdylib with panic=abort (Undefined symbol "_rust_eh_personality_catch") #34472
Comments
cc @alexcrichton since you've worked on both cdylib (#33553) and panic=abort (#32900) 😊 |
Oh dear sounds bad! Not sure how this got past the bots... Looks like this isn't a problem on Linux (yay linker shenanigans!) but we're erroneously claiming that this symbol is exported from the cdylib when it's not even contained. I believe I see the error and I'll try to have a patch shortly. |
Er, maybe I won't have a chance to get around to this soon :(. As an explanation of the problem, though:
So the problem here is that the loop over crates is looping over all crates, not the crates that are linked. When dealing with panic runtimes and allocators we have crates in the crate store which aren't actually linked, because some output formats may have them linked but others may not. The fix here will probably be just ensuring that when generating the set of reachable symbols for a particular output type we only consider those crates being linked for that output type, not all crates in the world. There's a bit of refactoring here that may need to happen because the reachable set of symbols is also used for LTO, but the principle of the solution should remain the same. I certainly wouldn't mind helping out anyone fix this if I don't end up getting around to it. |
From what I can tell, on macOS today,
|
I think it is expected that an empty |
If I attempt to compile a crate as a cdylib with panic=abort, I get the following error:
I'm using
rustc 1.11.0-nightly (ad7fe6521 2016-06-23)
on OSX 10.11.5.I can repro by compiling an empty lib.rs with
rustc lib.rs --crate-type cdylib -C panic=abort
or with a Cargo.toml like the following:The text was updated successfully, but these errors were encountered: