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

Fix build when using clang and libunwind is installed #5646

Closed
wants to merge 2 commits into from

Conversation

Aatch
Copy link
Contributor

@Aatch Aatch commented Mar 31, 2013

This fixes issue #5641

@brson
Copy link
Contributor

brson commented Apr 1, 2013

@graydon How do you feel about this change to configure? This is the first such test for a header file.

@brson
Copy link
Contributor

brson commented Apr 1, 2013

Regardless of whether configure detects that unwind.h exists our source code still contains #include <unwind.h>. So unwind.h has to exist or this isn't going to build. Maybe we should not be redefining the UnwindAction and UnwindException types at all.

@thestinger
Copy link
Contributor

@brson: gcc and clang both come with their own unwind.h, so that's what gets used if libunwind isn't installed. Rust seems to require gcc extensions that clang doesn't expose in the header - it ends up working because Rust links against libstdc++/libgcc_s but it might not work with libc++/libc++abi.

@graydon
Copy link
Contributor

graydon commented Apr 3, 2013

I am not sure this is the right approach. If libunwind is a requirement on platforms where it works (and it is, right?) then surely we should be detecting and failing during configure, not detecting and compiling a broken binary, no?

@thestinger
Copy link
Contributor

Clang doesn't expose the full unwinding interface in the fallback unwind.h but it still seems to work thanks to linking against libstdc++. I don't think Rust ever links against libunwind.

@graydon
Copy link
Contributor

graydon commented Apr 13, 2013

What do we need from unwind.h if we don't link against it? Maybe we can just remove the dependency?

@brson
Copy link
Contributor

brson commented Apr 19, 2013

Yeah, we only need a few declarations just to pass some values through _UnwindResume. Maybe we can forget about unwind.h completely and use our own typedefs.

@Aatch
Copy link
Contributor Author

Aatch commented Apr 24, 2013

Hey, so I just removed all the imports from rust_unwind.h, it compiles and links though I haven't run any tests yet.

I just copied the declarations of the types that upcall uses and it seems to work at the moment. Since this both solves the problem and removes the dependency on (lib)unwind.h I think it works.

I'll push the commit to the branch when everything has finished compiling.

@brson
Copy link
Contributor

brson commented Apr 25, 2013

@Aatch thanks!

@Aatch
Copy link
Contributor Author

Aatch commented Apr 28, 2013

@bors still hasn't picked this up, is there a way that I can get the build bots to do it myself?

bors added a commit that referenced this pull request Apr 28, 2013
@bors bors closed this Apr 28, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 27, 2020
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.

5 participants